5

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)

Stefan
  • 113
  • 1
  • 2
  • 8

2 Answers2

10

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.

Community
  • 1
  • 1
Cpu Nerd
  • 312
  • 2
  • 11
  • It seems like the code method doesn't work or am I doing something wrong. In the browser, when the user exists, I see all kind of information, when he doesn't exist, I see only a pair of brackets. Problem is that I can't catch an error in the code. – Mo711 May 26 '20 at 20:47
  • 1
    @Mo711 the pair of brackets represent an empty JSON object and it's perfectly normal if there is no data to be displayed. – Cpu Nerd Dec 15 '20 at 04:17
0
// Deno
const { status } = await fetch("https://www.instagram.com/username")
console.log(status===200 ? "user exists" : "user doesn't exist")
YassBan
  • 65
  • 10