X (TWITTER) API

Twitter Search API

Search tweets with the same operators as X advanced search, such as from:, since:, min_faves: and lang:. Sort by latest or top and get each tweet's text, author, media, links and engagement counts.

Endpoint
POST /x/search
Price
1 credit per result
SDK
client.x.search()
MCP tool
x_search
Terminal
curl -X POST "https://api.bridgly.app/x/search" \
-H "Authorization: Bearer $BRIDGLY_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "openai lang:en",
"sortOrder": "Latest",
"count": 10
}'
[ REQUEST AND RESPONSE ]

What does the Twitter Search API return?

Twitter search API: search tweets on X with every advanced-search operator, a language filter and a time window. Results include author, media and engagement. Every response has the same envelope: the result in data, plus timeMs and the creditsCost of the call.

Request body

querystringrequired
Raw search query — supports all X advanced-search operators, e.g. "openai lang:en".
withinHoursnumber
Only return tweets newer than this many hours.
countinteger · 1–20 · default 10
Number of results to return (1–20). Defaults to 10.
cursorstring
The previous response's `nextCursor`, to fetch the next page. Omit it for the first page.
sortOrderenum
Result ordering: "Latest" = chronological newest-first (default), "Top" = X's engagement ranking.
Latest | Top
langstring
BCP-47 language filter e.g. "en", "ja" (maps to `lang:XX`).

Example response

200 OK · application/json
{
"timeMs": 1840,
"creditsCost": 1,
"data": {
"nextCursor": "string",
"tweets": [
{
"id": "string",
"url": "string",
"text": "string",
"createdAt": "2026-01-15T09:30:00.000Z",
"createdAtEpochMs": 0,
"source": "string",
"conversationId": "string",
"replyCount": 0,
"retweetCount": 0,
"likeCount": 0,
"quoteCount": 0,
"bookmarkCount": 0,
"viewCount": 0,
"replyToTweetId": "string",
"replyToUserId": "string",
"replyToUsername": "string",
"replyToTweetUrl": "string",
"isQuote": true,
"quotedTweetId": "string",
"quotedTweetUrl": "string",
"quotedTweetAuthorId": "string",
"quotedTweetAuthorUsername": "string",
"lang": "string",
"isSensitive": true,
"hashtags": [
"string"
],
"mentions": [
{
"userId": "string",
"username": "string",
"displayName": "string",
"profileUrl": "string"
}
],
"urls": [
{
"shortUrl": "string",
"expandedUrl": "string",
"displayUrl": "string"
}
],
"media": [
{
"type": "photo",
"url": "string",
"mediaKey": "string",
"mediaId": "string",
"width": 0,
"height": 0,
"expandedUrl": "string",
"videoUrl": "string",
"durationMs": 0
}
],
"authorId": "string",
"authorHandle": "string",
"authorName": "string",
"authorUrl": "string",
"authorIsVerified": true,
"authorIsBlueVerified": true
}
]
}
}
[ USE CASES ]

What can you build with the Twitter Search API?

Social listening

Track every tweet that mentions your brand, product or competitor.

Catch trends early

Search the last few hours for a keyword and see what is building.

Find leads

Spot tweets asking for tool recommendations in your category.

[ FAQ ]

Twitter Search API questions

How do I search tweets by keyword with an API?

Send your query, for example openai lang:en, and choose Latest or Top. Each tweet comes back with its text, author, media, links and engagement counts, up to 20 per call (10 by default). Send the nextCursor back as cursor to get the next page; it is null once there are no more results.

Which search operators are supported?

The same ones as X advanced search, such as from:, to:, since:, until:, min_faves: and lang:. You can also set withinHours to only get tweets from the last few hours.

How do I monitor X for mentions of my brand?

Search your brand name with sortOrder set to Latest and withinHours set to how often you check, for example 1, and run it on a schedule.

Can I get a specific account’s tweets from a date range?

Yes. Combine from:, since: and until: in the query, for example from:openai since:2025-01-01 until:2025-02-01.

How do I use the Twitter Search API?

Send a POST request to https://api.bridgly.app/x/search with query in the JSON body and your API key in the Authorization header. In the TypeScript SDK, call client.x.search(). AI agents connected to Bridgly over MCP can call the x_search tool.

How much does the Twitter Search API cost?

Costs 1 credit per result returned, with a minimum of 1 credit per request. Credits cost $2.00 per 1,000 on pay-as-you-go and as low as $1.00 per 1,000 at volume. New accounts on a business email start with 100 free credits, and failed requests are never charged.

Try the Twitter Search API

100 free credits on business email, no card. Your first call takes a minute.

APIMCPSDKCLI
free credits

On business email signup. No credit card required.

Start free with 100 credits