Skip to main content
Accessing historical data is a cornerstone of Market Research, OSINT, and Competitive Analysis. With Sorsa API, you can retrieve tweets dating back to the very first post on X in 2006. Unlike the standard X search which often limits results to the last 7 days, Sorsa provides access to the Full Archive. If the information is currently public on X, it can be retrieved using our search and timeline tools.

🛠 How It Works

Historical access is primarily handled via the /search-tweets endpoint for keyword-based history or the /user-tweets endpoint for scraping an account’s entire posting history.

What You Can Retrieve:

  • Full Archives: Every public tweet, reply, and quote from an account since its creation.
  • Point-in-Time Content: Tweets about specific events from years ago (e.g., the 2012 Olympics).
  • Historical Media: Links to images and videos attached to old posts.
  • Engagement Stats: Current Retweet and Reply counts for historical posts.

What is Not Accessible (Platform Limits):

  • Deleted Content: If a user deleted a tweet, it is removed from the index and cannot be retrieved.
  • Profile Changes: We provide profile data as it exists now (current bio, current username). We do not track historical profile snapshots.
  • Private Data: Tweets from “Protected” accounts are not available.

📖 Practical Use Cases & Code Examples

1. Time-Range Search (Keyword Based)

Use the since: and until: operators to isolate data from a specific historical window. This is the best way to analyze past news events or product launches. Python
import requests

# Find tweets about "SpaceX" from June 2015
payload = {
    "query": "SpaceX since:2015-06-01 until:2015-06-30",
    "order": "popular" 
}
headers = {"ApiKey": "YOUR_API_KEY", "Content-Type": "application/json"}

response = requests.post("https://api.sorsa.io/v3/search-tweets", json=payload, headers=headers)
data = response.json()

for tweet in data.get('tweets', []):
    print(f"[{tweet['created_at']}] {tweet['full_text']}")

2. Scraping a Full User Timeline

Instead of using search, you can scroll through a user’s profile page programmatically from their most recent tweet down to their very first one. Python
import requests

# Implementation using the /user-tweets endpoint
def fetch_user_timeline(username, user_id=None, cursor=None):
    url = "https://api.sorsa.io/v3/user-tweets"
    payload = {
        "link": f"https://x.com/{username}",
        "user_id": user_id,
        "next_cursor": cursor
    }
    headers = {
        "ApiKey": "YOUR_API_KEY",
        "Content-Type": "application/json"
    }
    
    response = requests.post(url, json=payload, headers=headers)
    return response.json()

# Walk through the timeline using next_cursor until data['next_cursor'] is null

3. Filtering Historical Viral Content

You can filter historical data by engagement to see what resonated with audiences years ago without the “noise” of low-quality posts. Python
# Finding original tweets mentioning "Tesla" in 2019 with at least 1000 retweets
payload = {
    "query": "Tesla since:2019-01-01 until:2019-12-31 min_retweets:1000 -filter:nativeretweets",
    "order": "latest"
}
# ... execute request

💡 Expert Tips for Historical Scraping

  • The Power of -filter:nativeretweets: When scraping history, you often get flooded with retweets. Add this operator to your query to see only original posts from the author.
  • Consistency Check: If you are scraping a full timeline via /user-tweets, ensure you handle the next_cursor correctly. The loop should stop only when the cursor returns null.
  • Language Filters: When researching global events, add lang:en or lang:fr to your historical queries to isolate specific regional discussions.

⏭ Next Steps