Twitter Search API - Search Tweets by Keyword
Documentation menu
FetchLayer FetchLayer API

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

{
  "tweets": [
    {
      "id": "2095595741528125780",
      "text": "This is GPT-6 Astra.\n\nAnything you can do on a computer, Astra can do for you. Fast. https://t.co/gDd0IsewJw",
      "author": {
        "id": "4398626122",
        "name": "OpenAI",
        "handle": "OpenAI",
        "verified": true
      },
      "createdAt": "Thu Sep 03 19:32:13 +0000 2026",
      "counts": {
        "replies": 9031,
        "reposts": 35373,
        "likes": 339881,
        "quotes": 26531,
        "bookmarks": 103012,
        "views": 137161989
      },
      "lang": "en"
    },
    {
      "id": "2095595742975197690",
      "text": "GPT-6 Astra is the most intelligent and aligned model in the world, and sets a new state of the art for computer use, browsing, software engineering, cybersecurity, science, and professional work.",
      "author": {
        "id": "4398626122",
        "name": "OpenAI",
        "handle": "OpenAI",
        "verified": true
      },
      "createdAt": "Thu Sep 03 19:32:14 +0000 2026",
      "counts": {
        "replies": 209,
        "reposts": 631,
        "likes": 10806,
        "quotes": 194,
        "bookmarks": 1323,
        "views": 3400862
      },
      "lang": "en"
    }
  ],
  "nextCursor": "DAABCgABF8zK9v__-V8"
}