{
"data": {
"id": "44196397",
"name": "Elon Musk",
"username": "elonmusk",
"createdAt": 1243973549,
"avatarUrl": "https://pbs.twimg.com/profile_images/2053244804520427520/m8mdWZCG.jpg",
"isBlueVerified": true,
"bioDescription": "https://t.co/ZdBx5WABYx",
"profileBannerUrl": "https://pbs.twimg.com/profile_banners/44196397/1774145451",
"followersCount": 241677194,
"followingCount": 1407,
"statusesCount": 108841,
"mediaCount": 4721
}
}
curl --location --request GET 'https://zylalabs.com/api/12396/x+media+data+api/23441/get+user+profile+info?username=elonmusk' --header 'Authorization: Bearer YOUR_API_KEY'
{
"data": {
"dataItems": [
{
"id": "2092325098200220146",
"title": "Dolly spent her whole life showing us what it means to lead with love. Lauren and I are so grateful to have known her. She lifted everyone with her music, her generosity, and her joy. Sending our sincere condolences to her family and everyone she touched.",
"createdAt": 1787684151,
"totalMediaCount": 1,
"statistics": {
"likeCount": 42322,
"commentCount": 2682,
"retweetCount": 2647,
"viewCount": 2001723,
"quoteCount": 380
},
"author": {
"id": "15506669",
"name": "Jeff Bezos",
"username": "JeffBezos",
"createdAt": 1216593516,
"avatarUrl": "https://pbs.twimg.com/profile_images/1591558315254890500/ETIHb4Nl.jpg",
"isBlueVerified": true,
"bioDescription": "Six thousand years ago, someone invented the plow, and we all got wealthier. A gentle reminder that all civilizational wealth is driven by invention.",
"profileBannerUrl": "https://pbs.twimg.com/profile_banners/15506669/1448361938",
"followersCount": 10171321,
"followingCount": 615,
"statusesCount": 523,
"mediaCount": 219
},
"mediaList": [
{
"id": "2092325095511670784",
"isVideo": false,
"downloadUrl": "https://pbs.twimg.com/media/HQlulribwAAmHCN.jpg?format=jpg&name=large",
"thumbnailUrl": null
}
],
"quoted": null
},
{
"id": "2085487855015719204",
"title": "Team is moving at record speed out at the pad. Gradatim Ferociter!",
"createdAt": 1786054025,
"totalMediaCount": 1,
"statistics": {
"likeCount": 8293,
"commentCount": 1265,
"retweetCount": 480,
"viewCount": 467894,
"quoteCount": 62
},
"author": {
"id": "15506669",
"name": "Jeff Bezos",
"username": "JeffBezos",
"createdAt": 1216593516,
"avatarUrl": "https://pbs.twimg.com/profile_images/1591558315254890500/ETIHb4Nl.jpg",
"isBlueVerified": true,
"bioDescription": "Six thousand years ago, someone invented the plow, and we all got wealthier. A gentle reminder that all civilizational wealth is driven by invention.",
"profileBannerUrl": "https://pbs.twimg.com/profile_banners/15506669/1448361938",
"followersCount": 10171321,
"followingCount": 615,
"statusesCount": 523,
"mediaCount": 219
},
"mediaList": [
{
"id": "2085487851966545920",
"isVideo": false,
"downloadUrl": "https://pbs.twimg.com/media/HPEkJufbwAATnO0.jpg?format=jpg&name=large",
"thumbnailUrl": null
}
],
"quoted": null
},
{
"id": "2075363502441865592",
"title": "Wally Funk waited 60 years to get to space, and no one ever earned it more. She trained with the Mercury 13 in 1961, out-tested the men, and was told no anyway. She never stopped flying — 19,600 hours, thousands of students, a lifetime of firsts.\n\nFive years ago this month, I had",
"createdAt": 1783640192,
"totalMediaCount": 1,
"statistics": {
"likeCount": 9121,
"commentCount": 1439,
"retweetCount": 1199,
"viewCount": 1180566,
"quoteCount": 106
},
"author": {
"id": "15506669",
"name": "Jeff Bezos",
"username": "JeffBezos",
"createdAt": 1216593516,
"avatarUrl": "https://pbs.twimg.com/profile_images/1591558315254890500/ETIHb4Nl.jpg",
"isBlueVerified": true,
"bioDescription": "Six thousand years ago, someone invented the plow, and we all got wealthier. A gentle reminder that all civilizational wealth is driven by invention.",
"profileBannerUrl": "https://pbs.twimg.com/profile_banners/15506669/1448361938",
"followersCount": 10171321,
"followingCount": 615,
"statusesCount": 523,
"mediaCount": 219
},
"mediaList": [
{
"id": "2075363496846381056",
"isVideo": false,
"downloadUrl": "https://pbs.twimg.com/media/HM0sGslXUAAiioR.jpg?format=jpg&name=large",
"thumbnailUrl": null
}
],
"quoted": null
},
{
"id": "2062615731158523935",
"title": "One week later, incredible progress. It’s a 24/7 operation with a solid path forward to launch this year, helped by a lot of luck. @NASA and @USSpaceForce have both been extremely helpful.\n\nThis team. Never tell them the odds.",
"createdAt": 1780600886,
"totalMediaCount": 2,
"statistics": {
"likeCount": 11153,
"commentCount": 1473,
"retweetCount": 985,
"viewCount": 968719,
"quoteCount": 121
},
"author": {
"id": "15506669",
"name": "Jeff Bezos",
"username": "JeffBezos",
"createdAt": 1216593516,
"avatarUrl": "https://pbs.twimg.com/profile_images/1591558315254890500/ETIHb4Nl.jpg",
"isBlueVerified": true,
"bioDescription": "Six thousand years ago, someone invented the plow, and we all got wealthier. A gentle reminder that all civilizational wealth is driven by invention.",
"profileBannerUrl": "https://pbs.twimg.com/profile_banners/15506669/1448361938",
"followersCount": 10171321,
"followingCount": 615,
"statusesCount": 523,
"mediaCount": 219
},
"mediaList": [
{
"id": "2062615725005512706",
"isVideo": false,
"downloadUrl": "https://pbs.twimg.com/media/HJ_iEt0WoAIjw0a.jpg?format=jpg&name=large",
"thumbnailUrl": null
},
{
"id": "2062615725190062080",
"isVideo": false,
"downloadUrl": "https://pbs.twimg.com/media/HJ_iEugWoAAakxJ.jpg?format=jpg&name=large",
"thumbnailUrl": null
}
],
"quoted": null
},
{
"id": "2051405101466882188",
"title": "Booster Parking Only",
"createdAt": 1777928064,
"totalMediaCount": 1,
"statistics": {
"likeCount": 6706,
"commentCount": 715,
"retweetCount": 666,
"viewCount": 467838,
"quoteCount": 74
},
"author": {
"id": "15506669",
"name": "Jeff Bezos",
"username": "JeffBezos",
"createdAt": 1216593516,
"avatarUrl": "https://pbs.twimg.com/profile_images/1591558315254890500/ETIHb4Nl.jpg",
"isBlueVerified": true,
"bioDescription": "Six thousand years ago, someone invented the plow, and we all got wealthier. A gentle reminder that all civilizational wealth is driven by invention.",
"profileBannerUrl": "https://pbs.twimg.com/profile_banners/15506669/1448361938",
"followersCount": 10171321,
"followingCount": 615,
"statusesCount": 523,
"mediaCount": 219
},
"mediaList": [
{
"id": "2051405048085876736",
"isVideo": true,
"downloadUrl": "https://video.twimg.com/amplify_video/2051405048085876736/vid/avc1/1280x720/bS6KWeKXeReX0qNX.mp4?tag=27",
"thumbnailUrl": "https://pbs.twimg.com/amplify_video_thumb/2051405048085876736/img/iLBZiYu4--ECainK.jpg?format=jpg&name=large"
}
]
}
]
},
"_note": "Response truncated for documentation purposes"
}
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'
{
"data": {
"id": "2045309037848272993",
"title": "Tesla engineering redesigned lithium refining from physics first principles",
"createdAt": 1776474649,
"totalMediaCount": 0,
"statistics": {
"likeCount": 103031,
"commentCount": 3498,
"retweetCount": 12299,
"viewCount": 32800396,
"quoteCount": 358
},
"author": {
"id": "44196397",
"name": "Elon Musk",
"username": "elonmusk",
"createdAt": 1243973549,
"avatarUrl": "https://pbs.twimg.com/profile_images/2053244804520427520/m8mdWZCG.jpg",
"isBlueVerified": true,
"bioDescription": "https://t.co/ZdBx5WABYx",
"profileBannerUrl": "https://pbs.twimg.com/profile_banners/44196397/1774145451",
"followersCount": 241677197,
"followingCount": 1407,
"statusesCount": 108841,
"mediaCount": 4721
},
"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": 19186,
"commentCount": 618,
"retweetCount": 2449,
"viewCount": 31729265,
"quoteCount": 250
},
"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": 119603,
"followingCount": 20,
"statusesCount": 1080,
"mediaCount": 274
},
"mediaList": [
{
"id": "2045302933437526016",
"isVideo": true,
"downloadUrl": "https://video.twimg.com/amplify_video/2045302933437526016/vid/avc1/3840x2026/IEblQjFEFbwcuwQv.mp4?tag=21",
"thumbnailUrl": "https://pbs.twimg.com/amplify_video_thumb/2045302933437526016/img/GFFvnblI1S8q9aYC.jpg?format=jpg&name=large"
}
],
"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'
注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 X媒体数据 API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
| 标头 | 描述 |
|---|---|
授权
|
必需
应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。
|
无长期承诺。随时升级、降级或取消。 免费试用包括最多 50 个请求。
(年度计费可节省 2 个月 🎉)
X Media Data API 为开发者提供了一种直接收集公共 X 数据的方法,用于仪表盘、内容研究、创作者分析、内容审核工具和自动化管道
该 API 侧重于三个高价值用例:
1) 将用户名解析为个人资料信息
2) 使用基于游标的分页浏览用户媒体时间线
3) 从推文 ID 或完整 X URL 检索完整的推文级详细信息
这些端点是为生产 API 消费而构建的,具有清晰的查询验证、可预测的响应封装和轻量级的身份验证模型
在非开发环境中,身份验证使用单个安全头,方便从后端服务、无服务器函数和无代码自动化中集成
如果您正在发布社交监听产品、创作者智能工作流、增长工具或内容丰富管道,本 API 旨在缩短集成时间,同时保持端点行为的一致性
[主要价值主张]
- 仅需查询参数和一个身份验证头即可快速集成
- 针对操作工作负载设计:个人资料查找、媒体遍历和推文检查
- 非常适合 ETL、BI 仪表盘、创作者工具和潜在客户智能
- 适合 RapidAPI 消费者的干净 REST 形状
[基础 URL 和版本控制说明]
此列表中涵盖的 X 端点:
- /user/info
- /user/media
- /tweet/details
[全局请求/响应合同说明]
成功封装:
- API 响应在 "data" 字段内返回有效负载
错误封装:
- API 错误返回 "error" 字段
- 验证和 HTTP 异常在可用时可以包括 "errorDetails"
各端点的常见状态行为:
- 200:请求成功
- 400:查询参数验证失败
- 403:身份验证失败
- 500:上游故障或内部处理错误
重要提示:
由于上游社交源数据可能随时间变化,此列表故意避免对嵌套数据对象使用固定有效负载示例。稳定的合同是下面记录的封装和参数行为
API返回各种数据类型:用户资料信息端点提供用户详细信息,如ID、姓名、用户名、个人简介和关注者数量。用户媒体时间线端点返回带有统计数据的媒体帖子,如点赞、评论和转发。推文详情端点提供全面的推文信息,包括作者详细信息和与推文关联的媒体
关键字段包括用户档案的“id”、“name”、“username”、“bioDescription”和“followersCount”。对于媒体时间线,“totalMediaCount”、“statistics”和“mediaList”等字段是必不可少的。Tweet详情端点包含“title”、“createdAt”和“author”详细信息,提供了推文的完整视图
响应数据结构化在一个“data”字段内,其中包含相关信息 每个端点的响应包括与请求数据相关的特定属性 确保一致的格式 错误被包装在一个“error”字段中 提供请求过程中遇到的问题的清晰度
每个终端接受特定的参数:用户个人资料信息终端需要一个用户名,而用户媒体时间线终端需要一个用户 ID。推文详情终端可以接受推文 ID 或完整的 X URL。这些参数允许用户自定义他们的请求以精准获取数据
典型的用例包括为社交媒体分析创建仪表板进行内容研究和开发创作者智能工具该API在内容审核任务和自动化流程中也很有用能够实现各种应用的有效数据处理
通过直接访问公共X账户信息来维护数据的准确性,确保实时更新。API的设计包括对查询参数的验证检查,这有助于防止错误并确保返回的数据可靠且最新
用户可以通过将返回的数据集成到商业智能仪表板或ETL流程中来利用这些数据进行分析和报告 结构化的响应便于解析和处理,使开发人员能够构建需要从公共X数据中获取实时洞察的应用程序
用户应检查响应中的“data”字段。如果它为空或为null,则表示未找到结果。对400或500等状态码实施错误处理可以帮助管理意外结果,确保即使在数据不完整的情况下应用程序的稳健行为