Requesting data from instagram via ID?

Good day!

I receive the data request https://www.instagram.com/ptencoff/?__a=1
The problem is that some users change nicknames, respectively, the request generates an error.
I have an idea, to receive requests via the user ID.

Tell me how to do a query by type https://www.instagram.com/ptencoff/?__a=1 but not via name, but via ID
Thank you!
April 19th 20 at 12:18
3 answers
April 19th 20 at 12:20
  1. You want to save the internal ID of a user from Instagram to a database.
  2. In case of error, check the ID using some function through the official API, using a private mobile or web API.
  3. For example, here is the user_id for the account of the apple is equal to 5821462185and query_hash static parameter, but each time I visit the website it's different. Although query_hash the same can be used while working.
  4. Save the new user name in the database (if necessary).
  5. To the number of subscribers using https://www.instagram.com/new-username/?__a=1
  6. Send requests https://www.instagram.com/graphql/query/ need a minimum delay of 1 second, to not banned. Maybe need a bigger delay.
  7. The following solution works without authorization.
  8. And it is desirable to collect data using proxies. For this task perfect mobile for $8/month from LTESpacewhose IP changes every 2 minutes.

Request URL
https://www.instagram.com/graphql/query/?query_hash=ad99dd9d3646cc3c0dda65debcd266a7&variables={"user_id":5821462185,"include_reel":true}

Response
5e983c0c22149343928669.png
Sergey, good day!

I pull the number of subscribers of account data, queries in excel PQ.
In your proposed request does not have the number of subscribers.
I want to get the data array with the number of subscribers, using ID

Prompt the correct decision in your opinion, the easiest formula without token.
like this https://www.instagram.com/ptencoff/?__a=1

Thanks for the help! - Kylee commented on April 19th 20 at 12:23
@Kylee, c using the above functions:

This is the simplest solution, if You want to do it without a token or session. - dandre_Bauch commented on April 19th 20 at 12:26
@Kylee, pull out the data array with the number of subscribers using ID in one request only with a token or using the private c API authorization. - dandre_Bauch commented on April 19th 20 at 12:29
1. This function is public?
2. Do I need further authorization?

Another question, I get the number of subscribers in one request (100 or more users) might do the penalties from instagram (ban)? If Yes, then how to avoid it?

When I pulled the subscribers with a direct link to the account periodically, instagram took on the login screen and did not give data.

Thanks for your help Sergey! I just yesterday started to get involved.. So if I'm being obtuse, keep in mind :) - Kylee commented on April 19th 20 at 12:32
  1. Yes, in the browser called when I visit the website Instagram.
  2. It's just the same decision without authorization.
  3. Send requests https://www.instagram.com/graphql/query/ we need at least a minimum delay of 1 second from 1 IP that is not banned. That is, if You have 50 proxies (50 IP addresses), You can do 50 requests per second, if no delay to send can fly or captcha error 429 Too Many Requests ("too many queries"). Maybe need a bigger delay.
  4. The following solution works without authorization.
  5. It is desirable to collect data using proxies. For this task perfect mobile for $8/month from LTESpacewhose IP changes every 2 minutes.
- dandre_Bauch commented on April 19th 20 at 12:35
Thanks for the help! - Kylee commented on April 19th 20 at 12:38
April 19th 20 at 12:22
Use the Instagram API.

https://api.instagram.com/v1/users/{user-id}/?access_token=ACCESS-TOKEN
For a given point of the desired token. But it is possible without it to obtain the data too. - dandre_Bauch commented on April 19th 20 at 12:25
April 19th 20 at 12:24
<user_id> and <num_of_posts> change to your

https://www.instagram.com/graphql/query/?query_id=17888483320059182&variables=%7B%22id%22%3A%22<user_id>%22%2C%22first%22%3A<num_of_posts>%7D
what is <num_of_posts>?

https://www.instagram.com/graphql/query/?query_id=17888483320059182&variables=%7B%22id%22%3A%221352288822%22%2C%22first%22%3A1%7D


This query shows the number of subscribers - Kylee commented on April 19th 20 at 12:27
@Kylee, the number of posts of the user. - dandre_Bauch commented on April 19th 20 at 12:30

Find more questions by tags InstagramAPI