Check if instagram account name is available

Viewed 10560

I'd like to check if a Instagram username is available the 'proper' way. Currently what im doing is opening the wanted username their instagram page and check if the statuscode is 404. But this presensts a issue because, if the previous owner of the name was banned the account won't exist but, you also can't use the name. I found a old post on here about it except the way they used to do it doesn't work anymore(Check if a user is banned or account doesn't actually exist. Instagram, c#).

So is there a way I can reliably check if a Instagram username is taken? (with or without the Instagram api)

2 Answers

Without code you can always use https://www.thekeygram.com/find-instagram-user-id/

With code you can use: https://www.instagram.com/{username}/?__a=1

If you see an empty object (as in just {}), that user does not exist. If you see data of any kind (more than just {}), then that user does exist.

// Deno
const { status } = await fetch("https://www.instagram.com/username")
console.log(status===200 ? "user exists" : "user doesn't exist")
Related