jsmrtn / craftagram

Grab Instagram content through the Instagram Basic Display API
Other
14 stars 8 forks source link

Profile meta endpoint is outdated #66

Closed jamesmacwhite closed 6 months ago

jamesmacwhite commented 8 months ago

Looking at information and testing, it would appear it is not enough to add just __a=1, you now need to add __d=dis in addition to this to get a JSON response with the data. Without it you just get an error when logged into Instagram or the login page if not.

Edit, there's apparently different endpoints now:

https://i.instagram.com/api/v1/users/web_profile_info/?username=[instagramhandle]

The main issue is even if you can authenticate, with specific User-Agent and x-ig-app-id headers, the images returned cannot be directly used due to CORS restrictions anyway, you'd have download the images locally and upload to asset storage. Likewise, you'll possibly still get login page challenged after a certain amount of requests too.

jsmrtn commented 8 months ago

Hey @jamesmacwhite,

The addition of __d=dis returns the same as without, either {"message":"Please wait a few minutes before trying again.","require_login":true,"status":"fail"} if not authenticated, or Page not found if logged in.

I'm not particularly of a mind to add the endpoint in question as you need to send arbitrary UA headers, from what I can see, which just feels like there's going to a point when this falls over, too, as meta seek to push more people towards using their authenticated API directly.

This functionality was always kind of in addition to, it appears that Instagram really don't want to expose this information to people, either through the API or otherwise. They do have something similar as part of their actual Graph API, but it's only for creator and business accounts.

Seems to me that this functionality is just being sunsetted by meta in favour of their API, so not sure there's really much we can commit to changing / adding.

Thanks

jamesmacwhite commented 6 months ago

You're absolutely right, it is very unreliable and should be avoided based on my testing.

I would potentially remove the endpoint from the docs of the plugin, given it's not usable anymore.