Skip to main content

Migrating from the Official X API v2 to Sorsa API v3

This page is a reference for moving an existing integration from the official Twitter/X API v2 to Sorsa API v3. It covers authentication, endpoint mapping, response format changes, pagination, HTTP method differences, search query syntax, error handling, and code examples in curl, Python, and JavaScript. Sorsa API is read-only. If your integration also writes to X (posts tweets, sends DMs, likes, follows), keep the official API key for the write path and migrate only the read path. Every new account includes 100 free requests (no card required), so you can validate the mapped endpoints before switching production traffic over.
Note: For a narrative migration walkthrough with cost comparisons and step-by-step examples, see Migrating from the Twitter/X API: Complete Developer Guide on the blog.

Overview of changes

Authentication

The official API uses OAuth 2.0 Bearer tokens for app-only requests, and OAuth 1.0a User Context for user-scoped requests.
Sorsa API uses a single API key passed in the ApiKey header. Generate keys in the dashboard.
See Authentication for full details.

Endpoint mapping

Users

  • GET /info-batch accepts up to 100 usernames or IDs per request. Repeat the query parameter: ?usernames=a&usernames=b.
  • GET /followers and GET /follows return up to 200 fully-hydrated profiles per page, including bio, follower counts, and verification status.

Tweets

  • tweet_link accepts either a full tweet URL (https://x.com/user/status/123) or just the numeric ID ("123").
  • POST /tweet-info-bulk returns up to 100 tweets per request. Use it instead of looping POST /tweet-info to reduce request count by up to 100x.
  • POST /user-tweets has no 3,200-tweet ceiling. Paginate until next_cursor is absent to retrieve the full timeline back to the account’s first tweet. See Historical data.
  • Sorsa supports the same Twitter Advanced Search operators on /search-tweets. Query strings transfer unchanged. See Search operators.
  • POST /mentions adds filters not available on the official API: min_likes, min_replies, min_retweets, since_date, until_date.

Lists

Communities

The official X API does not expose Community endpoints. Sorsa-only. See Lists and Communities.

Verification

These check membership-style questions in a single call. The official API has no equivalent; replicating them requires fetching full lists and scanning client-side. See Marketing campaign verification.

Analytics (Sorsa-only)

These endpoints index a crypto-focused subset of accounts (influencers, projects, VCs). See Sorsa Score and crypto analytics.

Utility

See ID conversion.

Response format changes

The largest single change in the migration. Official v2 responses are wrapped in data, includes, and meta. Sorsa returns flat objects with author data embedded directly in each tweet.

User profile

Official X API v2 (with field selection):
Sorsa API v3:

Tweet

Official X API v2 (with expansions=author_id):
Sorsa API v3:

Field mapping

User fields

Tweet fields

Pagination

The official API uses pagination_token in query parameters and returns meta.next_token. Sorsa uses a single field, next_cursor, in both directions. For GET endpoints, pass next_cursor as a query parameter:
For POST endpoints, include next_cursor in the JSON body:
The response always returns next_cursor at the top level:
When next_cursor is missing or null, there are no more pages. See Pagination for details.

HTTP method differences

Some endpoints that are GET on the official API are POST on Sorsa. Rule of thumb: tweet-content, search, and community endpoints use POST with a JSON body, and this includes /user-tweets even though it takes a user identifier. User, list, and utility lookups use GET with query or path parameters. The one cross-cutting exception is /check-comment, which is GET despite taking a tweet link. When in doubt, check the endpoint reference.

Code migration examples

Get a user profile

Before (Official API):
After (Sorsa API):

Search tweets

Before:
After:

Paginate through all followers

Before:
After:
Each Sorsa page returns up to 200 fully-hydrated profiles. The official API typically returns IDs and minimal user data, requiring a separate lookup to hydrate profiles.

Search query syntax

Sorsa supports the same Advanced Search operators as the official API. Existing query strings transfer unchanged. Full reference: Search operators. The /mentions endpoint additionally supports server-side filters: min_likes, min_replies, min_retweets, since_date, until_date. See Track mentions.

Error handling

The official API returns errors as a structured errors array:
Sorsa returns a simple shape:
Status codes are consistent across all endpoints: 400, 401, 403, 404, 429, 500. See Error codes. Rate limit handling: on 429, back off and retry. The universal limit is 20 req/s across all endpoints. There are no per-endpoint windows to track. See Rate limits. A retry wrapper that handles both APIs:

Migration checklist

  • Replace Authorization: Bearer ... with ApiKey: ....
  • Remove OAuth 1.0a signature logic (consumer keys, access tokens, signature generation).
  • Update base URL from https://api.x.com/2 to https://api.sorsa.io/v3.
  • Map every endpoint path using the tables above.
  • Switch GET to POST for tweet, search, comment, quote, retweeter endpoints.
  • Remove tweet.fields, user.fields, media.fields, and expansions parameters.
  • Update response parsers: remove data / includes / meta unwrapping.
  • Rename fields (name to display_name, text to full_text, etc.).
  • Flatten metric access (drop the public_metrics wrapper).
  • Replace pagination_token / next_token with next_cursor.
  • Update error handling for the simplified { "message": "..." } format.
  • Adjust rate-limit logic: 20 req/s universal, no per-endpoint windows.
  • Test critical endpoints in the API Playground.
  • Monitor quota via GET /key-usage-info.
  • Retain the official API key for write operations (posting, DMs) if needed.

Features without an official API equivalent