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 · 25 comments · May be fixed by #758
Open

Deprecation of Instagram Basic Display API #757

jasper-clarke opened this issue Sep 24, 2024 · 25 comments · May be fixed by #758

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.

@frederikkempe
Copy link

@jasper-clarke thanks for your time and effort as I am relying on instafeed.js for several projects. Is there any update from your side?

Thanks once again!

@jasper-clarke
Copy link
Author

Hey @frederikkempe
I'm unfortunately still waiting on my Facebook developer account, it requires that I have been logged into and actively using Facebook on my device before I can register.
Hopefully I will be able to continue soon and I will get back as soon as I can!

@frederikkempe
Copy link

@jasper-clarke can I maybe help you out with my Facebook developer account? I have one up and running.

@jasper-clarke
Copy link
Author

@frederikkempe
I'm not sure how well that would work but I am not opposed to it.
How do you think we could arrange that?

@frederikkempe
Copy link

@jasper-clarke Are you using Discord? You can connect with me by searching for mefredj.

@jasper-clarke
Copy link
Author

Status Update

Me and @frederikkempe are working together to find out the permissions of the new Instagram tokens as to whether this project can continue to be client side or whether it needs to be transitioned to server side (which may not be realistic).

We'll try to get back within a week hopefully as to the next steps and the result of our research.

@jasper-clarke
Copy link
Author

Update

I've managed to get my Facebook Developer account working and me and @frederikkempe are continuing to work on a functional setup using instafeed.js and the new API.

The good news is this, we may not need to make any code changes to instafeed.js at all!
The reason for this is because most of the underlying API endpoints have not changed, just the method in which you get and refresh the access token.
And as well through more research we have found that you can restrict access tokens to only fetch already publicly available information so this project can remain client side!

The bad news, instagram-token-agent is now invalidated and will not work for the new tokens.
A new service must be made to refresh the access tokens. With some time I am more than happy to construct a new service from scratch with hopefully some improvements.

@stevenschobert What are your thoughts on this so far?

@stevenschobert
Copy link
Owner

@jasper-clarke @frederikkempe That is good news, thanks for the updates and work on this!

So long as the tokens can be restricted to fetching public info, I'm happy to accept any code and document changes that will keep the project alive!

I don't have much time to contribute to building a new agent refresher, but I can help answer questions and provide some history on things, if you want to add me to the convo in discord (username stevenschobert).

That refresh service repo was made by @benjamin-hull (who also worked with me on the migration to the Instagram/Facebook Basic Display API a few years back). Not sure if has any plans to build a new service or not, but could be worth asking!

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

Successfully merging a pull request may close this issue.

6 participants