Hi,

I built a simple Twitter API client that iterates over my likes and deletes them. My plan is to run this each 180 days or so.

It worked fine for tweets from the last 6 years. However, it isn’t deleting my likes to tweets from 2014 or older.

Here is the HTTP request my Go tool is sending to your API as seen by my Burp Suite tool (HTTP proxy I’m using to debug what’s happening):

DELETE /2/users/REDACTED/likes/REDACTED HTTP/2
Host: api.twitter.com
Authorization: OAuth oauth_consumer_key="REDACTED", oauth_nonce="REDACTED", oauth_signature="REDACTED", oauth_signature_method="HMAC-SHA1", oauth_timestamp="REDACTED", oauth_token="REDACTED", oauth_version="1.0"
Accept-Encoding: gzip, deflate
User-Agent: Go-http-client/2.0

I know my code works since I used it delete ~3k likes during the past week.

The backend seems to confirm the like has been deleted (HTTP response body):

{"data":{"liked":false}}

However, the like is never deleted (tried waiting for 24 hours in case it was an asynchronous process).

Here are the response headers I receive in case you wanna check the logs on your internal systems.

X-Connection-Hash: 3d87764b17f42a18ad6d408a653650779ce54cc1af1715f0eda6a5f8747ecf82
Server: tsa_f

I know it isn’t a rate-limit issue since I’ve tried waiting for 10 hours without running any request and then running just 1.

The likes I’m trying to delete are from 25 may. 2014 and older. I’ve also tried using the old v1 API to delete them.

Could you please help me here? Thanks!

Hi @andypiper - may I get someone from Twitter to review this behavior? It looks like a serious bug to me.

Cheers,

This is still a problem making your API unusable for deleting likes. Could anyone from Engineering have a look here? cc @andypiper.

Thanks!

1 Like

I’m not certain of the time limitations on the API here.

Can you share a specific example of a user ID and Tweet ID?

Are you able to remove an older like via the Twitter app?

Hi @andypiper - Yes, I tried and was unable to delete any like I gave before that specific one via the API.

Are you able to remove an older like via the Twitter app?

Not in a desirable way. The UI doesn’t actually show the like (red heart). Find below a screenshot from my own account. Chrome for MacOS.

Account ID: 405662455
Example tweet ID shown in my likes page but for which I’m unable to delete the like: 470309512554246144

Please, let me know if anything else is needed from my side. Thanks for your time and help!

Hi @andypiper - I discovered something super weird. This is what happens when I refresh my own likes page a couple of times. Note how the red hearts appear and disappear as I refresh the page.

Here you can view the screencast without having to download it: Gofile - Free file sharing and storage platform

I just double-checked and I’m still unable to delete the tweets via the API besides it returning a success response.

HTTP/2 200 OK
Date: Sat, 27 Aug 2022 17:28:10 UTC
Server: tsa_f
Set-Cookie: REDACTED
Api-Version: 2.49
Content-Type: application/json; charset=utf-8
Cache-Control: no-cache, no-store, max-age=0
Content-Length: 24
X-Access-Level: read-write-directmessages
X-Frame-Options: SAMEORIGIN
X-Xss-Protection: 0
X-Rate-Limit-Limit: 50
X-Rate-Limit-Reset: 1661622190
Content-Disposition: attachment; filename=json.json
X-Content-Type-Options: nosniff
X-Rate-Limit-Remaining: 49
Strict-Transport-Security: max-age=631138519
X-Response-Time: 253
X-Connection-Hash: 27ab103071d8aa9c6fc31080fde1d7c3c8d97b3da9099f26924514993e720137

{"data":{"liked":false}}

Hope the X-Connection-Hash ID helps engineering debug this situation.

All my requests were according to the API and worked for a long set of tweets. However, for these above they didn’t work. I finally gave up on debugging this and used GitHub - koenrh/delete-tweets: Delete tweets from your timeline. (+ this PR to delete likes Unlike tweets by lucasresck · Pull Request #107 · koenrh/delete-tweets · GitHub) and it worked like a charm. Documenting the solution here in case anyone else faces the same situation.

Closing this thread now since my problem is now resolved.

2 Likes

Thank you for sharing this solution that worked for you!