Twitter (X)
Introduction
The Twitter API allows you to access and interact with Twitter data. It provides various endpoints for searching tweets, retrieving user profiles, and accessing trends and analytics.
Base URL:
https://api.webit.live/api/v1/realtime/social/twitter/v1
Billing: Twitter API requests are billed using the VX12 driver.
Key Endpoints
Search: Search for tweets based on keywords, hashtags, or phrases. This endpoint helps in discovering relevant tweets and trending topics.
Profiles: Retrieve detailed information about Twitter user profiles, including their bio, tweets, followers, and following. This is useful for analyzing user activity and influence.
Tweets: Get specific tweets, including their content, engagement metrics, and replies. This endpoint helps in analyzing individual tweets and their impact.
Explore: Access trending topics, hashtags, and other content discovery features. This endpoint is useful for understanding current trends and popular content on Twitter.
FAQ
How do I retrieve a user's profile details using their screen name?
To retrieve a user's profile details using their screen name, you need to use the Profile Details endpoint.
curl -X GET \
"https://api.webit.live/api/v1/realtime/social/twitter/v1/profile/{identifier}/details" \
--header 'Authorization: Basic <credential string>'How do I use pagination with cursors?
X API endpoints that return large result sets use cursor-based pagination. The response includes:
cursor_bottom - Use this to fetch the next page of results
cursor_top - Use this to fetch the previous page of results
To get the next page, include the cursor_bottom value in your next request:
Most use cases only need cursor_bottom to navigate forward through results.
What search operators are available?
Boolean Operators and Grouping
AND logic
Use spaces between terms. Example: snow day #NoSchool matches tweets with all three elements.
OR logic
Use OR between terms. Example: grumpy OR cat OR #meme matches tweets with any of these terms.
NOT logic
Prepend - to negate. Example: cat #meme -grumpy excludes tweets containing "grumpy". Negated operators cannot be used alone.
Grouping
Use parentheses. Example: (grumpy cat) OR (#meme has:images) groups conditions.
General Operators
keyword
Matches keywords or emojis in tweet text or user details
😃 elon musk
"exact phrase"
Matches exact phrases
"rate limits"
#
Matches hashtags
#ycombinator
@
Matches mentions
@elonmusk
from:
Matches tweets from specific user
from:elonmusk
$
Matches cashtags
$FB
to:
Matches replies to specific user
to:elonmusk
url:
Matches tweets with specific URLs
url:"https://techcrunch.com"
Advanced Operators
conversation_id
Tweets in same conversation. Must be used with at least one other rule.
conversation_id:1676361980486250496 filter:replies
quoted_tweet_id
Quote tweets of specific tweet
quoted_tweet_id:1676361980486250496
quoted_user_id
Quote tweets of specific user
quoted_user_id:44196397
near:
Tweets from specific location
near:"new york city"
within:
Radius around location (use with near:)
within:15km near:"new york"
geocode:
Location by coordinates and radius
geocode:52.379245,4.900399,0.1km
since_time:
After timestamp. Must be used with at least one other rule.
since_time:1688813758 Napoleon
until_time:
Before timestamp. Must be used with at least one other rule.
until_time:1688900223 Napoleon
since:
After date. Must be used with at least one other rule.
since:2023-01-01 Napoleon
until:
Before date. Must be used with at least one other rule.
until:2008-12-30 Napoleon
lang:
Specific language
lang:fr
list:
From specific list
list:183873847
min_retweets:
Minimum retweet count
min_retweets:10000
min_faves:
Minimum like count
min_faves:10000
min_replies:
Minimum reply count
min_replies:10000
include:nativeretweets
Include retweets in results
Content Filters
filter:replies
Only tweet replies
filter:quote
Only quote tweets
filter:media
Only tweets with media
filter:images
Only tweets with images
filter:videos
Only tweets with videos
filter:links
Only tweets with links
filter:hashtags
Only tweets with hashtags
What are the API Limitations?
Below is a table summarizing the limits for results per request and total results for each endpoint in the Twitter API:
Please note that these are approximate values and actual limits might vary depending on several factors such as the specific parameters used in requests, and Twitter's ongoing updates to their API policies.
Search Top
~350
<20
Search Latest
No Limit
<20
Search Photos
~400
<20
Search Videos
~400
<20
Search People
~1000
<20
Profile Feed
No Limit
<20
Profile Tweets
~700
<20
Profile Followers
No Limit
50 - 70
Profile Following
No Limit
50 - 70
Profile Likes
~120
20
Profile Media
No Limit
<20
Profile Replies
No Limit
<20
Tweets Likers
No Limit
~90
Tweets Retweets
No Limit
~100
Tweets Quotes
No Limit
<20
Tweets Replies
~200
10
Last updated