junhoyeo / threads-api

Unofficial, Reverse-Engineered Node.js/TypeScript client for Meta's Threads. Web UI Included.
https://threads.junho.io
MIT License
1.58k stars 135 forks source link

Get getPostIDfromURL is getting 429 from Vercel #91

Open 0Xero7 opened 1 year ago

0Xero7 commented 1 year ago

Looks like calling getPostIDfromURL from Vercel is getting 429 responses. GetPostID

However, getThreads is working fine GetThreads

The test thread

Perhaps we need to find the API endpoint for getPostIDfromURL instead of just calling the website? 🤔

e-roy commented 1 year ago

I think this is happening by ip address from threads.net

0Xero7 commented 12 months ago

For anyone facing this issue, I had to use a proxy provider to "solve" it

e-roy commented 12 months ago

For anyone facing this issue, I had to use a proxy provider to "solve" it

@0Xero7 do you have an example code of what you mean?

I'm using "threads-api": "^1.4.0", and the issue is intermittent for me, mostly not working.

0Xero7 commented 12 months ago

For anyone facing this issue, I had to use a proxy provider to "solve" it

@0Xero7 do you have an example code of what you mean?

I'm using "threads-api": "^1.4.0", and the issue is intermittent for me, mostly not working.

Hey, sorry for the late response. Looks like this particular issue has been fixed.

If you are being 429'd on other methods, I basically used a proxy (I used ZenRows) to send the requests. You can take a look at their documentation for details.

Here is a code snippet -

response = await axios({
            url: 'https://api.zenrows.com/v1/',
            method: 'POST',
            headers: {
                'accept': '*/*',
                'content-type': 'application/x-www-form-urlencoded',
                'x-asbd-id': '129477',
                'x-fb-lsd': 'kugg2VLa1Ctd3eh0XkX39T',
                'Referrer-Policy': 'origin-when-cross-origin',
            },
            params: {
                'url': url,
                'apikey': apikey,
                'premium_proxy': 'true',
                'custom_headers': 'true',
            },
        });