Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Anyone have this for Twitter? I want to remove most of my tweets but the official API costs $200


Maybe reverse it from the web app.

I deleted a tweet and saw this request:

    HTTP POST https://x.com/i/api/graphql/VstuveVgh5q5jk7lmnVopqr/DeleteTweet
    {
        "variables": {
            "tweet_id":"12344567899123",
            "dark_request":false
        },
        "queryId":"VstuveVgh5q5jk7lmnVopqr"
    }

You can execute these from javascript in the browser if the auth part is too complicated.

### Update, this is the pure javascript console way, if you don't want to write your own client doing HTTP posts

I played with the console more and got these parts:

// Find all tweets on screen (this gives you the tweet IDs too)

    document.querySelectorAll('a > time')
// Click the "more" button on the first tweet

    document.querySelectorAll('a > time')[0].parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.parentElement.querySelector('button').click()
// Click delete on the tweet

    document.querySelectorAll('[data-testid="Dropdown"]')[0].children[0].click()
// Confirm delete

    document.querySelectorAll('[data-testid="confirmationSheetConfirm"]')[0].click()


Shortly before they destroyed the API I made a little script to delete all my tweets. Was really really handy


I did this by writing a script in the console of twitter.com that walked all my tweets and deleted them one by one. Nothing fancy needed.


I don't have exactly what you're looking for, but I built a personal RSS-feed generator for twitter accounts that runs Selenium, and scans the DOM for data - using vxtwitter to fetch things in an easier way.

You could do something similar; as someone else suggested, just walk the feed via DOM elements.


You can request a GDPR deletion if you are in Europe? I don't know how Twitter actually conform to this regulation if you are outside of the EU, or how they would even know you are outside of the EU.

https://gdpr.x.com/en/faq.html


Their delete post endpoints probably require auth. What’s to stop you from deleting someone else’s posts


…you can see what auth/headers are passed to the endpoint from said developer tools.

I agree with sibling commenters that automating the browser with DOM APIs is an easier route to go though.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: