3

I am using the Instagram API and I'm having some small roadblocks. I already got my Access Token working on the Graph API but the user_id I'm feeding it seems to not be working, I'm retrieving the ID from Otzberg using the app-linked Instagram account's username, but I'm not sure it's the right one.

Here's the query:

https://graph.facebook.com/ig_hashtag_search?user_id={USER_ID}&q={HASHTAG}&access_token={ACCESS_TOKEN}

Any advice?

Posho
  • 53
  • 1
  • 6

2 Answers2

0
  1. You had get legacy instagram user id from Otzberg. This user id had work with old instagram API. When you call your endpoint with this user id you should get message : Param user_id is not a valid Instagram User ID .
  2. For use ig_hashtag_search you should get permission for Instagram Public Content Access
  3. You should use IG User#id with this endpoint. You can search user id from business-discovery(GET /{ig-user-id}/business_discovery).

P.S. new ig-user-id - usually it 17+/- numbers.

Eugene K
  • 171
  • 3
  • Hey! Thank you for the fast response. I'm likely missing something but I fail to understand how I would retrieve my ig-user-id with a query that requires my ig-user-id. – Posho Aug 20 '20 at 01:50
  • https://graph.facebook.com/me - fetch your id. Then [https://graph.facebook.com/{your-id}?fields=instagram_business_account](https://developers.facebook.com/docs/instagram-api/reference/page/)- and fetch your business_account_id. Here example response from docs ```{ "instagram_business_account": { "id": "17841405822304914" }, "id": "134895793791914" }.id```. You should use your `instagram_business_account.id` for `ig_hashtag_search ` – Eugene K Aug 20 '20 at 19:52
  • https://graph.facebook.com/me says "error": { "message": "An active access token must be used to query information about the current user.", – Jason FB May 22 '21 at 10:42
0

On a browser on which you are authenticated on the good account go the page : https://graph.instagram.com/me?fields=id,username&access_token=YOUR_ACCESS_TOKEN

fxbois
  • 806
  • 9
  • 21