twitter

Search › Tweets

Returns tweets matching a keyword or phrase, each with the full text, like, retweet, reply, bookmark and view counts, media attachments, author info, and creation time.

Use it to track a topic or brand across X. Operators like from:, quoted phrases, filter:images, and since:/until: work inside query; sort picks latest (default) or top, the cursor pages deeper.

Metered: 10–50 credits. We reserve the ceiling when the call starts and charge what it actually used when it finishes.

Paginates by cursor: see Pagination.

get/v1/twitter/search/tweets

Request

  • Base URL: https://api.insightsocial.app
  • URL: https://api.insightsocial.app/v1/twitter/search/tweets
  • Auth: API key in header x-api-key

Query parameters

querystring required
Example:nike running shoes

Keyword or phrase to search tweets for. X operators inside this string narrow the search itself, for example since:YYYY-MM-DD, until:YYYY-MM-DD, from:handle, quoted phrases, min_faves:20, filter:images, and filter:videos. Quote a multi-word phrase when you want relevance rather than engagement ranking from sort=top

sort'latest' | 'top'

Result ranking: latest (default) for the newest matches first, top for the most popular matches. top ranks by engagement, not relevance, so an unquoted multi-term query can return popular posts that match none of your terms. Quote the phrase or add an operator to tighten it

cursorstring

Cursor from the previous response's pagination.next_cursor to fetch the next page

dry_run'1'

Set to 1 to get the price of this call without making it: data.dry_run carries credits_min and credits_max. Nothing is charged.

sincestring

Only rows published on or after this date: YYYY-MM-DD (midnight UTC) or an ISO 8601 timestamp. Rows older than it are left off the page, and the page that reaches one ends the walk: next_cursor is not returned and pagination.stopped_at is since. Sending it sets the newest-first sort shown in this endpoint's sort parameter (any other sort value is a free 400). The page still costs what a page costs, so you pay for the pages you walk and no more. A row with no date is kept.

untilstring

Only rows published on or before this date: YYYY-MM-DD (that whole UTC day is included) or an ISO 8601 timestamp. Newer rows are left off each page and the walk does not stop, so older pages follow. A row with no date is kept.

min_viewsinteger

Keep only rows with at least this many views (post.engagement.views). A row whose view count is unknown is discarded, so every returned row meets the floor.

max_age_daysinteger

Keep only rows published within this many days (post.published_at), 1 to 3650. A row with no date is discarded.

sort_rows'views'

views: return the kept rows ordered by view count, highest first, across every page walked. Rows without a view count go last.

max_pagesinteger

1 to 5 (default 1). Walk up to this many pages in one call and return the rows from all of them (after any filter). Each page walked is billed as one call to this endpoint; the whole walk counts once against your rate limit.

Response

Success.

successtrue required
platformstring required
endpointstring required
schema_version'2' required
unavailablestring[] required
credits_usedinteger required
credits_remaininginteger required
request_idstring required
cachedboolean required
idempotent_replayboolean required
charge_reasonstring required
free_callboolean required

Changes

No recorded changes to this operation across all 1 revision of this API.