Historical Twitter Data in 2026: Search Back to 2006
Where to get historical Twitter data in 2026: X's full-archive search vs cheaper APIs, the date-to-ID trick, a working script and real output from 2012.
Tarun Khatri
Published · Updated · 8 min read
To get historical Twitter data in 2026, search X's full archive by date range, through X's own API or a cheaper third-party one.
This guide is for researchers and developers who need old X (Twitter) posts. You get each route's price, a date-to-ID trick and a script that walks any period. We run Weir, one of these APIs, so weigh our view knowing that.
This pulls one day of an account's posts from 2012:
curl --request POST \
--url https://api.weirapp.io/v1/x/search \
--header "Authorization: Bearer $WEIR_API_KEY" \
--header 'Content-Type: application/json' \
--data '{"fromUsers":["MarsCuriosity"],"since":"2012-08-06T00:00:00Z","until":"2012-08-07T00:00:00Z","limit":3}'
Where to get historical Twitter data in 2026
Pick by whose posts you need, how many, and whose terms you must follow:
| Route | Reaches back to | Per 1,000 posts | Best for |
|---|---|---|---|
| X full-archive search | March 2006 | $5 | Official data, big pulls |
| Weir search | March 2006 | $0.105 to $0.21 | Cheap reads, AI agents |
| TwitterAPI.io search | Not stated | $0.15 | Lowest price, posting |
| Your X archive | Your first post | Free | Your own account |
| Research datasets | Fixed periods | Free, IDs only | Rebuilding old studies |
For your own posts, start with X's archive: how to download all tweets from a user walks through it.
How does the X API full-archive search work?
X's official route is GET /2/tweets/search/all, which X's docs open to pay-per-use and Enterprise customers.
X's docs list, as of October 2026:
- Reach: public posts back to March 2006. Recent search covers only the last 7 days.
- Page size: up to 500 posts per request, with
next_tokenfor the next page. - Speed: one request a second, and at most 300 per 15 minutes per app.
- Price: $0.005 per post read. Plans are capped at 3 million post reads a month.
- Windows: dates go in
start_timeandend_time, post IDs insince_idanduntil_id. X takes only one ofstart_timeandsince_id, and one ofend_timeanduntil_id.
X's pricing page also lists full-archive post counts at $0.010 per request. A count tells you how big a job is before you pay to read it.
Step 1: Turn a date into a tweet ID
Every post since 4 November 2010 carries its creation time inside its ID.
Twitter's Snowflake code puts milliseconds since that date in the top bits. Shift a timestamp left by 22 bits and you get the smallest ID for that moment:
from datetime import datetime
X_EPOCH_MS = 1288834974657 # X's id epoch: 4 November 2010
def date_to_id(when):
ms = int(datetime.fromisoformat(when).timestamp() * 1000)
return str((ms - X_EPOCH_MS) << 22)
print(date_to_id("2012-08-06T05:30:00Z")) # 232347770680246272
print(date_to_id("2012-08-06T05:40:00Z")) # 232350287262646272
Our tweet ID to date converter does the reverse in your browser.
Posts from before November 2010 have small IDs with no time inside. For those years, use whole days with since and until.
Step 2: Search one date window
Weir's search takes sinceId and untilId as window bounds, and both are exclusive.
We searched the Curiosity rover's account between the two IDs above, the night it reached Mars:
{
"fromUsers": ["MarsCuriosity"],
"sinceId": "232347770680246272",
"untilId": "232350287262646272",
"limit": 3
}
We ran this on 21 October 2026. It returned three posts for 4 credits. The newest, trimmed:
{
"id": "232348380431544320",
"text": "I'm safely on the surface of Mars. GALE CRATER I AM IN YOU!!! #MSL",
"createdAt": "2012-08-06T05:32:25.000Z",
"likeCount": 10098,
"retweetCount": 44891,
"viewCount": null
}
A null count means X didn't report it, not zero. Every 2012 post we fetched had no view count.
Step 3: Walk a long period, one day at a time
A long period is many small windows, each paged to the end. A crash then costs you one day, not the whole run.
import os, requests
API = "https://api.weirapp.io/v1/x/search"
HEADERS = {"Authorization": f"Bearer {os.environ['WEIR_API_KEY']}"}
def window(body, max_pages=50):
for _ in range(max_pages):
r = requests.post(API, headers=HEADERS, json=body, timeout=60)
r.raise_for_status() # stops on 402 (no credits) or 429 (too fast)
page = r.json()
yield from page["data"]
body["cursor"] = page["meta"]["nextCursor"]
if not body["cursor"]:
return
Then loop over the days you need:
from datetime import date, timedelta
day = date(2012, 8, 1)
while day < date(2012, 9, 1):
nxt = day + timedelta(days=1)
body = {"fromUsers": ["MarsCuriosity"], "limit": 20,
"since": f"{day}T00:00:00Z", "until": f"{nxt}T00:00:00Z"}
for post in window(body):
print(post["createdAt"], post["id"], post["text"][:60])
day = nxt
Swap fromUsers for query to collect a topic instead of an account. Our X advanced search operators guide lists the filters you can add.
Each window ends with one empty call that costs 1 credit.
What does historical Twitter data cost?
Here are 10,000 posts on each route, as of October 2026:
On Weir, a search call costs 1 credit plus 1 per post, and X serves about 20 posts per call. So 10,000 posts take about 10,500 credits.
The 5,000 free credits each month cover about 4,700 posts.
TwitterAPI.io is cheaper per post than we are. Its docs don't say how far back its search reaches, so test your oldest date first.
Speed is where X wins:
Are there free historical Twitter datasets?
A few, but they hold post IDs or stay locked, and none reaches today:
- 2006 to 2009: a University of Oviedo dataset lists the IDs of about 1.5 billion posts, free under CC BY 4.0. Its 2020 check found 85.5% still online.
- 2012 to 2022: Wharton's 1% sample stopped in November 2022, after changes to the streaming API. Only Wharton and Annenberg researchers can use it.
- 2006 to 2017: the Library of Congress holds public posts' text from those years, under embargo.
To turn IDs back into posts, look them up 100 at a time with GET /v1/x/posts. Deleted posts land in meta.notFound and cost nothing.
Our guide to Twitter data for academic research covers rebuilding a dataset from IDs.
If it doesn't work
- An ID window misses posts from 2006 to 2010. Early IDs carry no time, so use dates there.
- A
400on page two means the body changed. A cursor only works with the request that made it.
When not to use Weir
- You need X's own terms or a contract. Use its full-archive search.
- You need millions of posts this week. X's 500-post pages move far faster than our 20.
- Price per post is all that matters. TwitterAPI.io lists $0.15 per 1,000 tweets, and it can also post and stream.
Weir reads public data only and can't post. X's Terms of Service bar scraping without X's written permission, so check what applies to you. This isn't legal advice.
FAQ
Is there a Twitter historical data API?
Yes. X's full-archive search, GET /2/tweets/search/all, returns public posts back to March 2006. It's open to pay-per-use and Enterprise accounts at $0.005 per post. Third-party search APIs such as Weir reach the same years for less.
How far back does the full archive search API on Twitter go?
To March 2006, per X's docs. On 21 October 2026, our own search returned post 20, "just setting up my twttr", from 21 March 2006. Deleted posts and protected accounts never show up.
How much does historical Twitter data cost?
On X's API, $0.005 per post as of October 2026, so 10,000 posts cost $50. Weir charges about $2.10 for the same 10,000 on its smallest pack. TwitterAPI.io lists about $1.50.
Is there a Twitter archive API?
X's Help Center describes your personal archive as a download you request in settings, and it can take a few days. For other accounts' public posts, full-archive search is the archive API.
Can I get historical Twitter data for free?
Partly. X's API has no free tier for reading posts. Weir's 5,000 free credits a month cover about 4,700 posts. Datasets of post IDs are free, but turning IDs back into posts costs credits.
Sources
- X API search introduction (checked 21 October 2026): https://docs.x.com/x-api/posts/search/introduction
- X API full-archive search quickstart (checked 21 October 2026): https://docs.x.com/x-api/posts/search/quickstart/full-archive-search
- X API Search Posts All reference (checked 21 October 2026): https://docs.x.com/x-api/posts/full-archive-search
- X API rate limits (checked 21 October 2026): https://docs.x.com/x-api/fundamentals/rate-limits
- X API pay-per-usage pricing (checked 21 October 2026): https://docs.x.com/x-api/getting-started/pricing
- Twitter's Snowflake ID code (checked 21 October 2026): https://github.com/twitter-archive/snowflake/blob/snowflake-2010/src/main/scala/com/twitter/service/snowflake/IdWorker.scala
- X Help Center, download your archive (checked 21 October 2026): https://help.x.com/en/managing-your-account/how-to-download-your-x-archive
- Oviedo tweet ID dataset, 2006 to 2009 (checked 21 October 2026): https://portalinvestigacion.uniovi.es/documentos/668fc44db9e7c03b01bd94cd
- Wharton tweet dataset (checked 21 October 2026): https://research-it.wharton.upenn.edu/data/tweet-database/
- Library of Congress Twitter archive update (26 December 2017): https://blogs.loc.gov/loc/2017/12/update-on-the-twitter-archive-at-the-library-of-congress-2/
- X Terms of Service, effective 9 October 2026 (checked 22 October 2026): https://x.com/en/tos
- TwitterAPI.io pricing (checked 21 October 2026): https://twitterapi.io/pricing
- TwitterAPI.io advanced search reference (checked 21 October 2026): https://docs.twitterapi.io/api-reference/endpoint/tweet_advanced_search
- TwitterAPI.io create tweet reference (checked 21 October 2026): https://docs.twitterapi.io/api-reference/endpoint/create_tweet_v2
- TwitterAPI.io stream filter rules (checked 21 October 2026): https://docs.twitterapi.io/api-reference/endpoint/add_webhook_rule
- Weir billing and rate limits: https://docs.weirapp.io/billing and https://docs.weirapp.io/errors
- Our @MarsCuriosity searches, Weir API, 21 October 2026