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 incurl, 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.ApiKey header. Generate keys in the dashboard.
Endpoint mapping
Users
GET /info-batchaccepts up to 100 usernames or IDs per request. Repeat the query parameter:?usernames=a&usernames=b.GET /followersandGET /followsreturn up to 200 fully-hydrated profiles per page, including bio, follower counts, and verification status.
Tweets
tweet_linkaccepts either a full tweet URL (https://x.com/user/status/123) or just the numeric ID ("123").POST /tweet-info-bulkreturns up to 100 tweets per request. Use it instead of loopingPOST /tweet-infoto reduce request count by up to 100x.POST /user-tweetshas no 3,200-tweet ceiling. Paginate untilnext_cursoris absent to retrieve the full timeline back to the account’s first tweet. See Historical data.
Search
- Sorsa supports the same Twitter Advanced Search operators on
/search-tweets. Query strings transfer unchanged. See Search operators. POST /mentionsadds 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 indata, includes, and meta. Sorsa returns flat objects with author data embedded directly in each tweet.
User profile
Official X API v2 (with field selection):Tweet
Official X API v2 (withexpansions=author_id):
Field mapping
User fields
Tweet fields
Pagination
The official API usespagination_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:
next_cursor in the JSON body:
next_cursor at the top level:
next_cursor is missing or null, there are no more pages. See Pagination for details.
HTTP method differences
Some endpoints that areGET 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):Search tweets
Before:Paginate through all followers
Before: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 structurederrors array:
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 ...withApiKey: .... - Remove OAuth 1.0a signature logic (consumer keys, access tokens, signature generation).
- Update base URL from
https://api.x.com/2tohttps://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, andexpansionsparameters. - Update response parsers: remove
data/includes/metaunwrapping. - Rename fields (
nametodisplay_name,texttofull_text, etc.). - Flatten metric access (drop the
public_metricswrapper). - Replace
pagination_token/next_tokenwithnext_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.