Closed SaoYan closed 3 years ago
I found the problem: calling fetch()
on endpoint https://www.instagram.com/${username}/?__a=1
returns HTML rather than JSON. It seems that https://www.instagram.com/${username}/?__a=1
is not a valid ins GraphQL API. In order to use ins API, an ins business account and a Facebook developer account is required.
You need to create an app under the Facebook dev account and get it reviewed. An access token will be granted to the APP, which can be used to invoke the Graph API. The endpoint is https://graph.facebook.com/v3.2/<account_id>?fields=followers_count&access_token=<token>
For more details see https://developers.facebook.com/docs/instagram-api/getting-started
This is probably out of this project's scope... So you may want to remove the current support for Instagram
Hmmmm, this worked before, let me have a look.
@SaoYan Could you try to deploy a second "Substats" on your Cloudflare Workers account and try if the Instagram path works? It seems that the current api.spencerwoo.com
is limited by Instagram, because I can request the correct parameters through this (undocumented) API locally.. (Though I'm not sure.)
https://www.instagram.com/${username}/?__a=1 is not supposed to be used, so I guess any domain that invokes it for some times will be banned.
So the rightful way to do this would be to get a verified dev account from instagram, and in order to do so I'm going to need a business account... All right I give up, dropping instagram support for now.
This is weird, I rebuilt and published a version to Cloudflare Workers and the route is working again.
Can you confirm @SaoYan? If so, I'm going to mark this route as unstable instead of inaccessible.
Nope, never mind, still banned.
Result:
I tried with my ins id and some others, the API always returns 0 followers. The handler code for instagram looks fine. Maybe there's something wrong with the backend. @spencerwooo