threads.js icon indicating copy to clipboard operation
threads.js copied to clipboard

official API support

Open elijah-wright opened this issue 2 years ago • 4 comments

https://www.threads.net/@0xjessel/post/C1AqVMiySi6

issue to keep track of endpoints in the upcoming official API

elijah-wright avatar Dec 19 '23 00:12 elijah-wright

https://developers.facebook.com/docs/threads

Any plans to support this?

sleep9 avatar Apr 12 '24 15:04 sleep9

thanks for showing me this, will refactor ASAP

elijah-wright avatar Apr 12 '24 23:04 elijah-wright

@sleep9 the API you linked is in private beta, meaning I don't have the ability to test it in practicality. however, I'm preparing for the public release of the API and I'm setting up a branch (v2) for anyone who does have access to the API to use. when the API releases to the public, I will merge that branch into this one

however, one thing that is currently possible is retrieving profile IDs and usernames using an Instagram token with the correct permissions

elijah-wright avatar Apr 13 '24 00:04 elijah-wright

Great news. Looking forward.

sleep9 avatar Apr 13 '24 02:04 sleep9

the official API has been released. I am closing this and publishing my changes immediately

elijah-wright avatar Jun 18 '24 13:06 elijah-wright

Have the changes been merged already? I noticed most of the functionality is gone.

sleep9 avatar Jun 18 '24 18:06 sleep9

yes, unfortunately there's not a lot to the Threads API at the moment. you can still use v1.9.0 if you want to use the old library functions. is there anything you need in specific?

elijah-wright avatar Jun 18 '24 18:06 elijah-wright

Almost every endpoint is utilized. Will have maintain our own library that is a combination of the new and old libraries. Reviewing the code I am unsure which functions we can migrate to the new functions and which ones we need to maintain as documentation is lacking. Do you know where I can find the official API spec? Also do you know where I can find documentation on logging into threads using Instagrams oauth/2fa?

sleep9 avatar Jun 18 '24 19:06 sleep9

I would recommend not switching to v2 then. the Threads API documentation is here but it is very unfinished and references some endpoints that have a different structure than others. still, it has information on using Threads with an OAuth application

elijah-wright avatar Jun 18 '24 19:06 elijah-wright

Is it possible to initialize v1.9.0 with an access token retrieved via threads oauth? Right now we are using the client.login method to authenticate...

sleep9 avatar Jun 19 '24 22:06 sleep9

as far as I know, no, because they're different endpoints (graph.threads.net/graph.instagram.com vs i.instagram.com). from what I know about Instagram, the split is intentional in order to prevent people from using official Meta APIs to create third-party apps

elijah-wright avatar Jun 19 '24 22:06 elijah-wright

Yea thats unfortunate. While using v1.9.0 logins are frequently rejected which is a dealbreaker for a production app and the new threads API only supports a subset of the previous functionality.

sleep9 avatar Jun 19 '24 22:06 sleep9