Skip to content

Historical Twitter data: how to get old tweets

How to get historical Twitter data: X's full-archive search, searching by date with an API, your own archive download and what to expect from free options.

Piyushh · November 13, 2026 · 3 min read

A tall archive of drawers with one pulled open, picturing old tweets kept in storage.

To get historical Twitter data, you have three real options: X's own full-archive search, a read API that searches by date, or the downloaded archive of your own tweets. Free historical Twitter data does exist, but it only covers your own account or a manual search. This post matches each route to the job it fits and includes a working script for the API route.

What X's full-archive search covers

X has two search endpoints for posts. X's search docs (checked 2026-11-13) describe them like this:

  • Recent search, /2/tweets/search/recent, covers the last 7 days and is available to all developers.
  • Full-archive search, /2/tweets/search/all, covers "the complete Post archive dating back to March 2006" and is available to pay-per-use and Enterprise customers.

Both use X's search operators. Full-archive is the real source of historical Twitter API data, and it needs a developer account and billing. The current price per post read is on X's pricing page, and our summary is in is the X API free.

To run Twitter full archive search in Python against X, call that endpoint with your Bearer Token, either through a library or with requests. Our Twitter API Python guide shows the library route.

A Twitter historical data API without the developer app

If you would rather not run an X app, a read API can search by date window. ChatterAPI is independent and not affiliated with X Corp. Its x.search endpoint takes q, since and until (as YYYY-MM-DD), sort, lang and a cursor.

curl -s "https://api.chatterapi.com/v1/x/tweets/search?q=from%3Alevelsio&since=2024-01-01&until=2024-01-31&sort=latest" \
  -H "Authorization: Bearer $CHATTERAPI_KEY"

Each page holds about 20 tweets and costs 2 credits on a live key. For the next page, pass page.nextCursor back as cursor, and keep going until hasMore is false.

I have not verified how far back this search reaches. Because it is a search endpoint, it returns whatever X's search returns, so an old tweet missing from X's search will be missing here too. Test your own date range before you build on it: run the query and check the oldest createdAt in the result. The post on searching tweets by date covers the operators and the gaps people report in X search.

Scraping historical Twitter data

You will find tutorials that scrape historical Twitter data with headless browsers or old libraries. Be careful with them. They break whenever X changes the page, and X's developer rules restrict automated access. If you go that route, read the terms first and plan on maintaining the scraper. The honest alternatives are the two above.

Archive an account by date window

This script pulls one account's tweets a month at a time and writes them out as JSON lines. Searching by month keeps each query small, and the results don't depend on how many tweets came later.

import json, os, requests
from datetime import date

URL = "https://api.chatterapi.com/v1/x/tweets/search"
H = {"Authorization": f"Bearer {os.environ['CHATTERAPI_KEY']}"}

def month_ranges(start_year, end_year):
    for y in range(start_year, end_year + 1):
        for m in range(1, 13):
            a = date(y, m, 1)
            b = date(y + (m == 12), (m % 12) + 1, 1)
            yield a.isoformat(), b.isoformat()

with open("tweets.jsonl", "w") as out:
    for since, until in month_ranges(2023, 2024):
        cursor = None
        for _ in range(5):  # at most 5 pages (10 credits) per month
            params = {"q": "from:levelsio", "since": since, "until": until, "sort": "latest"}
            if cursor:
                params["cursor"] = cursor
            body = requests.get(URL, headers=H, params=params, timeout=60).json()
            for t in body["data"]:
                out.write(json.dumps(t) + "\n")
            cursor = body["page"]["nextCursor"]
            if not body["page"]["hasMore"]:
                break

Swap in the handle of the account you're studying. The range(5) cap keeps spending in check: 24 months at 5 pages comes to 240 credits at most.

To store and clean what you collect, read the Twitter dataset guide.

Your own tweets: download the archive

For your own account, X's archive download is the best option: it is complete, free and yours. In the app, go to Settings and privacy, then Account, then Your X data. Verify your identity and request the data. X emails you a link when the file is ready, which can take days. Our search tweets by date post has the steps and the help page we checked.

Free Twitter dataset options

People often ask for a free Twitter dataset or an old Twitter API dataset to download, and some research groups publish them. Before you use one, check three things: that the date range matches yours, that the licence allows your use, and that the platform's terms still permit what you plan to do. Many older sets are only lists of tweet ids, so you'd have to fetch the tweets again to get the text.

Which route to take

You needUse
Your own full historyX archive download
Everything on a topic since 2006, completeX full-archive search, billed by X
Other people's tweets by date, no X appA read API with since and until
A quick lookX search in a browser

You can search old tweets for a keyword right now with the free X tweet search tool. For the script above, sign up with Google to get a key. The 7-day free trial includes 1,000 credits, which is about 500 pages of search. Plans start at $19 a month; see the pricing page.

FAQ

How do I get historical Twitter data?
Three routes. X's full-archive search endpoint, a read API that lets you search by date window, or your own downloaded X archive for your own tweets. Which one fits depends on whose tweets you need and how far back.
Is there a free source of historical Twitter data?
For your own account, yes: X lets you download your archive. For other people's tweets, X's search in a browser is free but manual. Ready-made free Twitter datasets exist on research sites, but check the licence and whether they fit your date range.
How far back does X's full-archive search go?
X's search docs, checked 2026-11-13, say it searches the complete post archive dating back to March 2006, and that it is available to pay-per-use and Enterprise customers.
How far back does ChatterAPI's tweet search go?
We have not measured a hard limit and will not guess one. It accepts since and until dates. Run your date range on a test search and look at the oldest row that comes back.
Can I use Python for Twitter full-archive search?
Yes, against X's own endpoint with its Bearer Token, or against a read API with requests. Both return JSON you can page through. The script in this post archives by date window.

More on X (Twitter) API

Try it free for 7 days.

1,000 credits to make your first calls. One key for Reddit and X, over REST or MCP.