### GET /oapi/my/info Source: https://docs.twitterapi.io/api-reference/endpoint/get_my_info Retrieves the authenticated user's account information, including their remaining credits. ```APIDOC ## GET /oapi/my/info ### Description Retrieves the authenticated user's account information, including their remaining credits. ### Method GET ### Endpoint /oapi/my/info ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **recharge_credits** (integer) - Remaining credits #### Response Example ```json { "recharge_credits": 1000 } ``` #### Error Response (400) - **error** (integer) - Error code - **message** (string) - Error message ``` -------------------------------- ### GET /twitter/user/batch_info_by_ids Source: https://docs.twitterapi.io/api-reference/endpoint/batch_get_user_by_userids Batch get user info by user IDs. This endpoint is optimized for cost-efficiency when fetching multiple user profiles. ```APIDOC ## GET /twitter/user/batch_info_by_ids ### Description Batch get user info by user ids. This endpoint offers optimized pricing for bulk requests. - Single user request: 18 credits per user - Bulk request (100+ users): 10 credits per user Note: For cost optimization, we recommend batching requests when fetching multiple user profiles. ### Method GET ### Endpoint https://api.twitterapi.io/twitter/user/batch_info_by_ids ### Parameters #### Query Parameters - **userIds** (string) - Required - The user ids to get. eg. 1234567890,1234567891,1234567892. Use comma to separate multiple user ids ### Request Example ``` GET https://api.twitterapi.io/twitter/user/batch_info_by_ids?userIds=1234567890,1234567891 ``` ### Response #### Success Response (200) - **users** (array) - Array of user infos. Each item contains: - **type** (string) - Enum: "user" - **userName** (string) - The username of the Twitter user - **url** (string) - The x.com URL of the user's profile - **id** (string) - The unique identifier of the user - **name** (string) - The display name of the user - **isBlueVerified** (boolean) - Whether the user has Twitter Blue verification - **verifiedType** (string) - The type of verification. eg. "government", can be empty - **profilePicture** (string) - URL of the user's profile picture - **coverPicture** (string) - URL of the user's cover picture - **description** (string) - The user's profile description - **location** (string) - The user's location. eg. "東京の端っこ". May be empty - **followers** (integer) - Number of followers - **following** (integer) - Number of accounts following - **canDm** (boolean) - Whether the user can receive DMs - **createdAt** (string) - When the account was created. eg. "Thu Dec 13 08:41:26 +0000 2007" - **favouritesCount** (integer) - Number of favorites - **hasCustomTimelines** (boolean) - Whether the user has custom timelines - **isTranslator** (boolean) - Whether the user is a translator - **mediaCount** (integer) - Number of media posts - **statusesCount** (integer) - Number of status updates - **withheldInCountries** (array) - Countries where the account is withheld - **affiliatesHighlightedLabel** (object) - **possiblySensitive** (boolean) - Whether the account may contain sensitive content - **pinnedTweetIds** (array) - IDs of pinned tweets - **isAutomated** (boolean) - Whether the account is automated - **automatedBy** (string) - The account that automated the account - **unavailable** (boolean) - Whether the account is unavailable - **message** (string) - The message of the account. eg. "This account is unavailable" or "This account is suspended" - **status** (string) - Status of the request. Enum: "success", "error" - **msg** (string) - Message of the request. Error message if status is "error" #### Response Example ```json { "users": [ { "type": "user", "userName": "exampleUser", "url": "https://x.com/exampleUser", "id": "1234567890", "name": "Example User", "isBlueVerified": true, "verifiedType": "", "profilePicture": "https://pbs.twimg.com/profile_images/123/abc.jpg", "coverPicture": "https://pbs.twimg.com/profile_banners/123/def.jpg", "description": "This is an example user description.", "location": "Example Location", "followers": 10000, "following": 500, "canDm": true, "createdAt": "Thu Dec 13 08:41:26 +0000 2007", "favouritesCount": 123, "hasCustomTimelines": false, "isTranslator": false, "mediaCount": 45, "statusesCount": 6789, "withheldInCountries": [], "affiliatesHighlightedLabel": {}, "possiblySensitive": false, "pinnedTweetIds": ["9876543210"], "isAutomated": false, "automatedBy": "", "unavailable": false, "message": "" } ], "status": "success", "msg": "" } ``` #### Error Response (400) - **Error Object**: Details of the error. #### Response Example ```json { "error": { "code": 400, "message": "Invalid user ID provided." } } ``` ``` -------------------------------- ### OpenAPI Specification for Get Account Detail V3 Source: https://docs.twitterapi.io/api-reference/endpoint/v3_get_account_detail This OpenAPI 3.0.1 specification defines the GET /twitter/get_my_x_account_detail_v3 endpoint. It outlines the request parameters, including the required 'user_name', and the structure of successful (200) and error (400) responses. Authentication is handled via an API key. ```yaml openapi: 3.0.1 info: title: TwitterAPI.io the most stable/fastest/cheapest twitter api. description: Provide the most stable/fastest/cheapest twitter api. license: name: MIT version: 1.0.0 servers: - url: https://api.twitterapi.io security: - ApiKeyAuth: [] paths: /twitter/get_my_x_account_detail_v3: get: description: >- V3 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 tweets, etc. parameters: - name: user_name in: query description: >- Twitter username. Must be set. The user must have been logged in via user_login_v3. required: true schema: type: string responses: '200': description: Account detail response content: application/json: schema: type: object properties: status: type: string description: Status of the request. msg: type: string description: Message describing the result. data: type: object description: Account detail data. '400': description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' components: schemas: Error: required: - error - message type: object properties: error: type: integer format: int32 message: type: string securitySchemes: ApiKeyAuth: type: apiKey in: header name: X-API-Key ``` -------------------------------- ### Get LLM Navigation Data Source: https://docs.twitterapi.io/api-reference/endpoint/get_tweet_by_ids Fetches navigation and other page data related to LLMs from the specified URL. ```APIDOC ## GET /llms.txt ### Description Fetches navigation and other page data related to LLMs. ### Method GET ### Endpoint https://docs.twitterapi.io/llms.txt ### Parameters None ### Request Example None ### Response #### Success Response (200) - **content** (string) - The content of the llms.txt file, containing navigation and other data. #### Response Example ```json { "navigation": [ { "title": "Home", "url": "/" }, { "title": "API Reference", "url": "/api" } ], "other_data": { "version": "1.0" } } ``` ``` -------------------------------- ### LLM Navigation and Pages Source: https://docs.twitterapi.io/api-reference/endpoint/get_user_about Fetch the llms.txt file to find navigation and other pages within this documentation. ```APIDOC ## GET /llms.txt ### Description Fetches the llms.txt file which contains navigation and other pages in this documentation. ### Method GET ### Endpoint /llms.txt ### Parameters #### Query Parameters None ### Request Example None ### Response #### Success Response (200) - **content** (string) - The content of the llms.txt file. #### Response Example ``` { "content": "Navigation and other pages..." } ``` ``` -------------------------------- ### Get Monitored Users Tweet OpenAPI Specification Source: https://docs.twitterapi.io/api-reference/endpoint/get_user_to_monitor_tweet This OpenAPI specification defines the GET /oapi/x_user_stream/get_user_to_monitor_tweet endpoint. It details the request, responses (including success and error schemas), and security requirements for retrieving a list of users being monitored for tweets. ```yaml openapi: 3.0.1 info: title: TwitterAPI.io the most stable/fastest/cheapest twitter api. description: Provide the most stable/fastest/cheapest twitter api. license: name: MIT version: 1.0.0 servers: - url: https://api.twitterapi.io security: - ApiKeyAuth: [] paths: /oapi/x_user_stream/get_user_to_monitor_tweet: get: description: >- Get the list of users being monitored for real-time tweets. Returns all users that have been added for tweet monitoring. Please ref:https://twitterapi.io/twitter-stream responses: '200': description: List of monitored users content: application/json: schema: type: object properties: status: type: string description: Status of the request.success or error enum: - success - error msg: type: string description: Message of the request data: type: array description: List of monitored users items: type: object properties: id_for_user: type: string description: >- Unique identifier for this monitoring entry. Use this ID to remove the user from monitoring. x_user_id: type: integer description: Twitter user ID x_user_name: type: string description: Twitter display name x_user_screen_name: type: string description: Twitter handle/screen name is_monitor_tweet: type: integer description: Whether tweet monitoring is enabled (1=yes, 0=no) is_monitor_profile: type: integer description: Whether profile monitoring is enabled (1=yes, 0=no) monitor_tweet_config_status: type: integer description: Tweet monitoring configuration status monitor_profile_config_status: type: integer description: Profile monitoring configuration status created_at: type: string description: When the monitoring was created required: - status - msg '400': description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' components: schemas: Error: required: - error - message type: object properties: error: type: integer format: int32 message: type: string securitySchemes: ApiKeyAuth: type: apiKey in: header name: X-API-Key ``` -------------------------------- ### Fetch Navigation and Other Pages Source: https://docs.twitterapi.io/api-reference/endpoint/get_user_by_username Instructions on how to fetch navigation and other pages from the Twitter API. ```APIDOC ## Fetch Navigation and Other Pages ### Description This endpoint allows you to retrieve navigation and other related pages. The data is available at the specified URL. ### Method GET ### Endpoint https://docs.twitterapi.io/llms.txt ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ``` GET https://docs.twitterapi.io/llms.txt Host: docs.twitterapi.io ``` ### Response #### Success Response (200) - **Content** (string) - The content of the requested file, which may include navigation and other page data. #### Response Example ``` [Content of llms.txt] ``` ``` -------------------------------- ### User Info Object Structure Source: https://docs.twitterapi.io/api-reference/endpoint/get_tweet_reply Details the structure of a user information object, including username, profile URL, ID, display name, verification status, profile pictures, description, location, follower/following counts, and account creation date. ```APIDOC ## UserInfo Object ### Description Represents information about a Twitter user. ### Fields - **type** (string) - Enum: `user`. - **userName** (string) - The username of the Twitter user. - **url** (string) - The x.com URL of the user's profile. - **id** (string) - The unique identifier of the user. - **name** (string) - The display name of the user. - **isBlueVerified** (boolean) - Whether the user has Twitter Blue verification. - **verifiedType** (string) - The type of verification (e.g., "government"). Can be empty. - **profilePicture** (string) - URL of the user's profile picture. - **coverPicture** (string) - URL of the user's cover picture. - **description** (string) - The user's profile description. - **location** (string) - The user's location (e.g., "東京の端っこ"). May be empty. - **followers** (integer) - Number of followers. - **following** (integer) - Number of accounts following. - **canDm** (boolean) - Whether the user can receive DMs. - **createdAt** (string) - When the account was created (e.g., "Thu Dec 13 08:41:26 +0000 2007"). - **favouritesCount** (integer) - Number of favorites. - **hasCustomTimelines** (boolean) - Whether the user has custom timelines. - **isTranslator** (boolean) - Whether the user is a translator. - **mediaCount** (integer) - Number of media posts. - **statusesCount** (integer) - Number of status updates. - **withheldInCountries** (array of strings) - Countries where the account is withheld. - **affiliatesHighlightedLabel** (object) - Placeholder for affiliate highlight label information. - **possiblySensitive** (boolean) - Whether the account may contain sensitive content. - **pinnedTweetIds** (array of strings) - IDs of pinned tweets. - **isAutomated** (boolean) - Whether the account is automated. - **automatedBy** (string) - The account that automated the account. - **unavailable** (boolean) - Whether the account is unavailable. - **message** (string) - The message of the account (e.g., "This account is unavailable" or "This account is suspended"). - **unavailableReason** (string) - The reason the account is unavailable (e.g., "suspended"). - **profile_bio** (object) - Contains the user's profile bio description and associated entities. ``` -------------------------------- ### Authentication Source: https://docs.twitterapi.io/api-reference/endpoint/get_article Information on how to authenticate API requests using an API Key. ```APIDOC ## Authentication ### Description API requests must be authenticated. Use the provided API key in the `X-API-Key` header for authentication. ### Method Header Authentication ### Parameters #### Request Headers - **X-API-Key** (string) - Required - Your unique API key. ### Request Example ```bash curl -H "X-API-Key: YOUR_API_KEY" https://api.twitter.com/1.1/users/show.json?screen_name=twitterdev ``` ``` -------------------------------- ### GET /oapi/x_user_stream/get_user_to_monitor_tweet Source: https://docs.twitterapi.io/api-reference/endpoint/get_user_to_monitor_tweet Fetches a list of all users currently being monitored for real-time tweets. This includes their Twitter ID, screen name, and monitoring status. ```APIDOC ## GET /oapi/x_user_stream/get_user_to_monitor_tweet ### Description Get the list of users being monitored for real-time tweets. Returns all users that have been added for tweet monitoring. ### Method GET ### Endpoint /oapi/x_user_stream/get_user_to_monitor_tweet ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **status** (string) - Status of the request. 'success' or 'error'. - **msg** (string) - Message of the request. - **data** (array) - List of monitored users. - **id_for_user** (string) - Unique identifier for this monitoring entry. Use this ID to remove the user from monitoring. - **x_user_id** (integer) - Twitter user ID. - **x_user_name** (string) - Twitter display name. - **x_user_screen_name** (string) - Twitter handle/screen name. - **is_monitor_tweet** (integer) - Whether tweet monitoring is enabled (1=yes, 0=no). - **is_monitor_profile** (integer) - Whether profile monitoring is enabled (1=yes, 0=no). - **monitor_tweet_config_status** (integer) - Tweet monitoring configuration status. - **monitor_profile_config_status** (integer) - Profile monitoring configuration status. - **created_at** (string) - When the monitoring was created. #### Response Example ```json { "status": "success", "msg": "List of monitored users", "data": [ { "id_for_user": "65f1b2c3d4e5f6a7b8c9d0e1", "x_user_id": 123456789, "x_user_name": "Example User", "x_user_screen_name": "exampleuser", "is_monitor_tweet": 1, "is_monitor_profile": 0, "monitor_tweet_config_status": 1, "monitor_profile_config_status": 0, "created_at": "2023-10-27T10:00:00Z" } ] } ``` #### Error Response (400) - **error** (integer) - Error code. - **message** (string) - Error message. #### Error Response Example ```json { "error": 400, "message": "Bad Request" } ``` ``` -------------------------------- ### GET /twitter/get_my_x_account_detail_v3 Source: https://docs.twitterapi.io/api-reference/endpoint/v3_get_account_detail Fetches the details of an X account that was previously logged in using user_login_v3. This endpoint is crucial for verifying account status before performing actions like posting tweets. ```APIDOC ## GET /twitter/get_my_x_account_detail_v3 ### Description Retrieves the details of your X account that was logged in via user_login_v3. Once the account status is 'Active', it can be used for posting tweets and other actions. ### Method GET ### Endpoint https://api.twitterapi.io/twitter/get_my_x_account_detail_v3 ### Parameters #### Query Parameters - **user_name** (string) - Required - Twitter username. Must be set. The user must have been logged in via user_login_v3. ### Request Example ``` GET /twitter/get_my_x_account_detail_v3?user_name=exampleUser ``` ### Response #### Success Response (200) - **status** (string) - Status of the request. - **msg** (string) - Message describing the result. - **data** (object) - Account detail data. #### Response Example ```json { "status": "Active", "msg": "Account details retrieved successfully.", "data": { "id": "123456789", "screen_name": "exampleUser", "name": "Example User" } } ``` #### Error Response (400) - **error** (integer) - Error code. - **message** (string) - Error message. #### Error Response Example ```json { "error": 400, "message": "Invalid user_name provided." } ``` ``` -------------------------------- ### User Info Schema Source: https://docs.twitterapi.io/api-reference/endpoint/get_tweet_thread_context Defines the structure for user information, including profile details, follower counts, and verification status. ```APIDOC ## UserInfo Schema ### Description Defines the structure for user information, including profile details, follower counts, and verification status. ### Properties - **type** (string) - Enum: "user" - The type of the entity, always 'user' for user information. - **userName** (string) - The username of the Twitter user. - **url** (string) - The x.com URL of the user's profile. - **id** (string) - The unique identifier of the user. - **name** (string) - The display name of the user. - **isBlueVerified** (boolean) - Whether the user has Twitter Blue verification. - **verifiedType** (string) - The type of verification. eg. "government", can be empty. - **profilePicture** (string) - URL of the user's profile picture. - **coverPicture** (string) - URL of the user's cover picture. - **description** (string) - The user's profile description. - **location** (string) - The user's location. for example: 東京の端っこ. may be empty. - **followers** (integer) - Number of followers. - **following** (integer) - Number of accounts following. - **canDm** (boolean) - Whether the user can receive DMs. - **createdAt** (string) - When the account was created. for example: Thu Dec 13 08:41:26 +0000 2007 - **favouritesCount** (integer) - Number of favorites. - **hasCustomTimelines** (boolean) - Whether the user has custom timelines. - **isTranslator** (boolean) - Whether the user is a translator. - **mediaCount** (integer) - Number of media posts. - **statusesCount** (integer) - Number of status updates. - **withheldInCountries** (array of strings) - Countries where the account is withheld. - **affiliatesHighlightedLabel** (object) - Details about highlighted affiliate labels. - **possiblySensitive** (boolean) - Whether the account may contain sensitive content. - **pinnedTweetIds** (array of strings) - IDs of pinned tweets. - **isAutomated** (boolean) - Whether the account is automated. - **automatedBy** (string) - The account that automated the account. - **unavailable** (boolean) - Whether the account is unavailable. - **message** (string) - The message of the account. eg. "This account is unavailable" or "This account is suspended". - **unavailableReason** (string) - The reason the account is unavailable. eg. "suspended". - **profile_bio** (object) - Contains the user's profile bio description and entities. - **description** (string) - The text of the user's bio description. - **entities** (object) - Entities within the bio description. - **description** (object) - Entities related to the description field. - **urls** (array of objects) - URLs found in the description. - **display_url** (string) - The shortened URL displayed. - **expanded_url** (string) - The full, expanded URL. ``` -------------------------------- ### GET /twitter/user/last_tweets Endpoint Definition (OpenAPI) Source: https://docs.twitterapi.io/api-reference/endpoint/get_user_last_tweets Defines the GET /twitter/user/last_tweets endpoint for retrieving a user's recent tweets. It supports pagination and filtering by user ID or username. The response includes tweet details, pagination information, and request status. ```yaml openapi: 3.0.1 info: title: TwitterAPI.io the most stable/fastest/cheapest twitter api. description: Provide the most stable/fastest/cheapest twitter api. license: name: MIT version: 1.0.0 servers: - url: https://api.twitterapi.io security: - ApiKeyAuth: [] paths: /twitter/user/last_tweets: get: description: >- Retrieve tweets by user name.Sort by created_at. Results are paginated, with each page returning up to 20 tweets.If you only need to fetch the latest tweets from a single user very frequently, do not use this API—it will cost you a lot. Instead, please refer to https://twitterapi.io/blog/how-to-monitor-twitter-accounts-for-new-tweets-in-real-time. If you have more than 20 Twitter accounts requiring real-time tweet updates, use https://twitterapi.io/twitter-stream which is the most cost-effective solution. parameters: - name: userId in: query description: >- user id of the user.userId is recommended, could be more stable and faster than userName.userId and userName are mutually exclusive. If both are provided, userId will be used. required: false schema: type: string format: string - name: userName in: query description: >- screen name of the user.userId and userName are mutually exclusive. If both are provided, userId will be used. required: false schema: type: string format: string - name: cursor in: query description: The cursor to paginate through the results. First page is "". schema: type: string format: string - name: includeReplies in: query description: Whether to include replies in the results. Default is False. schema: type: boolean default: false responses: '200': description: Tweets response content: application/json: schema: type: object properties: tweets: type: array items: $ref: '#/components/schemas/Tweet' description: Array of tweets has_next_page: type: boolean description: Indicates if there are more results available next_cursor: type: string description: Cursor for fetching the next page of results status: type: string description: Status of the request.success or error enum: - success - error message: type: string description: Message of the request.error message required: - tweets - status - message - has_next_page - next_cursor '400': description: Unexpected error content: application/json: schema: $ref: '#/components/schemas/Error' components: schemas: Tweet: type: object properties: type: type: string enum: - tweet id: type: string description: The ID of the tweet url: type: string description: The URL of the tweet text: type: string description: The text of the tweet source: type: string description: The source of the tweet.eg. "Twitter for iPhone" retweetCount: type: integer description: The number of times the tweet has been retweeted replyCount: type: integer description: The number of times the tweet has been replied to likeCount: type: integer description: The number of times the tweet has been liked quoteCount: type: integer description: The number of times the tweet has been quoted viewCount: type: integer description: The number of times the tweet has been viewed createdAt: type: string description: >- The date and time the tweet was created.eg. Tue Dec 10 07:00:30 +0000 2024 lang: type: string description: The language of the tweet.eg. "en".may be empty bookmarkCount: type: integer description: The number of times the tweet has been bookmarked isReply: type: boolean ``` -------------------------------- ### UserInfo Object Structure Source: https://docs.twitterapi.io/api-reference/endpoint/get_user_last_tweets Defines the structure for user information, including profile details, follower counts, and verification status. ```APIDOC ## UserInfo Object ### Description Represents detailed information about a Twitter user. ### Fields - **type** (string) - Enum: `user`. - **userName** (string) - The username of the Twitter user. - **url** (string) - The x.com URL of the user's profile. - **id** (string) - The unique identifier of the user. - **name** (string) - The display name of the user. - **isBlueVerified** (boolean) - Whether the user has Twitter Blue verification. - **verifiedType** (string) - The type of verification. e.g., "government", can be empty. - **profilePicture** (string) - URL of the user's profile picture. - **coverPicture** (string) - URL of the user's cover picture. - **description** (string) - The user's profile description. - **location** (string) - The user's location. For example: 東京の端っこ. May be empty. - **followers** (integer) - Number of followers. - **following** (integer) - Number of accounts following. - **canDm** (boolean) - Whether the user can receive DMs. - **createdAt** (string) - When the account was created. For example: Thu Dec 13 08:41:26 +0000 2007. - **favouritesCount** (integer) - Number of favorites. - **hasCustomTimelines** (boolean) - Whether the user has custom timelines. - **isTranslator** (boolean) - Whether the user is a translator. - **mediaCount** (integer) - Number of media posts. - **statusesCount** (integer) - Number of status updates. - **withheldInCountries** (array of strings) - Countries where the account is withheld. - **affiliatesHighlightedLabel** (object) - Placeholder for affiliate highlighted label information. - **possiblySensitive** (boolean) - Whether the account may contain sensitive content. - **pinnedTweetIds** (array of strings) - IDs of pinned tweets. - **isAutomated** (boolean) - Whether the account is automated. - **automatedBy** (string) - The account that automated the account. - **unavailable** (boolean) - Whether the account is unavailable. - **message** (string) - The message of the account. e.g., "This account is unavailable" or "This account is suspended". - **unavailableReason** (string) - The reason for the account's unavailability. ``` -------------------------------- ### GET /twitter/user_about Source: https://docs.twitterapi.io/api-reference/endpoint/get_user_about Retrieves the 'about' information for a Twitter user based on their screen name. ```APIDOC ## GET /twitter/user_about ### Description Retrieves the 'about' information for a Twitter user based on their screen name. ### Method GET ### Endpoint /twitter/user_about ### Parameters #### Query Parameters - **userName** (string) - Required - The screen name of the user ### Request Example ```json { "example": "" } ``` ### Response #### Success Response (200) - **data** (object) - User profile about information. See UserAbout schema for details. - **status** (string) - Status of the request. 'success' or 'error'. - **msg** (string) - Message of the request. Will contain an error message if status is 'error'. #### Response Example ```json { "data": { "id": "123456789", "name": "John Doe", "userName": "johndoe", "createdAt": "2006-07-16T22:01:55.000000Z", "isBlueVerified": true, "protected": false, "affiliates_highlighted_label": { "label": { "badge": { "url": "https://abs.twimg.com/images/email/email_verification_badge.png" }, "description": "Verified Organization", "url": { "url": "https://example.com", "urlType": "DeepLink" }, "userLabelDisplayType": "Badge", "userLabelType": "BusinessLabel" } }, "about_profile": { "account_based_in": "United States", "location_accurate": true, "learn_more_url": "https://help.twitter.com/en/rules-and-policies/verified-accounts", "affiliate_username": "ExampleOrg", "source": "Web", "username_changes": { "count": "3" } }, "identity_profile_labels_highlighted_label": { "label": { "description": "OpenAI", "badge": { "url": "https://example.com/badge.png" } } } }, "status": "success", "msg": "" } ``` #### Error Response (400) - **description** (string) - A description of the error. #### Error Response Example ```json { "error": { "message": "User not found" } } ``` ``` -------------------------------- ### GET /1.1/statuses/mentions_timeline.json Source: https://docs.twitterapi.io/api-reference/endpoint/get_user_mention Fetches a collection of the user's mentions. Each page returns exactly 20 mentions. Use the cursor for pagination. Mentions are ordered by mention time in descending order. ```APIDOC ## GET /1.1/statuses/mentions_timeline.json ### Description Retrieves a list of tweets that mention the authenticated user. Results are returned in a paginated format, with each page containing 20 mentions. The mentions are ordered by the time they were created, from most recent to oldest. ### Method GET ### Endpoint /1.1/statuses/mentions_timeline.json ### Parameters #### Query Parameters - **count** (integer) - Optional - Specifies the number of results to retrieve per page. The maximum value is 200. - **cursor** (string) - Optional - Used for pagination. Pass the `next_cursor` value from a previous response to retrieve the next page of results. - **since_id** (integer) - Optional - Returns results with an ID greater than the specified ID. - **max_id** (integer) - Optional - Returns results with an ID less than or equal to the specified ID. ### Request Example ``` GET /1.1/statuses/mentions_timeline.json?count=20&cursor=abc123def ``` ### Response #### Success Response (200) - **statuses** (array) - An array of tweet objects representing the mentions. - **search_metadata** (object) - Metadata about the search, including pagination information. - **next_cursor** (string) - The cursor for the next page of results. - **next_cursor_str** (string) - The cursor for the next page of results as a string. - **prev_cursor** (string) - The cursor for the previous page of results. - **prev_cursor_str** (string) - The cursor for the previous page of results as a string. #### Response Example ```json { "statuses": [ { "created_at": "Mon Sep 30 17:00:00 +0000 2013", "id": 384930000000000000, "id_str": "384930000000000000", "text": "@exampleuser This is a tweet mentioning you!", "user": { "id": 123456789, "screen_name": "mentioninguser" } } ], "search_metadata": { "next_cursor": "next_cursor_value", "next_cursor_str": "next_cursor_value", "prev_cursor": "prev_cursor_value", "prev_cursor_str": "prev_cursor_value" } } ``` ``` -------------------------------- ### Get Tweets by IDs Source: https://docs.twitterapi.io/api-reference/endpoint/get_tweet_by_ids Fetches tweets based on a list of provided tweet IDs. ```APIDOC ## GET /2/tweets ### Description Retrieves one or more Tweets specified by their IDs. ### Method GET ### Endpoint /2/tweets ### Parameters #### Query Parameters - **ids** (string) - Required - A comma-separated list of Tweet IDs. - **tweet.fields** (string) - Optional - Fields to include in the Tweet objects. - **expansions** (string) - Optional - Fields to expand in the Tweet objects. - **media.fields** (string) - Optional - Fields to include in the Media objects. - **poll.fields** (string) - Optional - Fields to include in the Poll objects. - **user.fields** (string) - Optional - Fields to include in the User objects. - **place.fields** (string) - Optional - Fields to include in the Place objects. - **card.fields** (string) - Optional - Fields to include in the Card objects. ### Request Example ``` GET https://api.twitter.com/2/tweets?ids=123456789,987654321 { "ids": "123456789,987654321", "tweet.fields": "created_at,public_metrics" } ``` ### Response #### Success Response (200) - **data** (array) - An array of Tweet objects matching the requested IDs. - **includes** (object) - An object containing expanded data (e.g., users, media). - **errors** (array) - An array of error objects if some IDs could not be found. #### Response Example ```json { "data": [ { "id": "123456789", "text": "This is the first tweet.", "public_metrics": { "retweet_count": 10, "reply_count": 5, "like_count": 20, "quote_count": 2 }, "created_at": "2023-01-01T12:00:00.000Z" }, { "id": "987654321", "text": "This is the second tweet.", "public_metrics": { "retweet_count": 5, "reply_count": 2, "like_count": 10, "quote_count": 1 }, "created_at": "2023-01-01T13:00:00.000Z" } ], "includes": { "users": [ { "id": "123", "name": "User One", "username": "userone" } ] } } ``` ``` -------------------------------- ### Get Community Info By Id Source: https://docs.twitterapi.io/api-reference/endpoint/get_community_by_id Retrieves detailed information for a given community ID. This operation consumes 20 credits per call and is currently undergoing performance optimization. ```APIDOC ## GET /2/community_notes/communities/:id ### Description Retrieves information about a specific community using its unique community ID. This endpoint is priced at 20 credits per call and is currently being optimized for speed. ### Method GET ### Endpoint /2/community_notes/communities/:id ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the community. ### Request Example ```json { "example": "No request body needed for GET request" } ``` ### Response #### Success Response (200) - **data** (object) - Contains the community information. - **id** (string) - The community ID. - **name** (string) - The name of the community. - **description** (string) - A description of the community. - **creator_id** (string) - The ID of the user who created the community. - **created_at** (string) - The timestamp when the community was created. - **member_count** (integer) - The number of members in the community. - **is_private** (boolean) - Indicates if the community is private. #### Response Example ```json { "data": { "id": "1234567890", "name": "Example Community", "description": "This is an example community for testing purposes.", "creator_id": "0987654321", "created_at": "2023-10-27T10:00:00Z", "member_count": 150, "is_private": false } } ``` ``` -------------------------------- ### GET /twitter/community/moderators Source: https://docs.twitterapi.io/api-reference/endpoint/get_community_moderators Retrieves a list of moderators for a given Twitter community. Supports pagination. ```APIDOC ## GET /twitter/community/moderators ### Description Get moderators of a community. Page size is 20. ### Method GET ### Endpoint /twitter/community/moderators ### Parameters #### Query Parameters - **community_id** (string) - Required - id of the community - **cursor** (string) - Optional - cursor of the page ### Request Example ```json { "example": "GET /twitter/community/moderators?community_id=12345&cursor=abcdef12345" } ``` ### Response #### Success Response (200) - **members** (array) - Moderators of the community. Contains UserInfo objects. - **has_next_page** (boolean) - Whether there is a next page. - **next_cursor** (string) - Cursor of the next page. - **status** (string) - 'Status of the request: success or error'. Enum: ["success", "error"] - **msg** (string) - Message of the request, error message if status is error #### Response Example ```json { "members": [ { "type": "user", "userName": "exampleUser", "url": "https://x.com/exampleUser", "id": "123456789", "name": "Example User", "isBlueVerified": true, "verifiedType": "", "profilePicture": "https://pbs.twimg.com/profile_images/123/image.jpg", "coverPicture": "https://pbs.twimg.com/profile_banners/123/image.jpg", "description": "This is a sample user description.", "location": "Example Location", "followers": 1000, "following": 500, "canDm": true, "createdAt": "Thu Dec 13 08:41:26 +0000 2007", "favouritesCount": 150, "hasCustomTimelines": false, "isTranslator": false, "mediaCount": 75, "statusesCount": 2000, "withheldInCountries": [], "affiliatesHighlightedLabel": {}, "possiblySensitive": false, "pinnedTweetIds": [], "isAutomated": false, "automatedBy": "", "unavailable": false, "message": "" } ], "has_next_page": false, "next_cursor": "", "status": "success", "msg": "" } ``` #### Error Response (400) - **Error** (object) - Details about the error. #### Error Response Example ```json { "example": "Error object structure as defined in components/schemas/Error" } ``` ```