Twitter Search API and Pagination: Cursors Explained
Search tweets with sort=latest or top, then page timelines, replies and followers with one cursor. One credit per page, full long posts, with curl and Python.
The Twitter search API at SocialCrawl is GET /v1/twitter/search/tweets. Send a query, pick sort=latest or sort=top, and you get one page of matching tweets with the full text of long posts. To read further, send pagination.next_cursor back as cursor until pagination.has_more is false. Every page costs 1 credit.
The same cursor works on user timelines, replies, retweeters, followers, following and the media tab, so you write one loop and reuse it.
Does the Twitter search API support latest and top results?
Yes. GET /v1/twitter/search/tweets takes a query and a sort of latest (chronological) or top (ranked by engagement). Operators go inside query, for example from:handle, min_faves:20, filter:images or a quoted phrase. A page is roughly 20 tweets.
curl -s -H "x-api-key: $SOCIALCRAWL_API_KEY" \
"https://www.socialcrawl.dev/v1/twitter/search/tweets?query=NASA%20Artemis&sort=latest"The response is an envelope with the rows in data.items and the paging state in pagination, next to data rather than inside it. A trimmed row looks like this:
{
"success": true,
"data": {
"items": [
{
"post": {
"id": "2095617131295486161",
"url": "https://x.com/NASAStennis/status/2095617131295486161",
"published_at": "2026-09-03T20:57:13.000Z",
"author": { "username": "NASAStennis" },
"engagement": { "views": 986, "likes": 35, "comments": 1, "shares": 7 },
"content": { "text": "Artemis II crew brings Moon Joy to NASA Stennis! ..." }
}
}
]
},
"pagination": { "has_more": true, "page_size": 20, "next_cursor": "..." },
"credits_used": 1
}The post body is post.content.text, and long-form posts arrive complete rather than clamped to 280 characters, which suits RAG ingestion and summarising. Prefer since_time: and until_time: (Unix seconds) inside query over since: and until: with a date, because the date form can return posts outside that day. The Twitter docs cover the other operators.
How does Twitter API pagination work with cursors?
Read pagination.next_cursor from the response and pass it back as the cursor query parameter on the next request. Keep going until pagination.has_more is false. Search, replies and an account's timeline keep paging for as long as X has posts to return (how deep a walk reaches). The cursor is an opaque token, so never build or edit one. The first call returns page 1, and the second one below pastes the cursor from it to get page 2. Each page is billed as one call. (Pagination docs)
curl -s -H "x-api-key: $SOCIALCRAWL_API_KEY" \
"https://www.socialcrawl.dev/v1/twitter/user/tweets?handle=nasa"
curl -s -H "x-api-key: $SOCIALCRAWL_API_KEY" \
"https://www.socialcrawl.dev/v1/twitter/user/tweets?handle=nasa&cursor=CURSOR"The same loop in Python:
import os
import requests
url = "https://www.socialcrawl.dev/v1/twitter/user/tweets"
headers = {"x-api-key": os.environ["SOCIALCRAWL_API_KEY"]}
params = {"handle": "nasa"}
rows = []
for _ in range(5): # cap the walk
r = requests.get(url, params=params, headers=headers, timeout=60)
r.raise_for_status()
page = r.json()
rows.extend(page["data"]["items"])
if not page["pagination"]["has_more"]:
break
params["cursor"] = page["pagination"]["next_cursor"]
print(len(rows))A page with no rows and has_more: true is not the end, so call again with the new cursor. And data.total, when present, is for progress bars only, never a stop signal.
If you would rather not write the loop, add max_items or max_credits to the request and the API walks the pages for you in one call. The pagination docs list the parameters.
The official X API uses the same idea under different names (next_token and pagination_token, see X pagination).
Which Twitter endpoints can you page through?
Eight list endpoints are cursor-paged and cost 1 credit per page. Page size is set by the source, so treat the sizes as typical rather than guaranteed. (Twitter docs)
| Endpoint | Returns | Typical page |
|---|---|---|
/v1/twitter/user/tweets | Posts tab, newest first | about 20 |
/v1/twitter/user/media | Tweets with a photo or video | about 15 |
/v1/twitter/search/tweets | Keyword search, latest or top | about 20 |
/v1/twitter/search/users | Accounts matching a name or term | about 20 |
/v1/twitter/tweet/replies | Replies to one tweet URL | varies |
/v1/twitter/tweet/retweeters | Accounts that retweeted | varies |
/v1/twitter/user/followers | Followers of a handle | about 70 |
/v1/twitter/user/following | Accounts a handle follows | about 70 |
Timelines, media and search take a handle or query. Replies and retweeters take the tweet url.
How do you fetch tweet replies and followers?
Replies and retweeters take the tweet URL. Followers and following take a handle. Each is cursor-paged, and an empty page returned by the source costs nothing.
curl -s -H "x-api-key: $SOCIALCRAWL_API_KEY" \
"https://www.socialcrawl.dev/v1/twitter/tweet/replies?url=https://x.com/NASA/status/2094742199736926232"
curl -s -H "x-api-key: $SOCIALCRAWL_API_KEY" \
"https://www.socialcrawl.dev/v1/twitter/user/followers?handle=nasa"Replies come back as comments, so the text is comment.text, not post.content.text. Each reply row carries the commenter's counts and language on comment.ext, and by default the rows are labelled for sentiment, questions, purchase intent and complaints at no extra credit.
Follower and following rows are accounts under author, with follower, following and post counts, bio, avatar and join date. Verification is not on this surface and comes back null, which means unknown rather than false. Call /v1/twitter/profile for an account when you need it.
What the Twitter endpoints do not do
community/tweetsreturns one fixed window of recent posts and does not accept a cursor.profile/fullreads a single page of about 20 tweets, soposts=100still returns about 20. Send itsposts_cursorback ascursorfor the next page at 5 credits a call, or useuser/tweetsat 1 credit a page.- Follower and following lists do not include verification status.
How do you start calling these endpoints?
- Create an API key at socialcrawl.dev. New accounts get free credits to try it.
- Export the key and run the search call above.
- Paste an X URL into the Visual Explorer to see a response shape before writing a loop.
- Read the Twitter platform reference and the quickstart for the full endpoint list.
For official X API access and its limits, see the X (Twitter) API 2026 field guide. For a profile-to-tweets scraping walkthrough, see How to Scrape Twitter (X) in 2026.
Frequently asked questions
How does Twitter API pagination work?
List endpoints return pagination.has_more and pagination.next_cursor. Pass the cursor back as the cursor query parameter on the next request and stop when has_more is false. Never build the cursor yourself.
How do I get more than one page of a user's tweets?
Call GET /v1/twitter/user/tweets?handle=..., read pagination.next_cursor, then call again with &cursor=.... Each page costs 1 credit. To skip the loop, send max_items and the API walks the pages for you.
Does the Twitter search API support latest and top results?
Yes. Pass sort=latest for chronological results or sort=top for engagement ranking on GET /v1/twitter/search/tweets. Operators such as from:, min_faves: and quoted phrases go inside query.
How do I fetch Twitter replies with an API?
Call GET /v1/twitter/tweet/replies?url=... with the tweet URL. Replies come back as comments with the text on comment.text, and the endpoint is cursor-paged at 1 credit per page.
How do I get Twitter followers and following programmatically?
Call GET /v1/twitter/user/followers?handle=... or /v1/twitter/user/following. Both are cursor-paged at 1 credit per page, with about 70 accounts per page. Verification comes back null on these lists.
Can an API return full-length tweets over 280 characters?
Yes. Long-form posts come back whole on post.content.text instead of a 280-character preview, and t.co links in the text are resolved to their destinations.
Run this request yourself
GET /v1/twitter/search/tweets?query=NASA Artemis&sort=latestIt opens with the request filled in, and nothing runs or costs credits until you press Run. Without an account you sign up first, then land on the same request.
Related posts
Everything We Shipped in November 2026: 311 Upgrades
SocialCrawl November 2026: 26 new platforms, 142 more endpoints, and 311 upgrades to calls you already make, with more data per row and faster answers.
Everything We Shipped in October 2026: 55 API Upgrades
SocialCrawl October 2026: the Discover engine, date windows on 150 lists, 1,000 Reddit posts a call, cheaper TikTok search, and 48 more API endpoints.
Download Facebook Comments: Every Reply in One Call
One call now downloads Facebook comments with every reply at every depth, up to 5,000 rows at 1 credit per 4 rows. Reply lists and reel comments work again.
