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:上游故障或内部处理错误
重要提示:
由于上游社交源数据可能随时间变化,此列表故意避免对嵌套数据对象使用固定有效负载示例。稳定的合同是下面记录的封装和参数行为
使用此端点将公共 X 句柄解析为可以驱动账户卡、身份查找、创作者仪表板和增值管道的个人资料信息。
当您需要在运行更深入的时间线或推文级分析之前进行轻量级账户查找时,此端点是理想的选择。
获取用户个人资料信息 - 端点功能
| 对象 | 描述 |
|---|---|
username |
[必需] 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'
使用此端点获取特定X用户的媒体聚焦时间线数据。它适用于信息流获取、趋势监测、归档工作和历史爬取工作流程。
该端点支持基于游标的分页,因此客户端可以在多个请求中安全地遍历大量时间线。
获取用户媒体时间轴 - 端点功能
| 对象 | 描述 |
|---|---|
userId |
[必需] id of the user |
cursor |
可选 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'
使用此端点对混合输入的推文查找进行标准化。您的客户端可以直接提交推文 ID 或完整的 X 帖子 URL,API 在获取详细数据之前会解析内部推文标识符。
此端点对于用户粘贴链接的摄取管道或仅存储推文 ID 的系统非常有用。
获取推文详情 - 端点功能
| 对象 | 描述 |
|---|---|
idOrUrl |
[必需] 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'
| 标头 | 描述 |
|---|---|
授权
|
[必需] 应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。 |
无长期承诺。随时升级、降级或取消。 免费试用包括最多 50 个请求。
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等状态码实施错误处理可以帮助管理意外结果,确保即使在数据不完整的情况下应用程序的稳健行为
服务级别:
100%
响应时间:
1,626ms
服务级别:
100%
响应时间:
10,167ms
服务级别:
100%
响应时间:
1,932ms
服务级别:
100%
响应时间:
17ms
服务级别:
100%
响应时间:
1,348ms
服务级别:
100%
响应时间:
20,003ms
服务级别:
100%
响应时间:
1,284ms
服务级别:
100%
响应时间:
1,135ms
服务级别:
100%
响应时间:
636ms
服务级别:
100%
响应时间:
25ms
服务级别:
100%
响应时间:
19,536ms
服务级别:
100%
响应时间:
19,536ms
服务级别:
100%
响应时间:
19,536ms
服务级别:
100%
响应时间:
469ms
服务级别:
100%
响应时间:
19,536ms
服务级别:
100%
响应时间:
2,073ms
服务级别:
100%
响应时间:
712ms
服务级别:
100%
响应时间:
2,173ms
服务级别:
100%
响应时间:
144ms
服务级别:
100%
响应时间:
3,739ms