Search public X posts with one focused expression, choose latest or top ordering, and receive matching content, authors, engagement, media, entities, and source-query context.

Twitter Search API

Query discovery
Latest or Top
Source-query trace
0.7 credits / result
Ready
Ready

Enter parameters and send a request. The task status and normalized results will appear here.

README

Twitter Search

X search results are public posts selected for a query, carrying the language, author, media, entities, conversation context, and visible engagement of each match. Keeping the query beside every record makes recurring topic scans, launch listening, and result-set comparisons easier to audit.

Features

  • Discovery from one expressionSubmit a non-empty keyword or search expression and turn its matching public X posts into structured records.
  • Ordering for two research modesUse latest to follow recent matches or top to review prominent matches, with latest selected by default.
  • A practical search-result capRequest 20 to 2,000 results in increments of 20 to set the maximum depth of the search collection.
  • Matches that retain their queryCombine text, author, engagement, media, entities, timestamps, and relationship fields with extra.search_query and collected_at.

Parameters

ParametersRequiredDescription
queryRequiredRequired non-empty keyword or X post search expression used to discover matching public posts.
results_limitOptionalOptional requested result cap. Defaults to 20 and accepts multiples of 20 from 20 to 2,000.
sort_byOptionalOptional ordering with latest for recent matches or top for prominent matches. Defaults to latest.

How to Use

Frame a precise research question as a search expression, select the ordering that fits it, and preserve the query with the resulting posts.

  1. Write one focused, non-empty expression for the X posts you want to find.
  2. Select latest or top and choose a results_limit from 20 to 2,000 in increments of 20.
  3. POST the request to /v1/x/search, then poll /v1/tasks/{task_id} until completion.
  4. Store data.results.items, then follow next_cursor until has_more becomes false.
curl -X POST "https://api.socq.ai/v1/x/search" \
  -H "Authorization: Bearer $SOCQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"artificial intelligence","results_limit":40,"sort_by":"latest"}'

# Poll GET /v1/tasks/{task_id}
# Read data.results.items and follow next_cursor while has_more is true

Best Use Cases

  • Listen around a named launch: Search a product, release, conference, or campaign phrase and organize matching posts by publication and collection time.
  • Track brand and product mentions: Bring authors, text, visible engagement, hashtags, mentions, and media together for a focused name or phrase.
  • Map a developing topic: Use latest results to follow new posts and top results to inspect prominent content within the same research expression.
  • Maintain a recurring query dataset: Store extra.search_query with every match, rerun a versioned expression, and append only previously unseen post IDs.

Pro Tips

  • Begin with a focused expression, inspect the matches, and broaden the wording only when coverage is too narrow.
  • Choose latest for time-sensitive listening and top when prominent matches matter more than chronology.
  • Set results_limit as a multiple of 20 and interpret it as a cap, not a guaranteed result count.
  • Version the query whenever its terms change so recurring result sets remain comparable.
  • Deduplicate by post id while retaining extra.search_query and collected_at for discovery context.

Use these APIs when you need a different type of public X data.

  • Twitter Tweet Scraper APIRetrieve public post text, authors, engagement, media, hashtags, mentions, and conversation relationships from x.com or twitter.com status URLs.
  • Twitter Profile Scraper APIRetrieve public account identity, biographies, avatars, cover images, account status, and visible audience statistics by username.
  • Twitter User Tweets Scraper APICollect recent public posts, authors, media, hashtags, mentions, and engagement by username with replies excluded.

Twitter Search APIFAQ