I'm looking to view and archive all my old DMs in Twitter, since I would like to revive conversations that took place 1 year ago. Acording to Twitter they don't delete old messages, they simply archive them in their database. Is there a way to view and download all of these messages, just like you can view all your old public tweets with third party apps? UPDATE: I found http://snapbird.org/ but apparently it's not working for DMs now
snapbird.org is back again and DM search is working (note that it requires read/write access just to search DMs due to limitations in the scope of Twitter's API)
Commented Nov 16, 2016 at 14:53Downloading your Twitter archive allows you to browse a snapshot of your Twitter information, starting with your first Tweet. Behind link there is Twitter help page which explains how in 5 steps, step by step, request Twitter to create downloadable .zip archive of (quote) "your information from first twit". Since it might take time, they promise send you a link by email after task is finished.
answered Oct 3, 2014 at 17:36 464 5 5 silver badges 16 16 bronze badgesCould you edit in a (brief) summary of what's at the link so the answer can be self-contained, please?
Commented Oct 22, 2014 at 20:17 expanded summary to meet your request. Commented Oct 23, 2014 at 13:39 Does anyone has done it? does it contain DM and how long has it taken? Commented Sep 23, 2015 at 12:18 It does not contain DMs. Commented Jul 18, 2017 at 10:25When Twitter released the Direct Messages feature, it was not possible to get back old messages due to technical choices and limitations. However, they have never been deleted and it is now possible to read any of the messages posted in a conversation using Direct Messages.
Sadly, 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). Consequently, the answer from silpol is currently not correct because you will not be able to retrieve your DMs this way for the moment.
If you just would like to read or download them to keep them offline, there are three ways to do this:
Maybe I can help you with the third 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. No third-party service is involved so you keep your credentials and messages private.
If you would like to use the same logic to make your own program to retrieve the DMs, 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.