X Media Data API

API ID 12396

Get public X account insights fast: profile data, media timeline pagination, and tweet-level details from simple REST endpoints.

313 ms avg response

API Documentation

Endpoints

Request
Use this endpoint to resolve a public X handle into profile information that can power account cards, identity lookups, creator dashboards, and enrichment pipelines. This endpoint is ideal when you need a lightweight account lookup before running deeper timeline or tweet-level analysis.
Endpoint ID: 23441
GET https://zylalabs.com/api/12396/x+media+data+api/23441/get+user+profile+info
INPUT PARAMETERS

Get User Profile Info — Endpoint Features

Object Description
username Required username of an user

Free test requests remaining: 3 of 3.


INPUT PARAMETERS

username
API EXAMPLE RESPONSE
JSON
{
    "data": {
        "id": "1360509398041378817",
        "name": "Defense Intelligence",
        "username": "DI313_",
        "createdAt": 1613205701,
        "avatarUrl": "https://pbs.twimg.com/profile_images/1773964459205181440/KJTgBai3.jpg",
        "isBlueVerified": true,
        "bioDescription": "Covering International Affairs, Monitoring Threat Matrix, National Security, Intelligence, Militancy and tracking politics.",
        "profileBannerUrl": "https://pbs.twimg.com/profile_banners/1360509398041378817/1754337330",
        "followersCount": 339166,
        "followingCount": 3761,
        "statusesCount": 30413,
        "mediaCount": 13292
    }
}
Get User Profile Info — CODE SNIPPETS

curl --location --request GET 'https://zylalabs.com/api/12396/x+media+data+api/23441/get+user+profile+info?username=Required' --header 'Authorization: Bearer YOUR_API_KEY' 


    
Request
Use this endpoint to fetch media-focused timeline data for a specific X user. It is suitable for feed ingestion, trend monitoring, archive jobs, and historical crawling workflows. The endpoint supports cursor-based pagination so clients can iterate over large timelines safely in multiple requests.
Endpoint ID: 23442
GET https://zylalabs.com/api/12396/x+media+data+api/23442/get+user+media+timeline
INPUT PARAMETERS

Get User Media Timeline — Endpoint Features

Object Description
userId Required id of the user
cursor Optional cursor for pagination

Free test requests remaining: 3 of 3.


INPUT PARAMETERS

userId
cursor
API EXAMPLE RESPONSE
JSON
{
    "data": {
        "dataItems": [
            {
                "id": "2045874068763632017",
                "title": "",
                "createdAt": 1776609363,
                "totalMediaCount": 1,
                "statistics": {
                    "likeCount": 188966,
                    "commentCount": 10423,
                    "retweetCount": 13521,
                    "viewCount": 16003821,
                    "quoteCount": 2725
                },
                "author": {
                    "id": "15506669",
                    "name": "Jeff Bezos",
                    "username": "JeffBezos",
                    "createdAt": 1216593516,
                    "avatarUrl": "https://pbs.twimg.com/profile_images/1591558315254890500/ETIHb4Nl.jpg",
                    "isBlueVerified": true,
                    "bioDescription": "Amazon. Blue Origin. Washington Post. Bezos Earth Fund. Bezos Academy.",
                    "profileBannerUrl": "https://pbs.twimg.com/profile_banners/15506669/1448361938",
                    "followersCount": 7461550,
                    "followingCount": 568,
                    "statusesCount": 495,
                    "mediaCount": 214
                },
                "mediaList": [
                    {
                        "id": "2045874002250416128",
                        "isVideo": true,
                        "downloadUrl": "https://video.twimg.com/amplify_video/2045874002250416128/vid/avc1/720x1280/Jai7sCeUH1ZrVWFD.mp4?tag=21"
                    }
                ],
                "quoted": null
            },
            {
                "id": "2044788684223066396",
                "title": "",
                "createdAt": 1776350587,
                "totalMediaCount": 1,
                "statistics": {
                    "likeCount": 10336,
                    "commentCount": 601,
                    "retweetCount": 859,
                    "viewCount": 493525,
                    "quoteCount": 87
                },
                "author": {
                    "id": "15506669",
                    "name": "Jeff Bezos",
                    "username": "JeffBezos",
                    "createdAt": 1216593516,
                    "avatarUrl": "https://pbs.twimg.com/profile_images/1591558315254890500/ETIHb4Nl.jpg",
                    "isBlueVerified": true,
                    "bioDescription": "Amazon. Blue Origin. Washington Post. Bezos Earth Fund. Bezos Academy.",
                    "profileBannerUrl": "https://pbs.twimg.com/profile_banners/15506669/1448361938",
                    "followersCount": 7461550,
                    "followingCount": 568,
                    "statusesCount": 495,
                    "mediaCount": 214
                },
                "mediaList": [
                    {
                        "id": "2044788615935664128",
                        "isVideo": true,
                        "downloadUrl": "https://video.twimg.com/amplify_video/2044788615935664128/vid/avc1/1280x720/ghkmXyJBW5eLztD_.mp4?tag=21"
                    }
                ],
                "quoted": null
            },
            {
                "id": "2043744899678515256",
                "title": "",
                "createdAt": 1776101729,
                "totalMediaCount": 1,
                "statistics": {
                    "likeCount": 23855,
                    "commentCount": 1071,
                    "retweetCount": 1494,
                    "viewCount": 1084509,
                    "quoteCount": 197
                },
                "author": {
                    "id": "15506669",
                    "name": "Jeff Bezos",
                    "username": "JeffBezos",
                    "createdAt": 1216593516,
                    "avatarUrl": "https://pbs.twimg.com/profile_images/1591558315254890500/ETIHb4Nl.jpg",
                    "isBlueVerified": true,
                    "bioDescription": "Amazon. Blue Origin. Washington Post. Bezos Earth Fund. Bezos Academy.",
                    "profileBannerUrl": "https://pbs.twimg.com/profile_banners/15506669/1448361938",
                    "followersCount": 7461550,
                    "followingCount": 568,
                    "statusesCount": 495,
                    "mediaCount": 214
                },
                "mediaList": [
                    {
                        "id": "2043744897640083458",
                        "isVideo": false,
                        "downloadUrl": "https://pbs.twimg.com/media/HFzXJ_tasAIL1wZ.jpg?format=jpg&name=large"
                    }
                ],
                "quoted": null
            },
            {
                "id": "2039372675211301259",
                "title": "Let’s go!",
                "createdAt": 1775059310,
                "totalMediaCount": 1,
                "statistics": {
                    "likeCount": 14651,
                    "commentCount": 911,
                    "retweetCount": 914,
                    "viewCount": 338954,
                    "quoteCount": 94
                },
                "author": {
                    "id": "15506669",
                    "name": "Jeff Bezos",
                    "username": "JeffBezos",
                    "createdAt": 1216593516,
                    "avatarUrl": "https://pbs.twimg.com/profile_images/1591558315254890500/ETIHb4Nl.jpg",
                    "isBlueVerified": true,
                    "bioDescription": "Amazon. Blue Origin. Washington Post. Bezos Earth Fund. Bezos Academy.",
                    "profileBannerUrl": "https://pbs.twimg.com/profile_banners/15506669/1448361938",
                    "followersCount": 7461550,
                    "followingCount": 568,
                    "statusesCount": 495,
                    "mediaCount": 214
                },
                "mediaList": [
                    {
                        "id": "2039372673055424512",
                        "isVideo": false,
                        "downloadUrl": "https://pbs.twimg.com/media/HE1OpB4bgAA31rJ.jpg?format=jpg&name=large"
                    }
                ],
                "quoted": null
            },
            {
                "id": "2020861883524247807",
                "title": "",
                "createdAt": 1770645993,
                "totalMediaCount": 1,
                "statistics": {
                    "likeCount": 23941,
                    "commentCount": 3470,
                    "retweetCount": 1403,
                    "viewCount": 7524170,
                    "quoteCount": 976
                },
                "author": {
                    "id": "15506669",
                    "name": "Jeff Bezos",
                    "username": "JeffBezos",
                    "createdAt": 1216593516,
                    "avatarUrl": "https://pbs.twimg.com/profile_images/1591558315254890500/ETIHb4Nl.jpg",
                    "isBlueVerified": true,
                    "bioDescription": "Amazon. Blue Origin. Washington Post. Bezos Earth Fund. Bezos Academy.",
                    "profileBannerUrl": "https://pbs.twimg.com/profile_banners/15506669/1448361938",
                    "followersCount": 7461550,
                    "followingCount": 568,
                    "statusesCount": 495,
                    "mediaCount": 214
                },
                "mediaList": [
                    {
                        "id": "2020861879552499712",
                        "isVideo": false,
                        "downloadUrl": "https://pbs.twimg.com/media/HAuLLCba4AAB2kT.jpg?format=jpg&name=large"
                    }
                ],
                "quoted": null
            },
            {
                "id": "1991987664766328990",
                "title": "The Blue Moon MK1 flight vehicle that will land near Shackleton crater. We’ll soon be doing fully integrated checkout tests. At over 26 feet tall (8 meters), it’s smaller than our MK2 human lander but larger than the historic Apollo lander.",
                "createdAt": 1763761843,
                "totalMediaCount": 1,
                "statistics": {
                    "likeCount": 12434,
                    "commentCount": 3739,
                    "retweetCount": 1603,
                    "viewCount": 1261663,
                    "quoteCount": 314
                },
                "author": {
                    "id": "15506669",
                    "name": "Jeff Bezos",
                    "username": "JeffBezos",
                    "createdAt": 1216593516,
                    "avatarUrl": "https://pbs.twimg.com/profile_images/1591558315254890500/ETIHb4Nl.jpg",
                    "isBlueVerified": true,
                    "bioDescription": "Amazon. Blue Origin. Washington Post. Bezos Earth Fund. Bezos Academy.",
                    "profileBannerUrl": "https://pbs.twimg.com/profile_banners/15506669/1448361938",
                    "followersCount": 7461550,
                    "followingCount": 568,
                    "statusesCount": 495,
                    "mediaCount": 214
                },
                "mediaList": [
                    {
                        "id": "1991987659888009216",
                        "isVideo": false
                    }
                ]
            }
        ]
    },
    "_note": "Response truncated for documentation purposes"
}
Get User Media Timeline — CODE SNIPPETS

curl --location --request GET 'https://zylalabs.com/api/12396/x+media+data+api/23442/get+user+media+timeline?userId=15506669' --header 'Authorization: Bearer YOUR_API_KEY' 


    
Request
Use this endpoint to normalize tweet lookups from mixed inputs. Your client can submit either a tweet ID directly or a complete X post URL, and the API resolves the internal tweet identifier before fetching detail data. This endpoint is useful for ingestion pipelines where users paste links, or for systems that store only tweet IDs.
Endpoint ID: 23443
GET https://zylalabs.com/api/12396/x+media+data+api/23443/get+tweet+details
INPUT PARAMETERS

Get Tweet Details — Endpoint Features

Object Description
idOrUrl Required id or url of the tweet

Free test requests remaining: 3 of 3.


INPUT PARAMETERS

idOrUrl
API EXAMPLE RESPONSE
JSON
{
    "data": {
        "id": "2045309037848272993",
        "title": "Tesla engineering redesigned lithium refining from physics first principles",
        "createdAt": 1776474649,
        "totalMediaCount": 0,
        "statistics": {
            "likeCount": 107713,
            "commentCount": 3560,
            "retweetCount": 14328,
            "viewCount": 31523263,
            "quoteCount": 350
        },
        "author": {
            "id": "44196397",
            "name": "Elon Musk",
            "username": "elonmusk",
            "createdAt": 1243973549,
            "avatarUrl": "https://pbs.twimg.com/profile_images/2035314704307081216/71U1ftM3.jpg",
            "isBlueVerified": true,
            "bioDescription": "https://t.co/dDtDyVssfm",
            "profileBannerUrl": "https://pbs.twimg.com/profile_banners/44196397/1774145451",
            "followersCount": 238604221,
            "followingCount": 1315,
            "statusesCount": 101597,
            "mediaCount": 4456
        },
        "mediaList": [],
        "quoted": {
            "id": "2045303851482546505",
            "title": "Our Lithium Refinery is designed to have a much lower carbon footprint than traditional hard rock refineries\n\n– Acid-free refining helps produce a safe coproduct\n– Water is recycled throughout production, with every drop treated & cleaned on site\n– Designed to close the loop for",
            "createdAt": 1776473412,
            "totalMediaCount": 1,
            "statistics": {
                "likeCount": 19470,
                "commentCount": 613,
                "retweetCount": 2627,
                "viewCount": 30877306,
                "quoteCount": 239
            },
            "author": {
                "id": "1679769205938311169",
                "name": "Tesla North America",
                "username": "tesla_na",
                "createdAt": 1689323193,
                "avatarUrl": "https://pbs.twimg.com/profile_images/1681000114607857665/FLyxuLUB.jpg",
                "isBlueVerified": true,
                "bioDescription": "Building a world of amazing abundance",
                "profileBannerUrl": "https://pbs.twimg.com/profile_banners/1679769205938311169/1689616932",
                "followersCount": 110959,
                "followingCount": 20,
                "statusesCount": 941,
                "mediaCount": 229
            },
            "mediaList": [
                {
                    "id": "2045302933437526016",
                    "isVideo": true,
                    "downloadUrl": "https://video.twimg.com/amplify_video/2045302933437526016/vid/avc1/3840x2026/IEblQjFEFbwcuwQv.mp4?tag=21"
                }
            ],
            "quoted": null
        }
    }
}
Get Tweet Details — CODE SNIPPETS

curl --location --request GET 'https://zylalabs.com/api/12396/x+media+data+api/23443/get+tweet+details?idOrUrl=https://x.com/elonmusk/status/2045309037848272993' --header 'Authorization: Bearer YOUR_API_KEY' 


    

API Access Key & Authentication

After signing up, every developer is assigned a personal API access key, a unique combination of letters and digits provided to access to our API endpoint. To authenticate with the X Media Data API simply include your bearer token in the Authorization header.

Headers
Header Description
Authorization Required Should be Bearer access_key. See "Your API Access Key" above when you are subscribed.

No long-term commitment. Upgrade, downgrade, or cancel anytime. Free Trial includes up to 50 requests.

(Save 2 months with annual billing 🎉)

🚀 Enterprise Plan

Starts at
$ 10,000/Year


  • Custom Volume
  • Custom Rate Limit
  • Specialized Customer Support
  • Real-Time API Monitoring

Overview

X Media Data API gives developers a direct way to collect public X data for dashboards, content research, creator analytics, moderation tools, and automation pipelines.

This API focuses on three high-value use cases:
1) Resolve a username into profile information.
2) Browse a user media timeline with cursor-based pagination.
3) Retrieve full tweet-level details from either a tweet ID or a full X URL.

The endpoints are built for production API consumption with clear query validation, predictable response wrapping, and a lightweight authentication model.

Authentication uses a single secret header in non-development environments, making it easy to integrate from backend services, serverless functions, and no-code automations.

If you are shipping social listening products, creator intelligence workflows, growth tools, or content enrichment pipelines, this API is designed to reduce integration time while keeping endpoint behavior consistent.

[PRIMARY VALUE PROPOSITION]
- Fast integration with only query params and one auth header.
- Designed for operational workloads: profile lookup, media traversal, and tweet inspection.
- Works well for ETL, BI dashboards, creator tooling, and lead intelligence.
- Clean REST shape suitable for RapidAPI consumers.

[BASE URL AND VERSIONING NOTES]
X endpoints covered in this listing:
- /user/info
- /user/media
- /tweet/details

[GLOBAL REQUEST/RESPONSE CONTRACT NOTES]
Success wrapper:
- API responses return payload inside the "data" field.

Error wrapper:
- API errors return the "error" field.
- Validation and HTTP exceptions can include "errorDetails" when available.

Common status behavior across endpoints:
- 200: Request successful.
- 400: Validation failed for query parameters.
- 403: Authentication failed.
- 500: Upstream failure or internal processing error.

IMPORTANT:
This listing intentionally avoids fixed payload examples for the nested data object because upstream social source data can evolve over time. The stable contract is the wrapper and parameter behavior documented below.

X Media Data API FAQs

The API returns various data types: the User Profile Info endpoint provides user details like ID, name, username, bio, and follower counts. The User Media Timeline endpoint returns media posts with statistics such as likes, comments, and retweets. The Tweet Details endpoint offers comprehensive tweet information, including author details and media associated with the tweet.

Key fields include "id," "name," "username," "bioDescription," and "followersCount" for user profiles. For media timelines, fields like "totalMediaCount," "statistics," and "mediaList" are essential. The Tweet Details endpoint features "title," "createdAt," and "author" details, providing a complete view of the tweet.

Response data is structured within a "data" field, which contains the relevant information. Each endpoint's response includes specific attributes related to the requested data, ensuring a consistent format. Errors are wrapped in an "error" field, providing clarity on issues encountered during requests.

Each endpoint accepts specific parameters: the User Profile Info endpoint requires a username, while the User Media Timeline endpoint needs a user ID. The Tweet Details endpoint can accept either a tweet ID or a full X URL. These parameters allow users to customize their requests for precise data retrieval.

Typical use cases include creating dashboards for social media analytics, conducting content research, and developing creator intelligence tools. The API is also useful for moderation tasks and automation pipelines, enabling efficient data handling for various applications.

Data accuracy is maintained through direct access to public X account information, ensuring real-time updates. The API's design includes validation checks for query parameters, which helps prevent errors and ensures that the data returned is reliable and up-to-date.

Users can leverage the returned data for analytics and reporting by integrating it into BI dashboards or ETL processes. The structured response allows for easy parsing and manipulation, enabling developers to build applications that require real-time insights from public X data.

Users should check the "data" field in the response. If it is empty or null, it indicates no results were found. Implementing error handling for status codes like 400 or 500 can help manage unexpected outcomes, ensuring robust application behavior even with incomplete data.

General FAQs

To obtain your API key, first sign in to your account and navigate to the API you want to use. From the API's Pricing section, choose a plan and complete the subscription process. Once subscribed, return to the API page and you will see your API Access Key displayed at the top of the documentation page. You can use this key to authenticate your requests.

You can’t switch APIs during the free trial. If you subscribe to a different API, your trial will end and the new subscription will start as a paid plan.

The free trial lasts for 7 days and allows you to make up to 50 API requests.

No, the free trial is available only once, so we recommend using it on the API that interests you the most. Most of our APIs offer a free trial, but some may not include this option.

Yes. If the API offers a free trial, you will see a "Free 7-Day Trial" option in its Pricing section. The trial lasts for 7 days and allows up to 50 API requests, enabling you to evaluate the API before subscribing to a paid plan.

Zyla API Hub is like a big store for APIs, where you can find thousands of them all in one place. We also offer dedicated support and real-time monitoring of all APIs. Once you sign up, you can pick and choose which APIs you want to use. Just remember, each API needs its own subscription. But if you subscribe to multiple ones, you'll use the same key for all of them, making things easier for you.

Prices are listed in USD (United States Dollar), EUR (Euro), CAD (Canadian Dollar), AUD (Australian Dollar), and GBP (British Pound). We accept all major debit and credit cards. Our payment system uses the latest security technology and is powered by Stripe, one of the world's most reliable payment companies. If you have any trouble paying by card, just contact us at [email protected]

Additionally, if you already have an active subscription in any of these currencies (USD, EUR, CAD, AUD, GBP), that currency will remain for subsequent subscriptions. You can change the currency at any time as long as you don't have any active subscriptions.
The local currency shown on the pricing page is based on the country of your IP address and is provided for reference only. The actual prices are in USD (United States Dollar). When you make a payment, the charge will appear on your card statement in USD, even if you see the equivalent amount in your local currency on our website. This means you cannot pay directly with your local currency.
Occasionally, a bank may decline the charge due to its fraud protection settings. We suggest reaching out to your bank initially to check if they are blocking our charges. Also, you can access the Billing Portal and change the card associated to make the payment. If these does not work and you need further assistance, please contact our team at [email protected]
Prices are determined by a recurring monthly or yearly subscription, depending on the chosen plan.
API calls are deducted from your plan based on successful requests. Each plan comes with a specific number of calls that you can make per month. Only successful calls, indicated by a Status 200 response, will be counted against your total. This ensures that failed or incomplete requests do not impact your monthly quota.
Zyla API Hub works on a recurring monthly subscription system. Your billing cycle will start the day you purchase one of the paid plans, and it will renew the same day of the next month. So be aware to cancel your subscription beforehand if you want to avoid future charges.
To upgrade your current subscription plan, simply go to the pricing page of the API and select the plan you want to upgrade to. The upgrade will be instant, allowing you to immediately enjoy the features of the new plan. Please note that any remaining calls from your previous plan will not be carried over to the new plan, so be aware of this when upgrading. You will be charged the full amount of the new plan.
To check how many API calls you have left for the current month, refer to the 'X-Zyla-API-Calls-Monthly-Remaining' field in the response header. For example, if your plan allows 1,000 requests per month and you've used 100, this field in the response header will indicate 900 remaining calls.

You can monitor your API usage through the response headers included with every request:

x-zyla-api-calls-monthly-used: Shows the total number of API requests you have used during the current billing period.
x-zyla-api-calls-monthly-remaining: Shows the number of API requests you have remaining for the current billing period.

The 'X-Zyla-RateLimit-Reset' header shows the number of seconds until your rate limit resets. This tells you when your request count will start fresh. For example, if it displays 3,600, it means 3,600 seconds are left until the limit resets.

Yes, you can cancel your subscription at any time. Simply go to the Pricing section of the API you're subscribed to and click the "Unsubscribe" button.

Please note that upgrades, downgrades, and cancellations take effect immediately. Once your subscription is canceled, access to the service will end immediately, regardless of any remaining API calls in your quota.

After 7 days, you will be charged the full amount for the plan you were subscribed to during the trial. Therefore, it's important to cancel before the trial period ends. Refund requests for forgetting to cancel on time are not accepted.
When you subscribe to an API free trial, you can make up to 50 API calls. If you wish to make additional API calls beyond this limit, the API will prompt you to perform an "Start Your Paid Plan." You can find the "Start Your Paid Plan" button in your profile under Subscription -> Choose the API you are subscribed to -> Pricing tab.
You can contact us through our chat channel to receive immediate assistance. We are always online from 8 am to 5 pm (EST). If you reach us after that time, we will get back to you as soon as possible. Additionally, you can contact us via email at [email protected]

Please have a look at our Refund Policy: https://zylalabs.com/terms#refund


Related APIs