Social Fetch
Twitter

Search Twitter posts

Searches public posts on X by keyword and optional engagement/date filters. Pagination uses an opaque `cursor` returned by a previous response.

Operation

GET/v1/twitter/search
Cost: 2 credits

Headers

x-api-keystringrequired(header)

API key (`sfk_...`)

Parameters

querystringrequired(query)

Search query text to run against public posts on X.

min 1 chars · max 512 chars

sectionstring(query)

Optional search section filter. Omit to use the default `top` section.

one of: top, latest, people, photos, videos

minRetweetsinteger(query)

Optional minimum retweet count filter.

≥ 0

minLikesinteger(query)

Optional minimum like count filter.

≥ 0

minRepliesinteger(query)

Optional minimum reply count filter.

≥ 0

limitinteger(query)

Optional page size. Maximum supported value is 20.

≥ 1 · ≤ 20

startDatestring(query)

Optional start date filter in YYYY-MM-DD format.

pattern: ^\d{4}-\d{2}-\d{2}$

endDatestring(query)

Optional end date filter in YYYY-MM-DD format.

pattern: ^\d{4}-\d{2}-\d{2}$

languagestring(query)

Optional language filter.

one of: en, es, fr, de, it, pt, ru, zh, ja, ko, ar, bg, hr, cs, da, nl, et, fi, el, hu, id, ga, lv, lt, no, pl, ro, sk, sl, sv, tr, uk, vi, cy, zu

cursorstring(query)

Opaque pagination cursor returned by a previous response.

min 1 chars

Response fields

data
objectrequired

Endpoint-specific response payload.

datatweets
arrayrequired

Tweets returned for the requested search query.

datatweets[]id
stringrequired

Tweet id.

min 1 chars

datatweets[]url
stringrequirednullable

Canonical public URL for the tweet when available.

datatweets[]text
stringrequired

Full tweet text when available.

datatweets[]createdAt
integerrequired

Creation time as Unix epoch seconds.

≥ 0

datatweets[]createdAtLabel
stringrequirednullable

Human-readable creation timestamp string when available.

datatweets[]language
stringrequirednullable

Language code for the tweet when available.

datatweets[]author
objectrequirednullable

Author metadata for the tweet when available.

datatweets[]authorhandle
stringrequired

Author handle without the leading @.

min 1 chars

datatweets[]authordisplayName
stringrequirednullable

Display name shown for the author.

datatweets[]authoravatarUrl
stringrequirednullable

Profile image URL for the author when available.

datatweets[]authorprofileUrl
stringrequirednullable

Canonical public profile URL for the author when available.

datatweets[]authorverified
booleanrequired

Whether the author has legacy verification on X.

datatweets[]authorblueVerified
booleanrequired

Whether the author has paid blue verification on X.

datatweets[]authorplatformUserId
string

Numeric X user id for the author as a string.

datatweets[]metrics
objectrequired

Engagement metrics for a Twitter search result.

datatweets[]metricslikes
integerrequired

Like count.

≥ 0

datatweets[]metricsretweets
integerrequired

Retweet count.

≥ 0

datatweets[]metricsreplies
integerrequired

Reply count.

≥ 0

datatweets[]metricsquotes
integerrequired

Quote count.

≥ 0

datatweets[]metricsviews
integerrequirednullable

View count when available.

≥ 0

datatweets[]media
arrayrequired

Media attachments returned for the tweet.

datatweets[]media[]url
stringrequired

Direct media URL when available.

min 1 chars

datatweets[]media[]type
stringrequired

Media type when Social Fetch can classify it confidently.

one of: photo

datatweets[]expandedUrl
stringrequirednullable

Expanded URL attached to the tweet when available.

datatweets[]isRetweet
booleanrequired

Whether the tweet is marked as a retweet.

datatweets[]source
stringrequirednullable

Source label such as `Twitter Web App` when available.

datapage
objectrequired

Pagination information for the current response.

datapagenextCursor
stringrequirednullable

Cursor to pass as `cursor` in the next request when another page exists.

datapagehasMore
booleanrequired

Whether another page of search results can be requested.

meta
objectrequired

Metadata describing the request and billing outcome.

metarequestId
stringrequired

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integerrequired

Credits charged for this request.

≥ 0

metaversion
stringrequired

Public API version that served the response.

one of: v1

Code example

Responses

Search results for the requested query.

Error codes

bad_requestinsufficient_creditsinternal_errorlookup_failedtemporarily_unavailableunauthorized

On this page