TwitterAPI.io

TwitterAPI.io: Twitter (X) data API

REST API for X (Twitter) data: tweets, search, users, followers, replies, quotes, lists, communities and trends, plus webhook and WebSocket delivery.…

Social#social

Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.

Overview

REST API for X (Twitter) data: tweets, search, users, followers, replies, quotes, lists, communities and trends, plus webhook and WebSocket delivery. Authenticate with an X-API-Key header. Get a key at https://twitterapi.io. Full docs at https://docs.twitterapi.io.

Endpoints 75

Tweets

  • GETGET /twitter/user/last_tweets/twitter/user/last_tweetsGet a user's tweets, newest first. Each page returns up to 20 tweets; use cursor for pagination. Identify the account with either userName (screen name) or…
  • GETGET /twitter/user/tweet_timeline/twitter/user/tweet_timelineRetrieve tweets by user id.Sort by created_at. Results are paginated, with each page returning up to 20 tweets.The content you see is in the same order as the…
  • GETGET /twitter/tweets/twitter/tweets?tweet_ids=stringget tweet by tweet ids
  • GETGET /twitter/article/twitter/article?tweet_id=stringget article by tweet id. cost 100 credit per article
  • GETGET /twitter/tweet/replies/twitter/tweet/replies?tweetId=stringget tweet replies by tweet id.Each page returns up to 20 replies(Sometimes less than 20,because we will filter out ads or other not tweets). Use cursor for…
  • GETGET /twitter/tweet/replies/v2/twitter/tweet/replies/v2?tweetId=stringGet tweet replies by tweet id (V2). Each page returns up to 20 replies. Use cursor for pagination. Supports sorting by Relevance, Latest, or Likes.
  • GETGET /twitter/tweet/thread_context/twitter/tweet/thread_context?tweetId=stringGet the thread context of a tweet.Suppose a tweet thread consists of t1, t2 (replying to t1), t3 (replying to t2), and t4, t5, t6 (all replying to t3). If we…
  • GETGET /twitter/tweet/quotes/twitter/tweet/quotes?tweetId=stringget tweet quotes by tweet id.Each page returns up to 20 quotes. Use cursor for pagination. Order by quote time desc
  • GETGET /twitter/user/mentions/twitter/user/mentions?userName=stringget tweet mentions by user screen name.Each page returns up to 20 mentions. Use cursor for pagination. Order by mention time desc
  • GETGET /twitter/tweet/advanced_search/twitter/tweet/advanced_search?query=string&queryType=LatestAdvanced search for tweets.Each page returns up to 20 replies(Sometimes less than 20,because we will filter out ads or other not tweets).

Users

  • GETGET /twitter/user/info/twitter/user/infoGet user info by screen name Always HTTP 200. A handle that does not exist returns status: "error" with msg: "user not found". A suspended or otherwise…
  • GETGET /twitter/user_about/twitter/user_aboutGet user profile about by screen name
  • GETGET /twitter/user/search/twitter/user/searchSearch user by keyword
  • GETGET /twitter/user/batch_info_by_ids/twitter/user/batch_info_by_ids?userIds=stringBatch get user info by user ids. Pricing (per request, based on the number of users returned): 1-99 users: 18 credits per user 100 or more users: 1 credit per…
  • GETGET /twitter/tweet/retweeters/twitter/tweet/retweeters?tweetId=stringget tweet retweeters by tweet id.Each page returns about 100 retweeters. Use cursor for pagination. Order by retweet time desc
  • GETGET /twitter/user/followers/twitter/user/followers?userName=stringGet user followers (with full profile metadata) in reverse chronological order (newest first). Sorted by follow date — most recent followers appear on the…
  • GETGET /twitter/user/followers_ids/twitter/user/followers_idsGet a user's follower IDs in bulk — lightweight, IDs only, no profile metadata. Designed for large-scale follower-graph collection where you join IDs against…
  • GETGET /twitter/user/verifiedFollowers/twitter/user/verifiedFollowers?user_id=stringGet user verified followers in reverse chronological order (newest first). Returns up to 20 verified followers per page, sorted by follow date. Most recent…
  • GETGET /twitter/user/followings/twitter/user/followings?userName=stringGet user followings (with full profile metadata). Sorted by follow date — most recent followings appear on the first page. Use cursor for pagination. Tiered…
  • GETGET /twitter/user/check_follow_relationship/twitter/user/check_follow_relationship?source_user_name=stringCheck if the user is following/followed by the target user. Price: 100 credits ($0.001 per call).

Lists

  • GETGET /twitter/list/tweets/twitter/list/tweets?listId=stringget tweets by list id.Each page returns up to 20 tweets. Use cursor for pagination. Order by tweet time desc
  • GETGET /twitter/list/tweets_timeline/twitter/list/tweets_timeline?listId=stringGet timeline tweets from list. Use cursor for pagination.
  • GETGET /twitter/list/members/twitter/list/members?list_id=stringGet members of a list. Page size is 20.
  • GETGET /twitter/list/followers/twitter/list/followers?list_id=stringGet followers of a list. Page size is 20.

Communities

  • GETGET /twitter/community/get_tweets_from_all_community/twitter/community/get_tweets_from_all_community?query=string&queryType=Latestget tweets from all communities,each page returns up to 20 tweets. Use cursor for pagination.
  • POSTPOST /twitter/create_community_v2/twitter/create_community_v2Create a community.You must set the login_cookies.You can get the login_cookies from /twitter/user_login_v2.Price: 200 credits ($0.002 per call).
  • POSTPOST /twitter/delete_community_v2/twitter/delete_community_v2Delete a community.You must set the login_cookie.You can get the login_cookie from /twitter/user_login_v2.Price: 200 credits ($0.002 per call).
  • POSTPOST /twitter/join_community_v2/twitter/join_community_v2Join a community.You must set the login_cookie.You can get the login_cookie from /twitter/user_login_v2.Price: 200 credits ($0.002 per call).
  • POSTPOST /twitter/leave_community_v2/twitter/leave_community_v2Leave a community.You must set the login_cookie.You can get the login_cookie from /twitter/user_login_v2.Price: 200 credits ($0.002 per call).
  • GETGET /twitter/community/info/twitter/community/info?community_id=stringGet community info by community id. Price: 20 credits per call. Note: This API is a bit slow, we are still optimizing it.
  • GETGET /twitter/community/members/twitter/community/members?community_id=stringGet members of a community. Page size is 20.
  • GETGET /twitter/community/moderators/twitter/community/moderators?community_id=stringGet moderators of a community. Page size is 20.
  • GETGET /twitter/community/tweets/twitter/community/tweets?community_id=stringGet tweets of a community. Page size is 20. Order by creation time desc.

Trends

  • GETGET /twitter/trends/twitter/trends?woeid=0Get trends by woeid

Spaces

  • GETGET /twitter/spaces/detail/twitter/spaces/detailGet spaces detail by space id

Write actions

  • POSTPOST /twitter/create_tweet/twitter/create_tweetCreate a tweet.Need to login first.Price: 100 credits ($0.001 per call).
  • POSTPOST /twitter/like_tweet/twitter/like_tweetLike a tweet.Need to login first. Price: 100 credits ($0.001 per call).
  • POSTPOST /twitter/retweet_tweet/twitter/retweet_tweetRetweet a tweet.Need to login first. Price: 100 credits ($0.001 per call).
  • POSTPOST /twitter/list/add_member/twitter/list/add_memberadd member to a list.Need to login first. Price: 100 credits ($0.001 per call).
  • POSTPOST /twitter/list/remove_member/twitter/list/remove_memberremove member from a list.Need to login first. Price: 100 credits ($0.001 per call).
  • POSTPOST /twitter/retweet_v3/twitter/retweet_v3V3 Retweet API - Retweet a tweet using your username. You must have logged in via user_login_v3 first. Price: 200 credits ($0.002 per call).
  • POSTPOST /twitter/like_tweet_v3/twitter/like_tweet_v3V3 Like Tweet API - Like a tweet using your username. You must have logged in via user_login_v3 first. Price: 200 credits ($0.002 per call).
  • POSTPOST /twitter/send_tweet_v3/twitter/send_tweet_v3V3 Send Tweet API - Send a tweet using your username. This is an asynchronous method that queues your tweet for posting. You must have logged in via…
  • POSTPOST /twitter/create_tweet_v2/twitter/create_tweet_v2Create a tweet.You must set the login_cookies.You can get the login_cookies from /twitter/user_login_v2.Price: 200 credits ($0.002 per call).
  • POSTPOST /twitter/like_tweet_v2/twitter/like_tweet_v2Like a tweet.You must set the login_cookies.You can get the login_cookies from /twitter/user_login_v2.Price: 200 credits ($0.002 per call).
  • POSTPOST /twitter/unlike_tweet_v2/twitter/unlike_tweet_v2Unlike a tweet.You must set the login_cookies.You can get the login_cookies from /twitter/user_login_v2.Price: 200 credits ($0.002 per call).
  • POSTPOST /twitter/delete_tweet_v2/twitter/delete_tweet_v2Delete a tweet.You must set the login_cookies.You can get the login_cookies from /twitter/user_login_v2.Price: 200 credits ($0.002 per call).
  • POSTPOST /twitter/retweet_tweet_v2/twitter/retweet_tweet_v2Retweet a tweet.You must set the login_cookies.You can get the login_cookies from /twitter/user_login_v2.Price: 200 credits ($0.002 per call).
  • POSTPOST /twitter/follow_user_v2/twitter/follow_user_v2Follow a user.You must set the login_cookies.You can get the login_cookies from /twitter/user_login_v2.Price: 200 credits ($0.002 per call).
  • POSTPOST /twitter/unfollow_user_v2/twitter/unfollow_user_v2Unfollow a user.You must set the login_cookies.You can get the login_cookies from /twitter/user_login_v2.Price: 200 credits ($0.002 per call).
  • POSTPOST /twitter/bookmark_tweet_v2/twitter/bookmark_tweet_v2Bookmark a tweet. You must set the login_cookie. You can get the login_cookie from /twitter/user_login_v2. Price: 200 credits ($0.002 per call).
  • POSTPOST /twitter/unbookmark_tweet_v2/twitter/unbookmark_tweet_v2Remove a tweet from bookmarks. You must set the login_cookie. You can get the login_cookie from /twitter/user_login_v2. Price: 200 credits ($0.002 per call).
  • POSTPOST /twitter/bookmarks_v2/twitter/bookmarks_v2Get the bookmarks list of the logged-in user. You must set the login_cookie. You can get the login_cookie from /twitter/user_login_v2. Returns tweets in the…

X account login and profile

  • POSTPOST /twitter/login_by_email_or_username/twitter/login_by_email_or_usernameLogin Step 1: by email or username.Recommend to use email.Price: 300 credits ($0.003 per call). Please read the guide:…
  • POSTPOST /twitter/login_by_2fa/twitter/login_by_2faDeprecated soon. Please use login V2 instead, as it is more stable.Login Step 2: by 2fa code.Price: 300 credits ($0.003 per call).
  • POSTPOST /twitter/upload_image/twitter/upload_imageupload image to twitter.Need to login first. Price: 100 credits ($0.001 per call).
  • POSTPOST /twitter/user_login_v2/twitter/user_login_v2Log in directly using your email, username, password, and 2FA secret key. And obtain the login_cookies, to post tweets, etc. Please note that the…
  • POSTPOST /twitter/user_login_v3/twitter/user_login_v3V3 Login API - Log in using your email, username, password, and 2FA code. This is an asynchronous login method. After calling this API, the system will…
  • GETGET /twitter/get_my_x_account_detail_v3/twitter/get_my_x_account_detail_v3?user_name=stringV3 Get Account Detail API - Get the details of your X account that was logged in via user_login_v3.Once status is Active,then you can use the account to post…
  • DELETEDELETE /twitter/delete_my_x_account_v3/twitter/delete_my_x_account_v3Remove your X account cookie from the system. This will delete the account data that was logged in via user_login_v3.
  • PUTPUT /twitter/update_profile_v3/twitter/update_profile_v3V3 Update Profile API - Update your X profile information. Only non-empty fields will be updated. You must have logged in via user_login_v3 first.
  • POSTPOST /twitter/upload_media_v2/twitter/upload_media_v2Upload media to twitter.You must set the login_cookies.You can get the login_cookies from /twitter/user_login_v2.Price: 300 credits ($0.003 per call).
  • PATCHPATCH /twitter/update_avatar_v2/twitter/update_avatar_v2Update your Twitter avatar/profile picture. You must set the login_cookie. You can get the login_cookie from /twitter/user_login_v2. Price: 200 credits…
  • PATCHPATCH /twitter/update_banner_v2/twitter/update_banner_v2Update your Twitter banner/header image. You must set the login_cookie. You can get the login_cookie from /twitter/user_login_v2. Price: 200 credits ($0.002…
  • PATCHPATCH /twitter/update_profile_v2/twitter/update_profile_v2Update your Twitter profile information. You must set the login_cookie. You can get the login_cookie from /twitter/user_login_v2. Price: 200 credits ($0.002…

Direct messages

  • GETGET /twitter/get_dm_history_by_user_id/twitter/get_dm_history_by_user_id?login_cookies=string&user_id=stringGet the direct message history with a user.
  • POSTPOST /twitter/send_dm_to_user/twitter/send_dm_to_userSend a direct message to a user.You must set the login_cookies.You can get the login_cookies from /twitter/user_login_v2.You can only send DMs to those who…

Webhook filter rules

  • GETGET /oapi/tweet_filter/get_rules/oapi/tweet_filter/get_rulesGet all tweet filter rules.Rule can be used in webhook and websocket.You can also modify the rule in our web page.
  • POSTPOST /oapi/tweet_filter/add_rule/oapi/tweet_filter/add_ruleAdd a tweet filter rule. Default rule is not activated.You must call update_rule to activate the rule.
  • POSTPOST /oapi/tweet_filter/update_rule/oapi/tweet_filter/update_ruleUpdate a tweet filter rule. You must set all parameters.
  • DELETEDELETE /oapi/tweet_filter/delete_rule/oapi/tweet_filter/delete_ruleDelete a tweet filter rule. You must set all parameters.

Account monitoring stream

  • POSTPOST /oapi/x_user_stream/add_user_to_monitor_tweet/oapi/x_user_stream/add_user_to_monitor_tweetAdd a user to monitor real-time tweets.Monitor tweets from specified accounts, including directly sent tweets, quoted tweets, reply tweets, and retweeted…
  • POSTPOST /oapi/x_user_stream/remove_user_to_monitor_tweet/oapi/x_user_stream/remove_user_to_monitor_tweetRemove a user from monitor real-time tweets.Please ref:https://twitterapi.io/twitter-stream
  • GETGET /oapi/x_user_stream/get_user_to_monitor_tweet/oapi/x_user_stream/get_user_to_monitor_tweetGet the list of users being monitored for real-time tweets. Returns all users that have been added for tweet monitoring. Please…

Your TwitterAPI.io account

  • GETGET /oapi/my/info/oapi/my/infoGet my info

API details

Base URL
https://api.twitterapi.io
Authentication
An API key in the X-API-Key header
Operations
75 operations on 75 pathsGET 36POST 33PATCH 3DELETE 2PUT 1
Main resources
Write actions 18X account login and profile 12Tweets 10Users 10Communities 9Lists 4Webhook filter rules 4Account monitoring stream 3Direct messages 2Spaces 1
Response formats
application/json
Description format
OpenAPI 3.0.1, API version 1.0.0

How to test the TwitterAPI.io: Twitter (X) data API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the TwitterAPI.io: Twitter (X) data API collection, without the publisher's secrets.
  3. Add your credentialsThis API uses an API key in the X-API-Key header. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “GET /twitter/user/last_tweets” (GET /twitter/user/last_tweets), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the TwitterAPI.io: Twitter (X) data API?

REST API for X (Twitter) data: tweets, search, users, followers, replies, quotes, lists, communities and trends, plus webhook and WebSocket delivery.… It is listed under Social and has 75 endpoints.

Who publishes the TwitterAPI.io: Twitter (X) data API?

It is listed from TwitterAPI.io's public API description (an OpenAPI document), not published by TwitterAPI.io on Swastik Codes. Anyone who controls twitterapi.io can claim the profile by adding a DNS TXT record.

What is the base URL of the TwitterAPI.io: Twitter (X) data API?

Requests go to https://api.twitterapi.io. Endpoint paths are added to this base URL.

How do I authenticate with the TwitterAPI.io: Twitter (X) data API?

With an API key in the X-API-Key header.

How many endpoints does the TwitterAPI.io: Twitter (X) data API have?

75 operations on 75 paths (36 GET, 33 POST, 3 PATCH, 2 DELETE, 1 PUT). The largest groups are Write actions, X account login and profile, Tweets, Users.

Is forking the TwitterAPI.io: Twitter (X) data API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.