Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecation of Instagram Basic Display API #757

Open
jasper-clarke opened this issue Sep 24, 2024 · 17 comments
Open

Deprecation of Instagram Basic Display API #757

jasper-clarke opened this issue Sep 24, 2024 · 17 comments

Comments

@jasper-clarke
Copy link

Hello,
I just wanted to check that this project will be revised to accomodate the upcoming deprecation of the Basic Display API
Thanks!
https://developers.facebook.com/docs/instagram-basic-display-api
image

@stevenschobert
Copy link
Owner

Welp, that’s definitely a big bummer.

I haven’t read the docs extensively yet, but it looks like the Instagram API they suggest migrating to, is only usable with Professional accounts?

If so, then effectively they would be dropping support for getting personal photos from the API to display on a web page — which was the original reason I wrote this library… ☹️

@jasper-clarke
Copy link
Author

Hey @stevenschobert
Thanks for getting back, I have done a fair bit of research myself and I also found that a business or creator Instagram account is required for the Instagram login flow and the Facebook login flow requires a Facebook page linked to your Instagram account.
Overall this deprecation looks to have aimed to reduce access to Instagram data for most people.

As of current I haven't been able to find another official way to fetch user posts/information, mostly because my purpose for the API is to get content for businesses websites.
For personal projects it looks like some sort of scraper or external tool may be the only way now...
Also I'm so sorry that this has happened, it is such a pain to create something like this just to have it rendered unusable because of someone else's decision!

@moayad-do6
Copy link

moayad-do6 commented Oct 11, 2024

Hi @stevenschobert,

I just wanted to confirm - will Instafeed.js be getting updated to work with the Instagram API and continue to support business Instagram accounts after December 4th?

@stevenschobert
Copy link
Owner

Howdy @moayad-do6! Thanks for the question! And thanks to @jasper-clarke for noticing the API change and posting.

I think for now the answer is probably no, I don’t have time to update Instafeed.js to support the new API before December 4th. 😞

At this point I don’t really know how much work it will take to make the changes, and I don’t have any time do that research.

It’s possible that it might not be many changes, code-wise, but I don't have an account to setup to test it out, or really any spare time at all to dedicate to the project at all :(

If some kind soul out there wants to help with this, please do post in this thread!

@jasper-clarke
Copy link
Author

jasper-clarke commented Oct 29, 2024

@stevenschobert
I’ve been doing a bunch more work on this and made an updated implementation in PHP for my work but through doing so I found the change may not be so difficult for this project.

I’m going to work on a pull request and should hopefully post it within the next 10 days.
Don’t quote me on that though 🤣

@stevenschobert
Copy link
Owner

@jasper-clarke that’s great news! 🙌

Let me know if you have questions about the code!

@jasper-clarke
Copy link
Author

@stevenschobert
Thanks,
I think the only change the needs to be made is a way to refresh and create the initial token.
Since "Professional" Instagram accounts are now required the method is different.
I'll update the documentation and would you like me to have a go at integrating a token refresher into this project or should I make it it's own project.

@stevenschobert
Copy link
Owner

@jasper-clarke that’s surprising — I was guessing at least the URL and request/response formats would have changed?

For tokens — are the tokens still limited to read/only access with no ability to get private data like accounts, direct messages, etc?

@jasper-clarke
Copy link
Author

@stevenschobert
All of the graph.instagram.com URL's are the exact same but the obtaining an access token now requires you go to an OAuth link and then it will return a "code" as it did before, which you exchange for a long lived token in the same way.

Yes you cannot read other users data still. Only the data of the user owning the access token.

@stevenschobert
Copy link
Owner

@jasper-clarke interesting! The way they worded it, it sounded like a whole new API.

It’s good that you can’t access other users tokens — but what all data from the owner of the token can it fetch?

With instafeed.js, the tokens are exposed on the client side, so have to be assumed to be publicly viewable.

@jasper-clarke
Copy link
Author

jasper-clarke commented Nov 2, 2024

@stevenschobert

  1. https://developers.facebook.com/docs/instagram-platform/reference
  2. That is a problem because the new API allows you to send messages to other users with only the access token. It could maybe be possible to disable that permission though but it is still now much more dangerous to expose this token client side.
    https://developers.facebook.com/docs/instagram-platform/instagram-api-with-instagram-login/messaging-api

@BT-KS-808
Copy link

Iʻm also in need of the migration of instafeed! Thanks for any help you can provide!

@jasper-clarke
Copy link
Author

@stevenschobert
I'm not sure if you answered my question earlier?

would you like me to have a go at integrating a token refresher into this project or should I make it it's own project.

Welcome to the discussion @BT-KS-808 we are just deciding on a path to take for setting up the new system.

@stevenschobert
Copy link
Owner

@jasper-clarke sorry, thanks for the reminder.

not sure on the refresher part — it would be a server-side component right?

The more important piece I’m stuck on right now is the part about the token security.

If the token allows you to do anything other than fetch public photos, it can’t be used in a client-side manner anymore.

@jasper-clarke
Copy link
Author

@stevenschobert
I do think your right, I feel this may need to be a server side addition instead of client side.
I'll do some more thinking and research about possible solutions and get back to you.

@squidgemonster
Copy link

It really sucks that Facebook have decided to remove the basic display API - it's pretty much all that I needed for a lot of projects, and with a months notice, it'll be gone.

It will be great to see if progress is made here to get instafeed.js working with the main API.

Failing this, https://www.instant-tokens.com has been my go-to service since all this API stuff went sideways.

You have to pay, $45/£45 per year, but it's a fairly low price for unlimited sites, and the service takes care of renewing tokens etc for you.

@jasper-clarke
Copy link
Author

jasper-clarke commented Nov 25, 2024

@stevenschobert
I'm working on creating a Facebook Developer account so I can revise the documentation and properly test if the changes I am working on are successful. Facebook is giving me a hard time trying to create the account so its taking a while.

I'll get back soon with some results and hopefully a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants