### Get User Profile Example Source: https://docs.getxapi.com/docs Examples for fetching a user's profile information. Requires authentication. The JavaScript example uses the Fetch API, and the Python example uses the requests library. ```curl curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.getxapi.com/twitter/user/info?userName=elonmusk" ``` ```javascript const response = await fetch( "https://api.getxapi.com/twitter/user/info?userName=elonmusk", { headers: { Authorization: "Bearer YOUR_API_KEY" }, } ); const data = await response.json(); console.log(data); ``` ```python import requests response = requests.get( "https://api.getxapi.com/twitter/user/info", params={"userName": "elonmusk"}, headers={"Authorization": "Bearer YOUR_API_KEY"}, ) print(response.json()) ``` -------------------------------- ### Example cURL Requests for List Members Source: https://docs.getxapi.com/docs/lists/list-members Examples demonstrate how to call the list members endpoint using cURL, including basic usage and pagination. ```bash curl -H "Authorization: Bearer API_KEY" "https://api.getxapi.com/twitter/list/members?listId=1826032140213172224" ``` ```bash # With pagination curl -H "Authorization: Bearer API_KEY" "https://api.getxapi.com/twitter/list/members?listId=1826032140213172224&cursor=DAABCgABG..." ``` -------------------------------- ### Bookmark Search Request Body Example Source: https://docs.getxapi.com/docs/users/bookmark-search This is an example of a successful response from the bookmark search endpoint, showing user details, query, and a list of bookmarked items. ```json { "userId": "1858475867762270208", "query": "claude", "tweet_count": 20, "has_more": true, "next_cursor": "DAAHCgABHAY...", "bookmarks": [ { "type": "tweet", "id": "2010705621524292007", "text": "Hello from GetXAPI.", "author": { "userName": "example_user" } } ] } ``` -------------------------------- ### User About Response Example Source: https://docs.getxapi.com/docs/users/user-about This is a sample JSON response for the User About endpoint, illustrating the structure and fields returned. ```json { "status": "success", "msg": "success", "data": { "id": "1234567890123456789", "userName": "example_user", "name": "Example User", "profilePicture": "https://pbs.twimg.com/profile_images/.../example_400x400.jpg", "createdAt": "2024-01-01T00:00:00.000000Z", "isVerified": false, "isBlueVerified": true, "isIdentityVerified": false, "verifiedSince": "2026-01-01T00:00:00.000Z", "accountBasedIn": "United States", "createdVia": "Web", "usernameChanges": { "count": 1, "lastChangedAt": "2025-01-01T00:00:00.000Z" } } } ``` -------------------------------- ### Example cURL Request Source: https://docs.getxapi.com/docs/users/user-info-by-id Example of how to call the user info by ID endpoint using cURL, including the necessary Authorization header and userId query parameter. ```bash curl -H "Authorization: Bearer API_KEY" "https://api.getxapi.com/twitter/user/info_by_id?userId=44196397" ``` -------------------------------- ### Publish Article Request Body Example Source: https://docs.getxapi.com/docs/articles/publish-article This is an example of the JSON request body for publishing an article. Ensure the auth_token belongs to a Premium account. ```json { "auth_token": "your_auth_token", "article_id": "2055606612363202560" } ``` -------------------------------- ### cURL Request to Get Followers You Know Source: https://docs.getxapi.com/docs/users/followers-you-know Example cURL command to make a POST request to the followers_you_know endpoint. Ensure to replace API_KEY and your_auth_token with actual values. ```bash curl -X POST "https://api.getxapi.com/twitter/user/followers_you_know" \ -H "Authorization: Bearer API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auth_token": "your_auth_token", "user_name": "elonmusk" }' ``` -------------------------------- ### DM List Request Example Source: https://docs.getxapi.com/docs/dm/dm-list Example cURL request to fetch direct messages. Includes basic authentication and content type headers. ```curl curl -X POST "https://api.getxapi.com/twitter/dm/list" \ -H "Authorization: Bearer API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auth_token": "your_auth_token" }' ``` ```curl # With pagination curl -X POST "https://api.getxapi.com/twitter/dm/list" \ -H "Authorization: Bearer API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auth_token": "your_auth_token", "cursor": "DAABCgABG...", "count": 50 }' ``` -------------------------------- ### Search Tweets Example Source: https://docs.getxapi.com/docs Examples for performing an advanced search for tweets. Requires authentication. The JavaScript example uses the Fetch API, and the Python example uses the requests library. ```curl curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.getxapi.com/twitter/tweet/advanced_search?q=from:elonmusk&product=Latest" ``` ```javascript const response = await fetch( "https://api.getxapi.com/twitter/tweet/advanced_search?q=from:elonmusk&product=Latest", { headers: { Authorization: "Bearer YOUR_API_KEY" }, } ); const data = await response.json(); console.log(data.tweets); ``` ```python import requests response = requests.get( "https://api.getxapi.com/twitter/tweet/advanced_search", params={"q": "from:elonmusk", "product": "Latest"}, headers={"Authorization": "Bearer YOUR_API_KEY"}, ) print(response.json()["tweets"]) ``` -------------------------------- ### Fetch User Mentions with cURL Source: https://docs.getxapi.com/docs/users/user-mentions Examples of how to fetch user mentions using cURL, demonstrating both a fresh request and a request with pagination. ```shell # Fresh curl -H "Authorization: Bearer API_KEY" \ "https://api.getxapi.com/twitter/user/mentions?userName=elonmusk" # With pagination curl -H "Authorization: Bearer API_KEY" \ "https://api.getxapi.com/twitter/user/mentions?userName=elonmusk&cursor=DAADDAABCgABH..." ``` -------------------------------- ### cURL Request with Pagination Source: https://docs.getxapi.com/docs/users/followers-you-know Example cURL command demonstrating how to use the cursor parameter for paginating through results from the followers_you_know endpoint. ```bash curl -X POST "https://api.getxapi.com/twitter/user/followers_you_know" \ -H "Authorization: Bearer API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auth_token": "your_auth_token", "user_name": "elonmusk", "cursor": "DAABCgABG..." }' ``` -------------------------------- ### Payment History Response (200 OK) Source: https://docs.getxapi.com/docs/account/payment-history Example of a successful response (200 OK) containing payment history. ```json { "payments": [ { "amount": 10, "credits_added": 10, "status": "completed", "created_at": "2026-03-18T00:17:02.346Z" } ] } ``` -------------------------------- ### Publish Article cURL Example Source: https://docs.getxapi.com/docs/articles/publish-article This cURL command demonstrates how to publish an existing draft article. Replace API_KEY and your_auth_token with your actual credentials. ```curl curl -X POST "https://api.getxapi.com/twitter/article/publish" \ -H "Authorization: Bearer API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auth_token": "your_auth_token", "article_id": "2055606612363202560" }' ``` -------------------------------- ### Update Banner API Request Example (cURL) Source: https://docs.getxapi.com/docs/users/update-banner Example of how to call the update banner API using cURL, providing an image URL. ```curl curl --request POST \ --header "Authorization: Bearer API_KEY" \ --header "Content-Type: application/json" \ --url "https://api.getxapi.com/twitter/user/update_banner" \ --data '{ "auth_token": "", "image_url": "https://example.com/banner.png" }' ``` -------------------------------- ### Bookmark Search Error Response - Missing Fields Source: https://docs.getxapi.com/docs/users/bookmark-search This is an example of an error response when a required field, such as 'q', is missing from the request. ```json { "error": "Missing required field: q" } ``` -------------------------------- ### User Media API Error Response (400) Source: https://docs.getxapi.com/docs/users/user-media Example of an error response when the required 'userName' query parameter is missing. ```json { "error": "Missing required query param: userName" } ``` -------------------------------- ### Create Tweet with Custom Proxy API Source: https://docs.getxapi.com/docs/tweets/create-tweet This example demonstrates how to send a tweet using your own proxy server. Provide the proxy URL in the `proxy` field. ```bash curl -X POST "https://api.getxapi.com/twitter/tweet/create" \ -H "Authorization: Bearer API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auth_token": "your_auth_token", "proxy": "http://user:pass@host:port", "text": "Posted via my own proxy!" }' ``` -------------------------------- ### Fetch User Likes (With Pagination) Source: https://docs.getxapi.com/docs/users/user-likes Example using curl to make a POST request to the user likes endpoint, including a cursor for paginating through results. ```curl curl -X POST "https://api.getxapi.com/twitter/user/likes" \ -H "Authorization: Bearer API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auth_token": "your_auth_token", "cursor": "DAAHCgABHAY..." }' ``` -------------------------------- ### Fetch User Likes (Basic Request) Source: https://docs.getxapi.com/docs/users/user-likes Example using curl to make a POST request to the user likes endpoint with a basic authentication token. ```curl curl -X POST "https://api.getxapi.com/twitter/user/likes" \ -H "Authorization: Bearer API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auth_token": "your_auth_token" }' ``` -------------------------------- ### cURL Request to List Bookmarks Source: https://docs.getxapi.com/docs/users/bookmarks Example cURL commands for interacting with the Twitter bookmarks API. Includes a basic request and a request with pagination. ```bash curl -X POST "https://api.getxapi.com/twitter/user/bookmarks" \ -H "Authorization: Bearer API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auth_token": "your_auth_token" }' ``` ```bash # With pagination curl -X POST "https://api.getxapi.com/twitter/user/bookmarks" \ -H "Authorization: Bearer API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auth_token": "your_auth_token", "cursor": "HBbysNrihaHT4jMAAA==" }' ``` -------------------------------- ### Get Account Info (Python) Source: https://docs.getxapi.com/docs/account/account-info Retrieve your account details using the Python requests library. The JSON response is printed to the console. ```python import requests response = requests.get( "https://api.getxapi.com/account/me", headers={"Authorization": "Bearer API_KEY"}, ) print(response.json()) ``` -------------------------------- ### Get Account Info (JavaScript) Source: https://docs.getxapi.com/docs/account/account-info Fetch your account information using JavaScript's fetch API. The response is logged to the console. ```javascript const response = await fetch("https://api.getxapi.com/account/me", { headers: { Authorization: "Bearer API_KEY" }, }); const data = await response.json(); console.log(data); ``` -------------------------------- ### Fetch Tweet Replies using cURL Source: https://docs.getxapi.com/docs/tweets/tweet-replies Examples of how to fetch tweet replies using cURL, including a basic request and a request with pagination. ```bash curl -H "Authorization: Bearer API_KEY" "https://api.getxapi.com/twitter/tweet/replies?id=2019199325365227607" # With pagination curl -H "Authorization: Bearer API_KEY" "https://api.getxapi.com/twitter/tweet/replies?id=2019199325365227607&cursor=DAABCgABG..." ``` -------------------------------- ### User Mentions API Response (200) Source: https://docs.getxapi.com/docs/users/user-mentions Example of a successful response from the user mentions endpoint, including tweet details and pagination information. ```json { "userName": "elonmusk", "tweet_count": 20, "has_more": true, "next_cursor": "DAADDAABCgABH...", "tweets": [ { "type": "tweet", "id": "2047800000000000000", "url": "https://x.com/someuser/status/2047800000000000000", "twitterUrl": "https://twitter.com/someuser/status/2047800000000000000", "text": "@elonmusk thanks for the update", "source": "Twitter Web App", "retweetCount": 0, "replyCount": 1, "likeCount": 4, "quoteCount": 0, "viewCount": 120, "createdAt": "Fri Apr 25 12:34:56 +0000 2026", "lang": "en", "bookmarkCount": 0, "isReply": false, "inReplyToId": null, "conversationId": "2047800000000000000", "media": [], "entities": { "hashtags": [], "symbols": [], "timestamps": [], "urls": [], "user_mentions": [ { "id_str": "44196397", "indices": [0, 9], "name": "Elon Musk", "screen_name": "elonmusk" } ] }, "author": { "type": "user", "userName": "someuser", "url": "https://x.com/someuser", "id": "1234567890", "name": "Some User", "isVerified": false, "isBlueVerified": false, "profilePicture": "https://pbs.twimg.com/profile_images/.../abc_normal.jpg", "followers": 412, "following": 188, "createdAt": "Tue Jan 04 11:12:13 +0000 2022" }, "quoted_tweet": null } ] } ``` -------------------------------- ### Get User Affiliates (JavaScript) Source: https://docs.getxapi.com/docs/users/user-affiliates Fetch affiliated accounts using JavaScript's fetch API. Ensure the Authorization header is correctly set. ```javascript const response = await fetch( "https://api.getxapi.com/twitter/user/affiliates?userName=eigencloud", { headers: { Authorization: "Bearer API_KEY", }, } ); const data = await response.json(); console.log(data.affiliates); ``` -------------------------------- ### Get Account Info Source: https://docs.getxapi.com/docs/account/account-info Fetches the current user's account details. This endpoint is free to use and is rate-limited to 30 requests per minute. ```APIDOC ## GET /account/me ### Description Retrieves your GetXAPI account details, credit balance, and usage summary. ### Method GET ### Endpoint /account/me ### Headers - **Authorization** (string) - Required - Bearer token (API_KEY) ### Response #### Success Response (200) - **email** (string) - Account email - **name** (string) - Account name - **credits_remaining** (number) - Current credit balance ($) - **credits_used** (number) - Total credits spent ($) - **total_requests** (number) - Total API calls made - **created_at** (string) - Account registration date (ISO 8601) #### Response Example ```json { "email": "user@example.com", "name": "John Doe", "credits_remaining": 8.96, "credits_used": 13.832, "total_requests": 12251, "created_at": "2026-02-06T10:46:59.399986+00:00" } ``` ### Error Responses #### 429 - Rate limited ```json { "error": "Too many requests. Limit: 30 per minute." } ``` ### Examples #### cURL ```bash curl -X GET "https://api.getxapi.com/account/me" \ -H "Authorization: Bearer API_KEY" ``` #### JavaScript ```javascript const response = await fetch("https://api.getxapi.com/account/me", { headers: { Authorization: "Bearer API_KEY" }, }); const data = await response.json(); console.log(data); ``` #### Python ```python import requests response = requests.get( "https://api.getxapi.com/account/me", headers={"Authorization": "Bearer API_KEY"}, ) print(response.json()) ``` ``` -------------------------------- ### Fetch User Media API Call Source: https://docs.getxapi.com/docs/users/user-media Example cURL commands to fetch user media. The first shows a basic request, and the second demonstrates how to use the 'cursor' parameter for pagination. ```bash curl -H "Authorization: Bearer API_KEY" "https://api.getxapi.com/twitter/user/media?userName=example_user" # With pagination curl -H "Authorization: Bearer API_KEY" "https://api.getxapi.com/twitter/user/media?userName=example_user&cursor=DAABCgABHAYpKoW___0..." ``` -------------------------------- ### Get Article by Tweet ID (JavaScript) Source: https://docs.getxapi.com/docs/articles/get-article Fetch article content using JavaScript's fetch API. This example demonstrates how to make the request and access the article data from the JSON response. Replace 'API_KEY' with your actual API key. ```javascript const response = await fetch( "https://api.getxapi.com/twitter/article/get?id=1905545699552375179", { headers: { Authorization: "Bearer API_KEY", }, } ); const data = await response.json(); console.log(data.article); ``` -------------------------------- ### Fetch Home Timeline (cURL) Source: https://docs.getxapi.com/docs/users/home-timeline Example using cURL to make a POST request to the home timeline endpoint. Ensure to replace `API_KEY` and `your_auth_token` with actual credentials. ```curl curl -X POST "https://api.getxapi.com/twitter/user/home_timeline" \ -H "Authorization: Bearer API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auth_token": "your_auth_token" }' ``` -------------------------------- ### GetXAPI Authentication Example (cURL) Source: https://docs.getxapi.com/docs Demonstrates how to authenticate requests using an API key passed as a Bearer token in the Authorization header. Replace YOUR_API_KEY with your actual key. ```curl curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.getxapi.com/twitter/user/info?userName=elonmusk" ``` -------------------------------- ### Get Account Info (cURL) Source: https://docs.getxapi.com/docs/account/account-info Use this command to fetch your account details via cURL. Ensure you replace API_KEY with your actual API key. ```bash curl -X GET "https://api.getxapi.com/account/me" \ -H "Authorization: Bearer API_KEY" ``` -------------------------------- ### Unbookmark Tweet API Request Example (cURL) Source: https://docs.getxapi.com/docs/tweets/unbookmark-tweet Example of how to call the unbookmark tweet endpoint using cURL. Ensure to replace 'API_KEY' and 'your_auth_token' with actual credentials. ```curl curl -X POST "https://api.getxapi.com/twitter/tweet/unbookmark" \ -H "Authorization: Bearer API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auth_token": "your_auth_token", "tweet_id": "2019264360682778716" }' ``` -------------------------------- ### Create and Publish Article (Python) Source: https://docs.getxapi.com/docs/articles/create-article Use this Python script with the `requests` library to create and publish a Twitter/X article. The `auth_token` must be valid, and an X Premium subscription is necessary if `publish` is set to `True`. Consider using a `proxy` for stability. ```python import requests response = requests.post( "https://api.getxapi.com/twitter/article/create", headers={"Authorization": "Bearer API_KEY"}, json={ "auth_token": "your_auth_token", "title": "Three Books Worth Re-reading This Year", "content": "Some books reveal more on the second pass...", "cover_image_url": "https://picsum.photos/1200/675", "publish": True, }, ) print(response.json()) ``` -------------------------------- ### Get Twitter User Followers List Source: https://docs.getxapi.com/docs/users/followers Use this endpoint to retrieve a list of a Twitter user's followers. Specify the userName to get the initial page of results. Returns up to 200 followers per page. ```curl curl -H "Authorization: Bearer API_KEY" "https://api.getxapi.com/twitter/user/followers?userName=elonmusk" ``` ```curl curl -H "Authorization: Bearer API_KEY" "https://api.getxapi.com/twitter/user/followers?userName=elonmusk&cursor=DAABCgABG..." ``` -------------------------------- ### Get Article Source: https://docs.getxapi.com/docs Retrieves an article associated with a tweet. ```APIDOC ## GET /twitter/tweet/article ### Description Retrieves an article associated with a tweet. ### Method GET ### Endpoint /twitter/tweet/article ### Parameters #### Query Parameters - **id** (string) - Required - The ID of the tweet associated with the article. ### Response #### Success Response (200) - **data** (object) - Information about the article. - **meta** (object) - Metadata about the response. ``` -------------------------------- ### Get Article by Tweet ID (Python) Source: https://docs.getxapi.com/docs/articles/get-article Retrieve article content using the Python requests library. This snippet shows how to send a GET request with authentication headers and query parameters, then parse the JSON response. Replace 'API_KEY' with your actual API key. ```python import requests response = requests.get( "https://api.getxapi.com/twitter/article/get", headers={"Authorization": "Bearer API_KEY"}, params={"id": "1905545699552375179"}, ) print(response.json()["article"]) ``` -------------------------------- ### Fetch Home Timeline with Pagination (cURL) Source: https://docs.getxapi.com/docs/users/home-timeline This cURL example demonstrates how to fetch the next page of the home timeline feed by including the `cursor` parameter in the request body. Use the `next_cursor` from a previous response. ```curl curl -X POST "https://api.getxapi.com/twitter/user/home_timeline" \ -H "Authorization: Bearer API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auth_token": "your_auth_token", "cursor": "DAABCgABHAY..." }' ``` -------------------------------- ### Account Info Response (200 OK) Source: https://docs.getxapi.com/docs/account/account-info Successful response containing your account details, credit balance, and usage summary. ```json { "email": "user@example.com", "name": "John Doe", "credits_remaining": 8.96, "credits_used": 13.832, "total_requests": 12251, "created_at": "2026-02-06T10:46:59.399986+00:00" } ``` -------------------------------- ### Get User Profile Source: https://docs.getxapi.com/docs Retrieves information about a specific Twitter/X user based on their username. ```APIDOC ## GET /twitter/user/info ### Description Retrieves information about a specific Twitter/X user. ### Method GET ### Endpoint /twitter/user/info ### Parameters #### Query Parameters - **userName** (string) - Required - The username of the user to retrieve information for. ### Request Example ``` curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.getxapi.com/twitter/user/info?userName=elonmusk" ``` ### Response #### Success Response (200) - **data** (object) - User profile information. - **meta** (object) - Metadata about the response. ``` -------------------------------- ### Rate Limited Response (429) Source: https://docs.getxapi.com/docs/account/payment-history Example of a rate limited response (429 Too Many Requests). ```json { "error": "Too many requests. Limit: 30 per minute." } ``` -------------------------------- ### Successful Avatar Update Response Source: https://docs.getxapi.com/docs/users/update-avatar This is an example of a successful response (200) after updating a user's avatar. ```json { "status": "success", "msg": "Avatar updated successfully", "data": { "id": "1740174562631856128", "screen_name": "example_user", "profile_image_url": "https://pbs.twimg.com/profile_images/.../abc_normal.jpg" } } ``` -------------------------------- ### Get Verified Followers Source: https://docs.getxapi.com/docs/users/verified-followers Fetches a list of verified followers for a specified Twitter user. Supports pagination. ```APIDOC ## GET /twitter/user/verified_followers ### Description This endpoint retrieves a user's verified (blue check) followers. Each API call costs $0.001 and returns approximately 20 users per page. ### Method GET ### Endpoint `/twitter/user/verified_followers` ### Parameters #### Query Parameters - **userName** (string) - Required - Screen name of the user (without @). - **cursor** (string) - Optional - Pagination cursor to retrieve the next page of results. ### Response #### Success Response (200) - **userName** (string) - The screen name of the user whose followers are being fetched. - **user_count** (integer) - The number of verified followers returned in this call. - **has_more** (boolean) - Indicates if there are more verified followers available. - **next_cursor** (string) - The cursor to use for fetching the next page of results, if `has_more` is true. - **verified_followers** (array) - A list of verified follower objects. - **type** (string) - Type of the profile (e.g., "user"). - **id** (string) - Unique identifier for the user. - **userName** (string) - Screen name of the follower. - **name** (string) - Display name of the follower. - **url** (string) - URL to the follower's profile. - **isVerified** (boolean) - Indicates if the follower is verified. - **isBlueVerified** (boolean) - Indicates if the follower has a blue checkmark. - **profilePicture** (string) - URL to the follower's profile picture. - **coverPicture** (string) - URL to the follower's cover picture. - **description** (string) - The follower's profile description. - **location** (string) - The follower's location. - **followers** (integer) - The number of followers the follower has. - **following** (integer) - The number of accounts the follower is following. - **tweets** (integer) - The number of tweets the follower has made. - **listed** (integer) - The number of lists the follower is on. - **createdAt** (string) - The date and time the follower's account was created. - **canDm** (boolean) - Indicates if direct messages can be sent to the follower. ### Request Example ```json { "example": "curl -H \"Authorization: Bearer API_KEY\" \"https://api.getxapi.com/twitter/user/verified_followers?userName=elonmusk\"" } ``` ### Response Example ```json { "example": "{\n \"userName\": \"elonmusk\",\n \"user_count\": 20,\n \"has_more\": true,\n \"next_cursor\": \"DAABCgABG...\",\n \"verified_followers\": [\n {\n \"type\": \"user\",\n \"id\": \"44073696\",\n \"userName\": \"roydanroy\",\n \"name\": \"Dan Roy\",\n \"url\": \"https://x.com/roydanroy\",\n \"isVerified\": false,\n \"isBlueVerified\": true,\n \"profilePicture\": \"https://pbs.twimg.com/profile_images/...\",\n \"coverPicture\": \"https://pbs.twimg.com/profile_banners/...\",\n \"description\": \"@Google DeepMind. On leave, Canada CIFAR AI Chair...\",\n \"location\": \"London\",\n \"followers\": 61518,\n \"following\": 1858,\n \"tweets\": 5200,\n \"listed\": 300,\n \"createdAt\": \"Tue Jun 02 06:32:26 +0000 2009\",\n \"canDm\": true\n }\n ]\n}" } ``` ``` -------------------------------- ### Advanced Search Python Example Source: https://docs.getxapi.com/docs/tweets/advanced-search Make a request to the advanced search endpoint using Python's requests library. Pass query parameters and the Authorization header. ```python import requests response = requests.get( "https://api.getxapi.com/twitter/tweet/advanced_search", params={"q": "from:0xsweep", "product": "Latest"}, headers={"Authorization": "Bearer API_KEY"}, ) print(response.json()["tweets"]) ``` -------------------------------- ### Search Twitter/X Users (Python) Source: https://docs.getxapi.com/docs/users/user-search This Python example uses the requests library to search for Twitter/X users. The search query is passed in the 'params' argument, and the API key is included in the headers. ```python import requests response = requests.get( "https://api.getxapi.com/twitter/user/search", headers={"Authorization": "Bearer API_KEY"}, params={"q": "crypto"}, ) print(response.json()) ``` -------------------------------- ### Update Article - Basic Example Source: https://docs.getxapi.com/docs/articles/update-article Use this snippet to update the title of an existing article. Ensure you provide a valid auth_token and article_id. ```curl curl -X POST "https://api.getxapi.com/twitter/article/update" \ -H "Authorization: Bearer API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auth_token": "your_auth_token", "article_id": "2055606612363202560", "title": "Renamed Article Title" }' ``` -------------------------------- ### User Media API Response (200) Source: https://docs.getxapi.com/docs/users/user-media Example of a successful response from the user media endpoint, including tweet details and media URLs. Note the 'has_more' and 'next_cursor' fields for pagination. ```json { "userName": "example_user", "userId": "1234567890123456789", "tweet_count": 13, "has_more": true, "next_cursor": "DAABCgABHAYpKoW___0...", "media": [ { "type": "tweet", "id": "2010705621524292007", "text": "Hello from GetXAPI.", "media": [ { "type": "photo", "url": "https://pbs.twimg.com/media/example.jpg" } ], "author": { "userName": "example_user" } } ] } ``` -------------------------------- ### Get User Affiliates Source: https://docs.getxapi.com/docs/users/user-affiliates Retrieves a list of affiliated accounts for a specified verified Twitter/X organization. Supports pagination using a cursor. ```APIDOC ## GET /twitter/user/affiliates ### Description Get affiliated accounts of a verified Twitter/X organization via API. This endpoint costs $0.001 per API call and returns approximately 20 users per page. ### Method GET ### Endpoint `/twitter/user/affiliates` ### Query Parameters - **userName** (string) - Required - Username of the organization - **cursor** (string) - Optional - Pagination cursor from previous response ### Notes - Returns affiliated accounts of a **verified organization** (companies, brands, nonprofits). - Only organizations with the "Affiliates" tab on their profile have affiliates. Regular user accounts return 0 results. - Supports cursor pagination (~20 users per page). ### Response (200) - **userName** (string) - The username of the organization. - **user_count** (integer) - The number of users returned in this call. - **has_more** (boolean) - Indicates if there are more results available. - **next_cursor** (string) - The cursor for the next page of results. - **affiliates** (array) - A list of affiliated user objects. - **type** (string) - Type of the affiliate (e.g., "user"). - **id** (string) - Unique identifier of the affiliate. - **userName** (string) - Username of the affiliate. - **name** (string) - Display name of the affiliate. - **url** (string) - URL to the affiliate's profile. - **isVerified** (boolean) - Whether the affiliate is verified. - **isBlueVerified** (boolean) - Whether the affiliate has Twitter Blue verification. - **profilePicture** (string) - URL to the affiliate's profile picture. - **coverPicture** (string) - URL to the affiliate's cover picture. - **description** (string) - Description of the affiliate. - **location** (string) - Location of the affiliate. - **followers** (integer) - Number of followers the affiliate has. - **following** (integer) - Number of users the affiliate is following. - **tweets** (integer) - Number of tweets by the affiliate. - **createdAt** (string) - Timestamp when the affiliate account was created. ### Response Example (200) ```json { "userName": "eigencloud", "user_count": 20, "has_more": true, "next_cursor": "DAAC...", "affiliates": [ { "type": "user", "id": "44838", "userName": "sreeramkannan", "name": "Sreeram Kannan", "url": "https://x.com/sreeramkannan", "isVerified": false, "isBlueVerified": true, "profilePicture": "https://pbs.twimg.com/profile_images/..._400x400.jpg", "coverPicture": "https://pbs.twimg.com/profile_banners/", "description": "Founder @eigenlayer", "location": "Seattle", "followers": 44838, "following": 1200, "tweets": 5000, "createdAt": "Mon Mar 04 12:37:18 +0000 2024" } ] } ``` ### Error Responses #### 400 - Missing userName ```json { "error": "Missing required query param: userName" } ``` ``` -------------------------------- ### Get Article Source: https://docs.getxapi.com/docs/articles/get-article Fetch full Twitter/X article and note content by tweet ID via API. $0.001 per call. ```APIDOC ## GET /twitter/article/get ### Description Fetch full Twitter/X article and note content by tweet ID via API. This endpoint returns the complete article/note content for a given tweet ID. The tweet must be an article tweet (e.g. `x.com/i/article/...`). Regular tweets will return 404. ### Method GET ### Endpoint `/twitter/article/get` ### Query Parameters #### Query Parameters - **id** (string) - Required - Tweet ID of the article/note ### Response (200) - **status** (string) - Indicates the success status of the request. - **msg** (string) - A message confirming the success of the request. - **article** (object) - Contains the article details. - **id** (string) - Unique identifier for the article. - **author** (object) - Information about the article's author. - **replyCount** (integer) - Number of replies to the article tweet. - **likeCount** (integer) - Number of likes on the article tweet. - **quoteCount** (integer) - Number of quotes of the article tweet. - **viewCount** (integer) - Number of views on the article tweet. - **createdAt** (string) - Timestamp when the article was created. - **title** (string) - The title of the article. - **preview_text** (string) - A short preview of the article content. - **cover_media_img_url** (string) - URL of the cover image for the article. - **contents** (array) - An array of rich text blocks representing the article content. Each block can have a `type` (e.g., `unstyled`, `header-two`, `image`), `text`, and optional `inlineStyleRanges` for formatting. ### Response Example (200) ```json { "status": "success", "msg": "success", "article": { "id": "QXJ0aWNsZUVudGl0eToxOTA1NTQxMTM5MTQ0Mjk4NDk4", "author": { "type": "user", "userName": "Decentralisedco", "url": "https://x.com/Decentralisedco", "twitterUrl": "https://twitter.com/Decentralisedco", "id": "1764631141926002689", "name": "DCo", "isVerified": false, "isBlueVerified": true, "verifiedType": null, "profilePicture": "https://pbs.twimg.com/profile_images/..._normal.jpg", "coverPicture": "https://pbs.twimg.com/profile_banners/...", "description": "Investments and Research.", "location": "Subscribe →", "followers": 13657, "following": 325, "canDm": true, "createdAt": "Mon Mar 04 12:37:18 +0000 2024", "favouritesCount": 1620, "statusesCount": 1053, "mediaCount": 487, "pinnedTweetIds": ["2029569587029934133"] }, "replyCount": 16, "likeCount": 160, "quoteCount": 8, "viewCount": 44300, "createdAt": "Fri Mar 28 09:01:12 +0000 2025", "title": "When Tokens Burn", "preview_text": "Breaking down how crypto protocols approach revenue and cash flow...", "cover_media_img_url": "https://pbs.twimg.com/media/GnHXrznXUAEs-v5.jpg", "contents": [ { "type": "unstyled", "text": "Breaking down how crypto protocols approach revenue and cash flow", "inlineStyleRanges": [{ "length": 65, "offset": 0, "style": "Italic" }] }, { "type": "header-two", "text": "The Zero-Sum Attention Game" }, { "type": "unstyled", "text": "In 2021, each crypto asset had, on average, ~$1.8M in stablecoin liquidity..." }, { "type": "image", "url": "https://pbs.twimg.com/media/GnHZB47WwAAb6hU.png", "width": 2040, "height": 1372 }, { "type": "divider" }, { "type": "blockquote", "text": "One key insight here is..." }, { "type": "ordered-list-item", "text": "First point", "inlineStyleRanges": [{ "length": 5, "offset": 0, "style": "Bold" }] } ] } } ``` ### Error Responses #### 404 - Not an article tweet ```json { "error": "No article found for tweet: 2019264360682778716" } ``` ``` -------------------------------- ### Create and Publish Article (cURL) Source: https://docs.getxapi.com/docs/articles/create-article Use this cURL command to create and publish a Twitter/X article. Ensure your `auth_token` is valid and that the account has X Premium if `publish` is true. Provide a `proxy` for better reliability. ```curl curl -X POST "https://api.getxapi.com/twitter/article/create" \ -H "Authorization: Bearer API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auth_token": "your_auth_token", "title": "Three Books Worth Re-reading This Year", "content": "Some books reveal more on the second pass...\n\n## The Beginning of Infinity — David Deutsch\n\nDeutsch makes the case that **knowledge is the engine of change**...", "cover_image_url": "https://picsum.photos/1200/675", "publish": true }' ``` -------------------------------- ### Get Payment History Source: https://docs.getxapi.com/docs/account/payment-history Fetches a list of your past payments and top-ups, sorted by the most recent first. This endpoint is free to call and is rate-limited. ```APIDOC ## GET /account/payments ### Description Retrieves your payment and top-up history, sorted by most recent first. This endpoint is free to call and is rate-limited to 30 requests per minute. ### Method GET ### Endpoint `/account/payments` ### Headers - `Authorization`: `Bearer ` (Required) ### Response #### Success Response (200) - `payments` (array) - A list of payment objects. - `amount` (number) - Payment amount in dollars. - `credits_added` (number) - The number of credits added to your account. - `status` (string) - The status of the payment (e.g., "completed"). - `created_at` (string) - The date and time the payment was created in ISO 8601 format. #### Response Example (200) ```json { "payments": [ { "amount": 10, "credits_added": 10, "status": "completed", "created_at": "2026-03-18T00:17:02.346Z" } ] } ``` ### Error Responses #### 429 - Rate limited ```json { "error": "Too many requests. Limit: 30 per minute." } ``` ### Examples #### cURL ```bash curl -X GET "https://api.getxapi.com/account/payments" \ -H "Authorization: Bearer API_KEY" ``` #### JavaScript ```javascript const response = await fetch("https://api.getxapi.com/account/payments", { headers: { Authorization: "Bearer API_KEY" }, }); const data = await response.json(); console.log(data.payments); ``` #### Python ```python import requests response = requests.get( "https://api.getxapi.com/account/payments", headers={"Authorization": "Bearer API_KEY"}, ) print(response.json()["payments"]) ``` ``` -------------------------------- ### List All User Bookmarks Source: https://docs.getxapi.com/docs/users/bookmarks Use this endpoint to retrieve a list of all bookmarks for the authenticated user. Pagination is supported using the `cursor` parameter. The server automatically derives `ct0` and `twid` from the `auth_token`. ```json { "userId": "2021588307394834432", "tweet_count": 20, "has_more": true, "next_cursor": "HBbysNrihaHT4jMAAA==", "bookmarks": [ { "type": "tweet", "id": "2055000191112286719", "text": "Small accounts posting into absolute silence", "author": { "userName": "Tekeee" } } ] } ``` ```json { "error": "Missing required field: auth_token" } ``` ```json { "error": "Invalid auth_token - could not extract userId" } ``` -------------------------------- ### Create and Publish Article (JavaScript) Source: https://docs.getxapi.com/docs/articles/create-article This JavaScript snippet demonstrates how to create and publish a Twitter/X article using the Fetch API. It sends a POST request with the article details in JSON format. Premium subscription is required for publishing. ```javascript const response = await fetch("https://api.getxapi.com/twitter/article/create", { method: "POST", headers: { Authorization: "Bearer API_KEY", "Content-Type": "application/json", }, body: JSON.stringify({ auth_token: "your_auth_token", title: "Three Books Worth Re-reading This Year", content: "Some books reveal more on the second pass...", cover_image_url: "https://picsum.photos/1200/675", publish: true, }), }); const data = await response.json(); console.log(data); ``` -------------------------------- ### List Articles Request Source: https://docs.getxapi.com/docs/articles/list-articles Make a POST request to list articles. Specify the auth_token and optionally filter by lifecycle. ```curl curl -X POST "https://api.getxapi.com/twitter/article/list" \ -H "Authorization: Bearer API_KEY" \ -H "Content-Type: application/json" \ -d '{ "auth_token": "your_auth_token", "lifecycle": "Published" }' ```