1

I've downloaded all my old tweets, but I'm still not sure on how to get my old direct messages back. Can someone please tell me how to do that?

1
  • What has caused you to lose them? Why can you not just log in to Twitter and see them? Jul 23 '15 at 13:49
1

Direct messages are not a part of the Twitter archive, it only contains your tweets and retweets. If you have deleted a direct message, there unfortunately is no way to get it back.

0

I am not sure what you mean by "get back" your direct messages. Like Zedinc pointed it, the DMs are not part of your archive (because I guess it would require to contain tweets from other people of your conversations to make sense).

If there are not deleted and you just would like to download them to keep them offline, there are two ways to do this:

  1. Use the Twitter API and deal with its limitations: only the latest 200 direct messages can be retrieved.
  2. Use a tool to simulate the browsing of a conversation and parse the result.

Maybe I can help you with the second idea. I have created a tool (https://github.com/Mincka/DMArchiver) to download my direct messages, with the ability to also download the uploaded images and GIFs (as MP4).

Because it does not rely on the API, it is possible to download more than 200 messages. The script just simulate the "scrolling method" and parse the result.

The main idea is to make requests in loop by calling the following URL with a valid auth_token cookie value for the authentication and parse the json response: https://twitter.com/messages/with/conversation?id=1337&max_entry_id=1337

The max_entry_id value is not required for the first request. You need to use the value of the min_entry_id variable in the response as the new max_entry_id in each subsequent iteration to get the next 20 older tweets. When max_entry_id is not in the json response, you are at the begin of the thread.

Not the answer you're looking for? Browse other questions tagged or ask your own question.