Twitter Search API - Search Tweets by Keyword
FetchLayer fetchlayer.dev Sign in

Search X/Twitter by keyword

Run a Twitter search using the selected product view such as Top, Latest, People, Media, or Lists. Results include tweet text, author info, engagement counts, and media metadata.

POST /search Search
https://api.fetchlayer.dev/twitter/search
OpenAPI JSON

Headers

Authorization string required

Bearer token — your FetchLayer API key.

Parameters

query string required

Search query.

product string optional

Twitter product tab. (default: Top)

count number optional

Number of results (max 100). (default: 25)

cursor string optional

Pagination cursor for next page.

Response Fields

search

Search X/Twitter by keyword

results[].id string

Unique tweet identifier.

results[].text string

Full tweet text with URLs t.co-unwrapped.

results[].author.handle string

Author handle without @.

results[].author.displayName string

Author display name.

results[].author.isVerified boolean

Whether the author is verified.

results[].createdAt string

ISO 8601 timestamp.

results[].likeCount number

Number of likes.

results[].replyCount number

Number of replies.

results[].retweetCount number

Number of retweets/reposts.

results[].viewCount number

Impression count (when available).

results[].url string

Canonical tweet URL.

cursor string

Pagination cursor for the next page.

Request

curl -X POST "https://api.fetchlayer.dev/twitter/search" \
  -H "Authorization: Bearer ss-your-key" \
  -H "Content-Type: application/json" \
  -d '{"query":"openai","product":"Latest","count":5}'

Response

{
  "results": [
    {
      "id": "1942939879222220800",
      "text": "Just tried the new GPT-4o vision features on the OpenAI playground — it correctly described a screenshot of our dashboard in one prompt. Incredible.",
      "author": {
        "handle": "devuser",
        "displayName": "Dev User",
        "isVerified": false
      },
      "createdAt": "2026-07-01T18:42:00.000Z",
      "likeCount": 142,
      "replyCount": 23,
      "retweetCount": 31,
      "viewCount": 8200,
      "url": "https://x.com/devuser/status/1942939879222220800"
    },
    {
      "id": "1942939879222220801",
      "text": "OpenAI just dropped a new fine-tuning API endpoint. Docs are live at platform.openai.com",
      "author": {
        "handle": "aibuilder",
        "displayName": "AI Builder",
        "isVerified": true
      },
      "createdAt": "2026-07-01T18:30:00.000Z",
      "likeCount": 891,
      "replyCount": 156,
      "retweetCount": 210,
      "viewCount": 51000,
      "url": "https://x.com/aibuilder/status/1942939879222220801"
    }
  ],
  "cursor": "DAABCgABF8zK9v__-V8"
}