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.
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.
Get User Profile Info - Endpoint Features
| Object | Description |
|---|---|
username |
[Required] username of an user |
{"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}}
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'
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.
Get User Media Timeline - Endpoint Features
| Object | Description |
|---|---|
userId |
[Required] id of the user |
cursor |
Optional cursor for pagination |
{"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,"downloadUrl":"https://pbs.twimg.com/media/G6T2OQCWIAAjsE_.jpg?format=jpg&name=large"}],"quoted":null},{"id":"1990806387837055153","title":"","createdAt":1763480204,"totalMediaCount":1,"statistics":{"likeCount":9880,"commentCount":1395,"retweetCount":814,"viewCount":555858,"quoteCount":96},"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":"1990806383357489152","isVideo":false,"downloadUrl":"https://pbs.twimg.com/media/G6DD26CacAAZntT.jpg?format=jpg&name=large"}],"quoted":null},{"id":"1990796256751575547","title":"","createdAt":1763477789,"totalMediaCount":1,"statistics":{"likeCount":29743,"commentCount":2242,"retweetCount":2684,"viewCount":1362228,"quoteCount":392},"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":"1990796247893225479","isVideo":false,"downloadUrl":"https://pbs.twimg.com/media/G6C6o8fbMAclS71.jpg?format=jpg&name=large"}],"quoted":null},{"id":"1989856098409758793","title":"","createdAt":1763253638,"totalMediaCount":1,"statistics":{"likeCount":9333,"commentCount":1753,"retweetCount":871,"viewCount":1255635,"quoteCount":150},"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":"1989856028654268416","isVideo":true,"downloadUrl":"https://video.twimg.com/amplify_video/1989856028654268416/vid/avc1/1280x720/V3cSqVDIC-s4Tk1F.mp4?tag=21"}],"quoted":null},{"id":"1989704582025679295","title":"","createdAt":1763217513,"totalMediaCount":1,"statistics":{"likeCount":20674,"commentCount":1419,"retweetCount":1750,"viewCount":1671579,"quoteCount":393},"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":"1989704579362217984","isVideo":false,"downloadUrl":"https://pbs.twimg.com/media/G5zZxeTaYAAogOw.jpg?format=jpg&name=large"}],"quoted":null}],"pagination":{"hasNextPage":true,"nextCursor":"DAABCgABHGWxkQF___0KAAIbnNnGg5uRvwgAAwAAAAIAAA"}}}
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'
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.
Get Tweet Details - Endpoint Features
| Object | Description |
|---|---|
idOrUrl |
[Required] id or url of the tweet |
{"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}}}
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'
| 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.
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.
To obtain your API key, you first need to sign in to your account and subscribe to the API you want to use. Once subscribed, go to your Profile, open the Subscription section, and select the specific API. Your API key will be available there and can be used 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.
If you don’t cancel before the 7th day, your free trial will end automatically and your subscription will switch to a paid plan under the same plan you originally subscribed to, meaning you will be charged and gain access to the API calls included in that plan.
The free trial ends when you reach 50 API requests or after 7 days, whichever comes first.
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, we offer a 7-day free trial that allows you to make up to 50 API calls at no cost, so you can test our APIs without any commitment.
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.
Service Level:
100%
Response Time:
1,626ms
Service Level:
100%
Response Time:
17ms
Service Level:
100%
Response Time:
1,704ms
Service Level:
100%
Response Time:
10,167ms
Service Level:
100%
Response Time:
1,135ms
Service Level:
100%
Response Time:
511ms
Service Level:
100%
Response Time:
1,932ms
Service Level:
100%
Response Time:
2,819ms
Service Level:
100%
Response Time:
3,116ms
Service Level:
100%
Response Time:
2,795ms