Search

GET/tw-v2/search

Description

Search for tweets, users, or other content on the platform. Supports various search operators and filters.

Send query=javascript and type=Latest with your TweetAPI key, as shown in the examples below. Start without cursor. Latest, Photos, and Videos return posts in data; People returns users. Top returns items with type and content fields.

To fetch another page, send the same query and type with the previous response's pagination.nextCursor as cursor. A null nextCursor means no next page was returned. Keep cursor values opaque; do not construct or modify them.

A billable Search request costs 1 API unit. Each page is a separate request and can use another unit; the number of posts returned does not determine the unit cost. The per-minute rate limit counts requests, while your plan's allowance is measured in API units. See Plan Limits for billing and retry rules.

For scheduled checks or managed alerts, see Real-Time Monitoring and Webhook Alerts.

Want to compose the query visually first? Use the free Twitter Advanced Search Query Builder to combine supported operators, validate the 512-character limit, and hand the finished query to this page's authenticated playground.

Parameters

ParameterTypeRequiredDescription
querystringrequiredSearch query string, 1-512 characters. Supports advanced search operators.
typestringrequiredType of search results (Latest, Top, People, Photos, Videos)
cursorstringoptionalPagination cursor for fetching next page of results. Obtained from previous response.

Code Examples

const params = new URLSearchParams({
  query: 'javascript',
  type: 'Latest'
});

const response = await fetch(`https://api.tweetapi.com/tw-v2/search?${params}`, {
  method: 'GET',
  headers: {
    'X-API-Key': 'YOUR_API_KEY'
  }
});

const data = await response.json();
console.log(data);

Search Operators

You can use advanced search operators in the query parameter to filter and refine your results. Combine multiple operators together for precise queries (e.g. from:sample_user_96991 min_faves:1000 filter:images).

Basic Query Syntax

OperatorDescription
keyword1 keyword2Both terms must appear in the tweet (AND logic)
"exact phrase"Matches the exact phrase in the specified order
keyword1 OR keyword2Either term must appear in the tweet
-keywordExcludes tweets containing the specified term. Also works with phrases: -"exact phrase"
#hashtagMatches tweets containing a specific hashtag
$TSLAMatches tweets containing a cashtag (stock ticker symbol)

Users

OperatorDescription
from:usernameReturns tweets sent by a specific user
to:usernameReturns tweets that are replies to a specific user
@usernameReturns tweets mentioning a specific user. Use with -from:username to exclude their own tweets
list:listIdReturns tweets from members of a given public list
filter:verifiedLimits results to legacy verified accounts
filter:blue_verifiedLimits results to users with a paid verification
source:appNameTweets posted from a specific app or client (e.g. source:Twitter_for_iPhone)

Tweet Type

OperatorDescription
filter:nativeretweetsOnly native retweets (via the retweet button)
include:nativeretweetsIncludes native retweets in results (excluded by default)
filter:retweetsIncludes old-style "RT" retweets and quoted tweets
filter:repliesOnly tweets that are replies
filter:self_threadsOnly self-replies (tweets within a user's own thread)
conversation_id:tweetIdAll tweets within a specific conversation thread
filter:quoteOnly tweets that contain a quote tweet
quoted_tweet_id:tweetIdTweets that quote a specific tweet
quoted_user_id:userIdTweets that quote any tweet by a specific user
card_name:animated_gifTweets containing GIFs
card_name:poll2choice_text_onlyTweets with a 2-choice text poll
card_name:poll3choice_text_onlyTweets with a 3-choice text poll
card_name:poll4choice_text_onlyTweets with a 4-choice text poll
card_name:summaryTweets with a small image summary card
card_name:summary_large_imageTweets with a large image summary card
card_name:playerTweets with an embedded player card (audio/video)

Date & Time

Need ID-based bounds for a specific time? Use the free converter to generate Snowflake boundary IDs from a date, then copy the matching TweetAPI time or ID filters.

OperatorDescription
until:YYYY-MM-DDTweets before a given date (not inclusive)
since:YYYY-MM-DDTweets on or after a given date (inclusive)
since_time:timestampTweets on or after a Unix timestamp (seconds)
until_time:timestampTweets before a Unix timestamp (seconds)
since_id:tweetIdTweets after a specific tweet ID (not inclusive)
max_id:tweetIdTweets at or before a specific tweet ID (inclusive)
within_time:durationTweets from the last N days/hours/minutes/seconds (e.g. 2d, 5h, 30m)

Content

OperatorDescription
url:domainTweets containing a link to a specific domain or subdomain
lang:codeTweets in a specific language (ISO code, e.g. en, ja). May not always be accurate

Location

OperatorDescription
near:cityTweets geotagged near a specific location
within:radiusUsed with near: to set a search radius (e.g. 15mi)
geocode:lat,long,radiusTweets within a geographic radius of specific coordinates
place:placeIdTweets tagged with a specific place ID

Engagement

OperatorDescription
filter:has_engagementTweets with at least some engagement (replies, likes, or retweets)
min_retweets:NTweets with at least N retweets
min_faves:NTweets with at least N likes
min_replies:NTweets with at least N replies
-min_retweets:NTweets with fewer than N retweets
-min_faves:NTweets with fewer than N likes
-min_replies:NTweets with fewer than N replies
OperatorDescription
filter:mediaTweets containing any type of media
filter:twimgTweets with native images (pic.twitter.com)
filter:imagesTweets containing any images
filter:videosTweets containing any video (native or external)
filter:native_videoTweets with hosted video only
filter:consumer_videoTweets with standard native video
filter:pro_videoTweets with pro video
filter:periscopeTweets with Periscope streams
filter:vineTweets with Vine videos
filter:spacesTweets linked to Spaces
filter:linksTweets containing any URL (including media links)
filter:mentionsTweets containing any @sample_user_95281
filter:newsTweets containing a link to a news article
filter:safeExcludes NSFW content from results
filter:hashtagsTweets containing at least one hashtag

Response

Success Response (200 OK)

This sanitized Latest example shows the full post shape and the pagination object. Expand it to inspect fields or copy the JSON. Actual values and available fields vary by result.

200