推特 API

获取完整的Twitter数据:通过ID获取用户信息、粉丝列表和发布推文的详细汇编
通过 MCP 从您的 AI 代理使用此 API
支持 OpenClaw、Claude Code/Desktop、Cursor、Windsurf、Cline 以及任何兼容 MCP 的 AI 客户端。
文档和设置
通过封装此 MCP 创建技能: https://mcp.zylalabs.com/mcp?apikey=YOUR_ZYLA_API_KEY

Twitter API 提供了一个全面的解决方案,用于访问、分析和管理平台上的公共个人资料和内容信息。它旨在为需要直接从 Twitter 获取结构化、最新数据的用户提供服务,适用于多种目的:品牌监测、趋势分析、影响者跟踪、报告生成和自定义应用程序创建。

通过这个 API,可以通过 ID 获取用户数据,这确保了准确性并避免了按名称搜索时常见的模糊性。您可以访问详细信息,例如姓名、简介、位置、账户创建日期、验证状态、个人资料图片和关键指标(关注者、关注、推文、列表)。

该 API 在设计上考虑了灵活性和可扩展性:它适应小型个人分析项目和需要大量信息的企业系统。通过将用户、关注者和推文数据的收集集中到一个服务中,它消除了多个单独集成的需要。

简而言之,Twitter API 为那些需要将 Twitter 上的公共信息转化为可操作知识的人提供了全面、最新和易于集成的数据,确保最大程度的准确性和效率。

API 文档

端点


获取完整的用户信息,包括个人资料 关注者 帖子 多媒体 认证 订阅 互动统计和专业详情


                                                                            
GET https://zylalabs.com/api/9795/twitter+api/18296/user+information
                                                                            
                                                                        

用户信息 - 端点功能

对象 描述
username [必需] Enter a username
测试端点

API 示例响应

       
                                                                                                        
                                                                                                                                                                                                                                                                                                                                        {"result":{"data":{"user":{"result":{"__typename":"User","id":"VXNlcjoxNTU2NTkyMTM=","rest_id":"155659213","affiliates_highlighted_label":{},"avatar":{"image_url":"https://pbs.twimg.com/profile_images/1940344470290989057/1OUP8RgK_normal.jpg"},"core":{"created_at":"Mon Jun 14 19:09:20 +0000 2010","name":"Cristiano Ronaldo","screen_name":"Cristiano"},"dm_permissions":{"can_dm":false},"has_graduated_access":true,"is_blue_verified":true,"legacy":{"default_profile":false,"default_profile_image":false,"description":"Welcome to the official account of Cristiano Ronaldo.","entities":{"description":{"urls":[]},"url":{"urls":[{"display_url":"cristianoronaldo.com","expanded_url":"https://www.cristianoronaldo.com/","url":"https://t.co/Pc19xaN1Sp","indices":[0,23]}]}},"fast_followers_count":0,"favourites_count":63,"followers_count":115709965,"friends_count":76,"has_custom_timelines":false,"is_translator":false,"listed_count":85008,"media_count":2401,"normal_followers_count":115709965,"pinned_tweet_ids_str":[],"possibly_sensitive":false,"profile_banner_url":"https://pbs.twimg.com/profile_banners/155659213/1751449147","profile_interstitial_type":"","statuses_count":4333,"translator_type":"regular","url":"https://t.co/Pc19xaN1Sp","want_retweets":false,"withheld_in_countries":[]},"location":{"location":""},"media_permissions":{"can_media_tag":true},"parody_commentary_fan_label":"None","profile_image_shape":"Circle","privacy":{"protected":false},"relationship_perspectives":{"following":false},"tipjar_settings":{},"verification":{"verified":false},"legacy_extended_profile":{"birthdate":{"day":5,"month":2,"year":1985,"visibility":"Public","year_visibility":"Public"}},"is_profile_translatable":false,"has_hidden_subscriptions_on_profile":false,"verification_info":{"is_identity_verified":false,"reason":{"description":{"text":"This account is verified. Learn more","entities":[{"from_index":26,"to_index":36,"ref":{"url":"https://help.twitter.com/managing-your-account/about-twitter-verified-accounts","url_type":"ExternalUrl"}}]},"verified_since_msec":"1276611237262"}},"highlights_info":{"can_highlight_tweets":true,"highlighted_tweets":"0"},"user_seed_tweet_count":0,"premium_gifting_eligible":false,"business_account":{},"creator_subscriptions_count":0}}}}}
                                                                                                                                                                                                                    
                                                                                                    

用户信息 - 代码片段


curl --location --request GET 'https://zylalabs.com/api/9795/twitter+api/18296/user+information?username=cristiano' --header 'Authorization: Bearer YOUR_API_KEY' 


    

获取多个用户的详细信息,包括个人资料 粉丝 帖子 多媒体 认证 订阅 互动统计和专业数据


                                                                            
GET https://zylalabs.com/api/9795/twitter+api/18377/users+data+by+id
                                                                            
                                                                        

用户数据通过ID - 端点功能

对象 描述
username [必需] Indicate the user IDs
测试端点

API 示例响应

       
                                                                                                        
                                                                                                                                                                                                                                                                                                                                        {"user":{"result":{"__typename":"User","id":"VXNlcjo0NDE5NjM5Nw==","rest_id":"44196397","affiliates_highlighted_label":{"label":{"url":{"url":"https://twitter.com/X","urlType":"DeepLink"},"badge":{"url":"https://pbs.twimg.com/profile_images/1955359038532653056/OSHY3ewP_bigger.jpg"},"description":"X","userLabelType":"BusinessLabel","userLabelDisplayType":"Badge"}},"has_graduated_access":true,"is_blue_verified":true,"profile_image_shape":"Circle","legacy":{"can_dm":false,"can_media_tag":false,"created_at":"Tue Jun 02 20:12:29 +0000 2009","default_profile":false,"default_profile_image":false,"description":"","entities":{"description":{"urls":[]}},"fast_followers_count":0,"favourites_count":166106,"followers_count":224782226,"friends_count":1185,"has_custom_timelines":true,"is_translator":false,"listed_count":163831,"location":"","media_count":4101,"name":"Elon Musk","normal_followers_count":224782226,"pinned_tweet_ids_str":[],"possibly_sensitive":false,"profile_banner_url":"https://pbs.twimg.com/profile_banners/44196397/1739948056","profile_image_url_https":"https://pbs.twimg.com/profile_images/1936002956333080576/kqqe2iWO_normal.jpg","profile_interstitial_type":"","screen_name":"elonmusk","statuses_count":84387,"translator_type":"none","verified":false,"want_retweets":false,"withheld_in_countries":[]},"professional":{"rest_id":"1679729435447275522","professional_type":"Creator","category":[]},"tipjar_settings":{"is_enabled":false},"super_follow_eligible":true,"smart_blocked_by":false,"smart_blocking":false,"legacy_extended_profile":{},"is_profile_translatable":false,"has_hidden_likes_on_profile":true,"has_hidden_subscriptions_on_profile":true,"verification_info":{"is_identity_verified":false,"reason":{"description":{"text":"This account is verified because it's an affiliate of @X on X. Learn more","entities":[{"from_index":54,"to_index":56,"ref":{"url":"https://twitter.com/X","url_type":"ExternalUrl"}},{"from_index":63,"to_index":73,"ref":{"url":"https://help.twitter.com/en/rules-and-policies/profile-labels","url_type":"ExternalUrl"}}]},"verified_since_msec":"-156836000000000","override_verified_year":-3000}},"highlights_info":{"can_highlight_tweets":true,"highlighted_tweets":"717"},"user_seed_tweet_count":0,"business_account":{},"creator_subscriptions_count":223}}}
                                                                                                                                                                                                                    
                                                                                                    

用户数据通过ID - 代码片段


curl --location --request GET 'https://zylalabs.com/api/9795/twitter+api/18377/users+data+by+id?username=elonmusk' --header 'Authorization: Bearer YOUR_API_KEY' 


    

获取有关关注者的详细信息,包括ID名称简介经过验证的账户关注者指标链接个人资料图片和其他设置


                                                                            
GET https://zylalabs.com/api/9795/twitter+api/18403/followers
                                                                            
                                                                        

关注者 - 端点功能

对象 描述
user_id [必需] Indicates a user id
测试端点

API 示例响应

       
                                                                                                        
                                                                                                                                                                                                                                                                                                                                        {"data":[{"__typename":"User","id":"VXNlcjo5NTA5MjAyMA==","rest_id":"95092020","affiliates_highlighted_label":{},"has_graduated_access":true,"is_blue_verified":true,"legacy":{"following":false,"can_dm":true,"can_media_tag":false,"created_at":"Sun Dec 06 23:33:02 +0000 2009","default_profile":false,"default_profile_image":false,"description":"Best-Selling Author | Clinical Psychologist | #1 Education Podcast | Co-founder of @petersonacademy | Order my new book \"We Who Wrestle With God\" here:","entities":{"description":{"urls":[]},"url":{"urls":[{"display_url":"jordanbpeterson.com/books","expanded_url":"http://jordanbpeterson.com/books","url":"https://t.co/KgUEvmxeQD","indices":[0,23]}]}},"fast_followers_count":0,"favourites_count":227,"followers_count":6122233,"friends_count":1660,"has_custom_timelines":true,"is_translator":false,"listed_count":14914,"location":"","media_count":7369,"name":"Dr Jordan B Peterson","normal_followers_count":6122233,"pinned_tweet_ids_str":["1949912864271323255"],"possibly_sensitive":false,"profile_banner_url":"https://pbs.twimg.com/profile_banners/95092020/1744917990","profile_image_url_https":"https://pbs.twimg.com/profile_images/1407056014776614923/TKBC60e1_normal.jpg","profile_interstitial_type":"","screen_name":"jordanbpeterson","statuses_count":51582,"translator_type":"none","url":"https://t.co/KgUEvmxeQD","verified":false,"want_retweets":false,"withheld_in_countries":[]},"parody_commentary_fan_label":"None","profile_image_shape":"Circle","professional":{"rest_id":"1680046132699840514","professional_type":"Creator","category":[{"id":144,"name":"Education","icon_name":"IconBriefcaseStroke"}]},"tipjar_settings":{"is_enabled":true},"super_follow_eligible":true},{"__typename":"User","id":"VXNlcjozOTM0NDM3NA==","rest_id":"39344374","affiliates_highlighted_label":{},"has_graduated_access":true,"is_blue_verified":true,"legacy":{"following":false,"can_dm":false,"can_media_tag":true,"created_at":"Mon May 11 21:18:33 +0000 2009","default_profile":false,"default_profile_image":false,"description":"Co-Founder @worldlibertyfi","entities":{"description":{"urls":[]},"url":{"urls":[{"display_url":"linktr.ee/donaldjtrumpjr","expanded_url":"https://linktr.ee/donaldjtrumpjr","url":"https://t.co/ni5HwFvEjX","indices":[0,23]}]}},"fast_followers_count":0,"favourites_count":38535,"followers_count":15346923,"friends_count":2275,"has_custom_timelines":true,"is_translator":false,"listed_count":24852,"location":"Florida, USA","media_count":3396,"name":"Donald Trump Jr.","normal_followers_count":15346923,"pinned_tweet_ids_str":["1959966790353653946"],"possibly_sensitive":false,"profile_banner_url":"https://pbs.twimg.com/profile_banners/39344374/1674355501","profile_image_url_https":"https://pbs.twimg.com/profile_images/766652495858896897/LjrJJB9a_normal.jpg","profile_interstitial_type":"","screen_name":"DonaldJTrumpJr","statuses_count":51707,"translator_type":"none","url":"https://t.co/ni5HwFvEjX","verified":false,"want_retweets":false,"withheld_in_countries":[]},"parody_commentary_fan_label":"None","profile_image_shape":"Circle","tipjar_settings":{}},{"__typename":"User","id":"VXNlcjoxODU4NDg3NQ==","rest_id":"18584875","affiliates_highlighted_label":{},"has_graduated_access":true,"is_blue_verified":true,"legacy":{"following":false,"can_dm":true,"can_media_tag":true,"created_at":"Sat Jan 03 19:24:16 +0000 2009","default_profile":false,"default_profile_image":false,"description":"Merch & Giveaways at: https://t.co/kxb8qjGCDW  —— PODCAST: @thetwinspod","entities":{"description":{"urls":[{"display_url":"officialhodgetwins.com","expanded_url":"http://officialhodgetwins.com","url":"https://t.co/kxb8qjGCDW","indices":[22,45]}]},"url":{"urls":[{"display_url":"officialhodgetwins.com","expanded_url":"https://officialhodgetwins.com","url":"https://t.co/ybNwIM3aIe","indices":[0,23]}]}},"fast_followers_count":0,"favourites_count":14440,"followers_count":3390786,"friends_count":3591,"has_custom_timelines":false,"is_translator":false,"listed_count":4520,"location":"United States","media_count":3649,"name":"Hodgetwins","normal_followers_count":3390786,"pinned_tweet_ids_str":["1959662145068831140"],"possibly_sensitive":false,"profile_banner_url":"https://pbs.twimg.com/profile_banners/18584875/1720914411","profile_image_url_https":"https://pbs.twimg.com/profile_images/1928553264880164864/v6RIyEXP_normal.jpg","profile_interstitial_type":"","screen_name":"hodgetwins","statuses_count":59304,"translator_type":"none","url":"https://t.co/ybNwIM3aIe","verified":false,"want_retweets":false,"withheld_in_countries":[]},"parody_commentary_fan_label":"None","profile_image_shape":"Circle","professional":{"rest_id":"1487870054645391361","professional_type":"Creator","category":[{"id":934,"name":"Social Media Influencer","icon_name":"IconBriefcaseStroke"}]},"tipjar_settings":{"is_enabled":true,"bitcoin_handle":"bc1qv0u682l7yxxjm95w0xxmpe2vnwsl8fc9urk5k8","ethereum_handle":"0x36a6C64401FEd5A0bc1E4AB63005ade1d5a919F6"},"super_follow_eligible":true},{"__typename":"User","id":"VXNlcjo0OTE0Mzg0MDQw","rest_id":"4914384040","affiliates_highlighted_label":{},"has_graduated_access":true,"is_blue_verified":true,"legacy":{"following":false,"can_dm":false,"can_media_tag":true,"created_at":"Mon Feb 15 16:05:21 +0000 2016","default_profile":false,"default_profile_image":false,"description":"Fake news you can trust 🐝","entities":{"description":{"urls":[]},"url":{"urls":[{"display_url":"linktr.ee/babylonbee","expanded_url":"https://linktr.ee/babylonbee","url":"https://t.co/0PhJZklwkT","indices":[0,23]}]}},"fast_followers_count":0,"favourites_count":1858,"followers_count":4979606,"friends_count":10,"has_custom_timelines":false,"is_translator":false,"listed_count":8353,"location":"United States","media_count":15882,"name":"The Babylon Bee","normal_followers_count":4979606,"pinned_tweet_ids_str":["1957908099416969361"],"possibly_sensitive":false,"profile_banner_url":"https://pbs.twimg.com/profile_banners/4914384040/1755629983","profile_image_url_https":"https://pbs.twimg.com/profile_images/1400100770624720898/-HC7kL5x_normal.jpg","profile_interstitial_type":"","screen_name":"TheBabylonBee","statuses_count":33029,"translator_type":"none","url":"https://t.co/0PhJZklwkT","verified":false,"verified_type":"Business","want_retweets":false,"withheld_in_countries":[]},"parody_commentary_fan_label":"None","profile_image_shape":"Square","professional":{"rest_id":"1649577634316304385","professional_type":"Business","category":[{"id":580,"name":"Media & News Company","icon_name":"IconBriefcaseStroke"}]},"tipjar_settings":{},"super_follow_eligible":true},{"__typename":"User","id":"VXNlcjoxODE2Njc3OA==","rest_id":"18166778","affiliates_highlighted_label":{"label":{"url":{"url":"https://twitter.com/HouseGOP","urlType":"DeepLink"},"badge":{"url":"https://pbs.twimg.com/profile_images/1877085039948668928/f4AibqzY_bigger.jpg"},"description":"House Republicans","userLabelType":"BusinessLabel","userLabelDisplayType":"Badge"}},"has_graduated_access":true,"is_blue_verified":true,"legacy":{"following":false,"can_dm":false,"can_media_tag":true,"created_at":"Tue Dec 16 17:20:24 +0000 2008","default_profile":false,"default_profile_image":false,"description":"Proudly serving Ohio's beautiful Fourth District. Chairman @JudiciaryGOP. Fighting to #DoWhatWeSaid","entities":{"description":{"urls":[]},"url":{"urls":[{"display_url":"linktr.ee/chairmanjimjor…","expanded_url":"https://linktr.ee/chairmanjimjordan","url":"https://t.co/nCZphybp79","indices":[0,23]}]}},"fast_followers_count":0,"favourites_count":5370,"followers_count":6474820,"friends_count":3657,"has_custom_timelines":true,"is_translator":false,"listed_count":11723,"location":"Washington, D.C. ","media_count":2081,"name":"Rep. Jim Jordan","normal_followers_count":6474820,"pinned_tweet_ids_str":["1958604018949005587"],"possibly_sensitive":false,"profile_banner_url":"https://pbs.twimg.com/profile_banners/18166778/1406042839","profile_image_url_https":"https://pbs.twimg.com/profile_images/596012379231617025/TtrAXbnA_normal.jpg","profile_interstitial_type":"","screen_name":"Jim_Jordan","statuses_count":15859,"translator_type":"none","url":"https://t.co/nCZphybp79","verified":false,"verified_type":"Government","want_retweets":false,"withheld_in_countries":[]},"parody_commentary_fan_label":"None","profile_image_shape":"Circle","tipjar_settings":{}},{"__typename":"User","id":"VXNlcjoyMzI5MDEzMzE=","rest_id":"232901331","affiliates_highlighted_label":{},"has_graduated_access":true,"is_blue_verified":true,"legacy":{"following":false,"can_dm":false,"can_media_tag":true,"created_at":"Sat Jan 01 17:50:03 +0000 2011","default_profile":false,"default_profile_image":false,"description":"","entities":{"description":{"urls":[]},"url":{"urls":[{"display_url":"bongino.com","expanded_url":"http://www.bongino.com","url":"https://t.co/h3Y3otPk07","indices":[0,23]}]}},"fast_followers_count":0,"favourites_count":70096,"followers_count":7093020,"friends_count":2305,"has_custom_timelines":true,"is_translator":false,"listed_count":11416,"location":"","media_count":1817,"name":"Dan Bongino","normal_followers_count":7093020,"pinned_tweet_ids_str":[],"possibly_sensitive":false,"profile_banner_url":"https://pbs.twimg.com/profile_banners/232901331/1742295117","profile_image_url_https":"https://pbs.twimg.com/profile_images/1901949643828625408/cIoDpRVb_normal.jpg","profile_interstitial_type":"","screen_name":"dbongino","statuses_count":50147,"translator_type":"none","url":"https://t.co/h3Y3otPk07","verified":false,"want_retweets":false,"withheld_in_countries":[]},"parody_commentary_fan_label":"None","profile_image_shape":"Circle","tipjar_settings":{}},{"__typename":"User","id":"VXNlcjo0MjcwODk2Mjg=","rest_id":"427089628","affiliates_highlighted_label":{},"has_graduated_access":true,"is_blue_verified":true,"legacy":{"following":false,"can_dm":false,"can_media_tag":false,"created_at":"Sat Dec 03 03:06:19 +0000 2011","default_profile":false}}],"_note":"Response truncated for documentation purposes"}
                                                                                                                                                                                                                    
                                                                                                    

关注者 - 代码片段


curl --location --request GET 'https://zylalabs.com/api/9795/twitter+api/18403/followers?user_id=44196397' --header 'Authorization: Bearer YOUR_API_KEY' 


    

提供特定推文的完整详细信息,包括计数、附加媒体、标签、元数据、可用性和相关互动属性



                                                                            
GET https://zylalabs.com/api/9795/twitter+api/18404/user+tweets
                                                                            
                                                                        

用户推文 - 端点功能

对象 描述
user_id [必需] Indicates user ID
测试端点

API 示例响应

       
                                                                                                        
                                                                                                                                                                                                                                                                                                                                        {"data":[{"bookmark_count":2061,"bookmarked":false,"created_at":"Mon Aug 25 20:01:39 +0000 2025","conversation_id_str":"1960070086229918070","display_text_range":[0,252],"entities":{"hashtags":[],"media":[{"display_url":"pic.x.com/y7kb3B4YvU","expanded_url":"https://x.com/taylorswift13/status/1960070086229918070/photo/1","id_str":"1960070074905014273","indices":[253,276],"media_key":"3_1960070074905014273","media_url_https":"https://pbs.twimg.com/media/GzORWSWWMAE3RsS.jpg","type":"photo","url":"https://t.co/y7kb3B4YvU","ext_media_availability":{"status":"Available"},"features":{"large":{"faces":[{"x":1544,"y":1688,"h":192,"w":192}]},"medium":{"faces":[{"x":904,"y":989,"h":112,"w":112}]},"small":{"faces":[{"x":512,"y":560,"h":63,"w":63}]},"orig":{"faces":[{"x":3088,"y":3376,"h":384,"w":384}]}},"sizes":{"large":{"h":2048,"w":2048,"resize":"fit"},"medium":{"h":1200,"w":1200,"resize":"fit"},"small":{"h":680,"w":680,"resize":"fit"},"thumb":{"h":150,"w":150,"resize":"crop"}},"original_info":{"height":4096,"width":4096,"focus_rects":[{"x":0,"y":798,"w":4096,"h":2294},{"x":0,"y":0,"w":4096,"h":4096},{"x":149,"y":0,"w":3593,"h":4096},{"x":921,"y":0,"w":2048,"h":4096},{"x":0,"y":0,"w":4096,"h":4096}]},"media_results":{"result":{"media_key":"3_1960070074905014273"}}},{"display_url":"pic.x.com/y7kb3B4YvU","expanded_url":"https://x.com/taylorswift13/status/1960070086229918070/photo/1","id_str":"1960070074930216960","indices":[253,276],"media_key":"3_1960070074930216960","media_url_https":"https://pbs.twimg.com/media/GzORWScWwAA5mx2.jpg","type":"photo","url":"https://t.co/y7kb3B4YvU","ext_media_availability":{"status":"Available"},"features":{"large":{"faces":[]},"medium":{"faces":[]},"small":{"faces":[]},"orig":{"faces":[]}},"sizes":{"large":{"h":2048,"w":2048,"resize":"fit"},"medium":{"h":1200,"w":1200,"resize":"fit"},"small":{"h":680,"w":680,"resize":"fit"},"thumb":{"h":150,"w":150,"resize":"crop"}},"original_info":{"height":3000,"width":3000,"focus_rects":[{"x":0,"y":585,"w":3000,"h":1680},{"x":0,"y":0,"w":3000,"h":3000},{"x":109,"y":0,"w":2632,"h":3000},{"x":675,"y":0,"w":1500,"h":3000},{"x":0,"y":0,"w":3000,"h":3000}]},"media_results":{"result":{"media_key":"3_1960070074930216960"}}},{"display_url":"pic.x.com/y7kb3B4YvU","expanded_url":"https://x.com/taylorswift13/status/1960070086229918070/photo/1","id_str":"1960070074909257728","indices":[253,276],"media_key":"3_1960070074909257728","media_url_https":"https://pbs.twimg.com/media/GzORWSXW8AAiftg.jpg","type":"photo","url":"https://t.co/y7kb3B4YvU","ext_media_availability":{"status":"Available"},"features":{"large":{"faces":[{"x":1551,"y":1705,"h":151,"w":151}]},"medium":{"faces":[{"x":909,"y":999,"h":88,"w":88}]},"small":{"faces":[{"x":515,"y":566,"h":50,"w":50}]},"orig":{"faces":[{"x":2955,"y":3248,"h":289,"w":289}]}},"sizes":{"large":{"h":2048,"w":2048,"resize":"fit"},"medium":{"h":1200,"w":1200,"resize":"fit"},"small":{"h":680,"w":680,"resize":"fit"},"thumb":{"h":150,"w":150,"resize":"crop"}},"original_info":{"height":3900,"width":3900,"focus_rects":[{"x":0,"y":1716,"w":3900,"h":2184},{"x":0,"y":0,"w":3900,"h":3900},{"x":0,"y":0,"w":3421,"h":3900},{"x":0,"y":0,"w":1950,"h":3900},{"x":0,"y":0,"w":3900,"h":3900}]},"media_results":{"result":{"media_key":"3_1960070074909257728"}}}],"symbols":[],"timestamps":[],"urls":[{"display_url":"store.taylorswift.com","expanded_url":"http://store.taylorswift.com","url":"https://t.co/WdrCmvMfo8","indices":[138,161]}],"user_mentions":[]},"extended_entities":{"media":[{"display_url":"pic.x.com/y7kb3B4YvU","expanded_url":"https://x.com/taylorswift13/status/1960070086229918070/photo/1","id_str":"1960070074905014273","indices":[253,276],"media_key":"3_1960070074905014273","media_url_https":"https://pbs.twimg.com/media/GzORWSWWMAE3RsS.jpg","type":"photo","url":"https://t.co/y7kb3B4YvU","ext_media_availability":{"status":"Available"},"features":{"large":{"faces":[{"x":1544,"y":1688,"h":192,"w":192}]},"medium":{"faces":[{"x":904,"y":989,"h":112,"w":112}]},"small":{"faces":[{"x":512,"y":560,"h":63,"w":63}]},"orig":{"faces":[{"x":3088,"y":3376,"h":384,"w":384}]}},"sizes":{"large":{"h":2048,"w":2048,"resize":"fit"},"medium":{"h":1200,"w":1200,"resize":"fit"},"small":{"h":680,"w":680,"resize":"fit"},"thumb":{"h":150,"w":150,"resize":"crop"}},"original_info":{"height":4096,"width":4096,"focus_rects":[{"x":0,"y":798,"w":4096,"h":2294},{"x":0,"y":0,"w":4096,"h":4096},{"x":149,"y":0,"w":3593,"h":4096},{"x":921,"y":0,"w":2048,"h":4096},{"x":0,"y":0,"w":4096,"h":4096}]},"media_results":{"result":{"media_key":"3_1960070074905014273"}}},{"display_url":"pic.x.com/y7kb3B4YvU","expanded_url":"https://x.com/taylorswift13/status/1960070086229918070/photo/1","id_str":"1960070074930216960","indices":[253,276],"media_key":"3_1960070074930216960","media_url_https":"https://pbs.twimg.com/media/GzORWScWwAA5mx2.jpg","type":"photo","url":"https://t.co/y7kb3B4YvU","ext_media_availability":{"status":"Available"},"features":{"large":{"faces":[]},"medium":{"faces":[]},"small":{"faces":[]},"orig":{"faces":[]}},"sizes":{"large":{"h":2048,"w":2048,"resize":"fit"},"medium":{"h":1200,"w":1200,"resize":"fit"},"small":{"h":680,"w":680,"resize":"fit"},"thumb":{"h":150,"w":150,"resize":"crop"}},"original_info":{"height":3000,"width":3000,"focus_rects":[{"x":0,"y":585,"w":3000,"h":1680},{"x":0,"y":0,"w":3000,"h":3000},{"x":109,"y":0,"w":2632,"h":3000},{"x":675,"y":0,"w":1500,"h":3000},{"x":0,"y":0,"w":3000,"h":3000}]},"media_results":{"result":{"media_key":"3_1960070074930216960"}}},{"display_url":"pic.x.com/y7kb3B4YvU","expanded_url":"https://x.com/taylorswift13/status/1960070086229918070/photo/1","id_str":"1960070074909257728","indices":[253,276],"media_key":"3_1960070074909257728","media_url_https":"https://pbs.twimg.com/media/GzORWSXW8AAiftg.jpg","type":"photo","url":"https://t.co/y7kb3B4YvU","ext_media_availability":{"status":"Available"},"features":{"large":{"faces":[{"x":1551,"y":1705,"h":151,"w":151}]},"medium":{"faces":[{"x":909,"y":999,"h":88,"w":88}]},"small":{"faces":[{"x":515,"y":566,"h":50,"w":50}]},"orig":{"faces":[{"x":2955,"y":3248,"h":289,"w":289}]}},"sizes":{"large":{"h":2048,"w":2048,"resize":"fit"},"medium":{"h":1200,"w":1200,"resize":"fit"},"small":{"h":680,"w":680,"resize":"fit"},"thumb":{"h":150,"w":150,"resize":"crop"}},"original_info":{"height":3900,"width":3900,"focus_rects":[{"x":0,"y":1716,"w":3900,"h":2184},{"x":0,"y":0,"w":3900,"h":3900},{"x":0,"y":0,"w":3421,"h":3900},{"x":0,"y":0,"w":1950,"h":3900},{"x":0,"y":0,"w":3900,"h":3900}]},"media_results":{"result":{"media_key":"3_1960070074909257728"}}}]},"favorite_count":111792,"favorited":false,"full_text":"The Life of a Showgirl: The Tiny Bubbles in Champagne Vinyl Collection is available now on my site for 48 hours while supplies last ❤️‍🔥\n\nhttps://t.co/WdrCmvMfo8\n\nAlbum Producers: Max Martin, Shellback and Taylor Swift\n📸: Mert Alas &amp; Marcus Piggott https://t.co/y7kb3B4YvU","is_quote_status":false,"lang":"en","possibly_sensitive":false,"possibly_sensitive_editable":true,"quote_count":7362,"reply_count":3116,"retweet_count":23536,"retweeted":false,"user_id_str":"17919972","id_str":"1960070086229918070","view_count":2886892,"source":"<a href=\"http://twitter.com/download/iphone\" rel=\"nofollow\">Twitter for iPhone</a>"},{"bookmark_count":6125,"bookmarked":false,"created_at":"Thu Aug 21 18:00:40 +0000 2025","conversation_id_str":"1958590089732264402","display_text_range":[0,249],"entities":{"hashtags":[],"media":[{"display_url":"pic.x.com/ExVQpnEyOk","expanded_url":"https://x.com/taylorswift13/status/1958590089732264402/photo/1","id_str":"1958590078021771264","indices":[250,273],"media_key":"3_1958590078021771264","media_url_https":"https://pbs.twimg.com/media/Gy5PTIUXoAArdx9.jpg","type":"photo","url":"https://t.co/ExVQpnEyOk","ext_media_availability":{"status":"Available"},"features":{"large":{"faces":[{"x":870,"y":926,"h":76,"w":76},{"x":632,"y":1016,"h":96,"w":96},{"x":1002,"y":946,"h":136,"w":136}]},"medium":{"faces":[{"x":509,"y":542,"h":44,"w":44},{"x":370,"y":595,"h":56,"w":56},{"x":587,"y":554,"h":79,"w":79}]},"small":{"faces":[{"x":288,"y":307,"h":25,"w":25},{"x":209,"y":337,"h":31,"w":31},{"x":332,"y":314,"h":45,"w":45}]},"orig":{"faces":[{"x":1740,"y":1852,"h":152,"w":152},{"x":1264,"y":2032,"h":192,"w":192},{"x":2004,"y":1892,"h":272,"w":272}]}},"sizes":{"large":{"h":2048,"w":2048,"resize":"fit"},"medium":{"h":1200,"w":1200,"resize":"fit"},"small":{"h":680,"w":680,"resize":"fit"},"thumb":{"h":150,"w":150,"resize":"crop"}},"original_info":{"height":4096,"width":4096,"focus_rects":[{"x":0,"y":1003,"w":4096,"h":2294},{"x":0,"y":0,"w":4096,"h":4096},{"x":0,"y":0,"w":3593,"h":4096},{"x":0,"y":0,"w":2048,"h":4096},{"x":0,"y":0,"w":4096,"h":4096}]},"media_results":{"result":{"media_key":"3_1958590078021771264"}}},{"display_url":"pic.x.com/ExVQpnEyOk","expanded_url":"https://x.com/taylorswift13/status/1958590089732264402/photo/1","id_str":"1958590078017507328","indices":[250,273],"media_key":"3_1958590078017507328","media_url_https":"https://pbs.twimg.com/media/Gy5PTITWkAAmFx8.jpg","type":"photo","url":"https://t.co/ExVQpnEyOk","ext_media_availability":{"status":"Available"},"features":{"large":{"faces":[{"x":629,"y":1013,"h":99,"w":99},{"x":1741,"y":1043,"h":123,"w":123},{"x":1003,"y":943,"h":133,"w":133}]},"medium":{"faces":[{"x":368,"y":594,"h":58,"w":58},{"x":1020,"y":611,"h":72,"w":72},{"x":588,"y":552,"h":78,"w":78}]},"small":{"faces":[{"x":208,"y":336,"h":33,"w":33},{"x":578,"y":346,"h":41,"w":41},{"x":333,"y":313,"h":44,"w":44}]},"orig":{"faces":[{"x":922,"y":1485,"h":146,"w":146},{"x":2551,"y":1529,"h":181,"w":181},{"x":1470,"y":1382,"h":196,"w":196}]}},"sizes":{"large":{"h":2048,"w":2048,"resize":"fit"},"medium":{"h":1200,"w":1200,"resize":"fit"},"small":{"h":680,"w":680,"resize":"fit"},"thumb":{"h":150,"w":150,"resize":"crop"}},"original_info":{"height":3000,"width":3000,"focus_rects":[{"x":0,"y":735,"w":3000,"h":1680},{"x":0,"y":0,"w":3000,"h":3000},{"x":0,"y":0}]}}]}}],"_note":"Response truncated for documentation purposes"}
                                                                                                                                                                                                                    
                                                                                                    

用户推文 - 代码片段


curl --location --request GET 'https://zylalabs.com/api/9795/twitter+api/18404/user+tweets?user_id=17919972' --header 'Authorization: Bearer YOUR_API_KEY' 


    

获取Twitter账户的ID


                                                                            
GET https://zylalabs.com/api/9795/twitter+api/21239/get+user+id
                                                                            
                                                                        

获取用户ID - 端点功能

对象 描述
username [必需] Enter a username
测试端点

API 示例响应

       
                                                                                                        
                                                                                                                                                                                                                                                                                                                                        {"data":{"username":"elonmusk","id":"44196397"}}
                                                                                                                                                                                                                    
                                                                                                    

获取用户ID - 代码片段


curl --location --request GET 'https://zylalabs.com/api/9795/twitter+api/21239/get+user+id?username=elonmusk' --header 'Authorization: Bearer YOUR_API_KEY' 


    

API 访问密钥和身份验证

注册后,每个开发者都会被分配一个个人 API 访问密钥,这是一个唯一的字母和数字组合,用于访问我们的 API 端点。要使用 推特 API 进行身份验证,只需在 Authorization 标头中包含您的 bearer token。
标头
标头 描述
授权 [必需] 应为 Bearer access_key. 订阅后,请查看上方的"您的 API 访问密钥"。

简单透明的定价

无长期承诺。随时升级、降级或取消。 免费试用包括最多 50 个请求。

🚀 企业版

起价
$ 10,000/年


  • 自定义数量
  • 自定义速率限制
  • 专业客户支持
  • 实时 API 监控

客户喜爱的功能

  • ✔︎ 仅支付成功请求
  • ✔︎ 7 天免费试用
  • ✔︎ 多语言支持
  • ✔︎ 一个 API 密钥,所有 API。
  • ✔︎ 直观的仪表板
  • ✔︎ 全面的错误处理
  • ✔︎ 开发者友好的文档
  • ✔︎ Postman 集成
  • ✔︎ 安全的 HTTPS 连接
  • ✔︎ 可靠的正常运行时间

推特 API FAQs

每个端点返回特定的数据类型:用户信息端点提供用户资料和互动统计;按ID获取用户数据的端点为多个用户提供详细的用户资料;关注者端点详细列出关注者的指标和资料;用户推文端点包含推文详细信息、媒体和互动属性

关键字段因端点而异:用户信息包括姓名、简历、位置和指标;通过ID的用户数据添加多个用户资料;粉丝功能包括身份、姓名、简介和粉丝指标;用户推文包括推文内容、媒体、标签和互动次数

响应数据采用JSON格式结构,每个端点返回一个特定的对象。例如,用户信息返回一个用户对象,该对象包含用于个人资料详细信息的嵌套字段,而用户推文返回一个推文对象数组,每个对象包含元数据和交互属性

每个端点支持各种参数。例如,用户信息端点可能接受用户ID,而关注者端点可以根据验证状态进行过滤。用户可以通过指定参数如用户ID或推文ID来自定义请求以获取目标数据

典型的使用案例包括品牌监测、趋势分析、影响者追踪和报告生成例如企业可以分析关注者的人口统计数据以定制营销策略或跟踪推文参与度以评估活动效果

通过直接访问推特的公共数据来维护数据的准确性,确保实时更新。API的设计通过允许用户使用用户ID等唯一标识符来检索信息,最小化歧义,增强可靠性

用户可以利用返回的数据进行洞察和分析。例如,通过分析关注者指标,企业可以识别关键影响者,而推文详情可以为内容策略提供信息。数据可以被可视化或集成到应用程序中,以增强决策制定

用户应实现错误处理以管理部分或为空的结果例如如果用户ID返回无数据API响应将指示这一点使用户能够调整查询或通知用户缺失的信息

用户信息端点提供全面的数据,包括用户的姓名、个人简介、位置、账户创建日期、验证状态、头像以及关键指标,如关注者数量、关注数量、推文数量和列表

用户可以通过指定用户ID、验证状态和分页选项等参数来自定义对Followers端点的请求,以过滤和管理返回的关注者数据量

用户推文响应包括推文内容 媒体附件 话题标签 元数据(如创建日期) 可用状态 以及互动属性如转推和点赞计数

Twitter API 涵盖来自公共 Twitter 个人资料的全球数据,允许访问来自各个地区和类别的用户信息和推文,包括个人账户、品牌和公众人物

通过ID获取用户数据的端点接受用户ID作为参数,允许用户检索一个或多个用户的详细资料。它还可以包括可选字段以指定要返回哪些数据属性

关注者端点返回一个结构化的JSON对象,其中包含一个关注者对象的数组。每个对象包括ID、姓名、简介、验证状态和个人资料图片等字段,便于访问和分析

通过直接访问推特的实时公共数据并与推特自身系统进行持续更新和验证,确保数据的准确性,最小化差异并增强可靠性

在检索用户推文时,期望每个推文对象具有一致的结构,其中包含内容、媒体、标签和互动指标的字段。模式可能包括推文发布时的时间戳和互动统计数据

一般常见问题

Zyla API Hub 就像一个大型 API 商店,您可以在一个地方找到数千个 API。我们还为所有 API 提供专门支持和实时监控。注册后,您可以选择要使用的 API。请记住,每个 API 都需要自己的订阅。但如果您订阅多个 API,您将为所有这些 API 使用相同的密钥,使事情变得更简单。

价格以 USD(美元)、EUR(欧元)、CAD(加元)、AUD(澳元)和 GBP(英镑)列出。我们接受所有主要的借记卡和信用卡。我们的支付系统使用最新的安全技术,由 Stripe 提供支持,Stripe 是世界上最可靠的支付公司之一。如果您在使用卡片付款时遇到任何问题,请通过 [email protected]


此外,如果您已经以这些货币中的任何一种(USD、EUR、CAD、AUD、GBP)拥有有效订阅,该货币将保留用于后续订阅。只要您没有任何有效订阅,您可以随时更改货币。

定价页面上显示的本地货币基于您 IP 地址的国家/地区,仅供参考。实际价格以 USD(美元)为单位。当您付款时,即使您在我们的网站上看到以本地货币显示的等值金额,您的卡片对账单上也会以美元显示费用。这意味着您不能直接使用本地货币付款。

有时,银行可能会因其欺诈保护设置而拒绝收费。我们建议您首先联系您的银行,检查他们是否阻止了我们的收费。此外,您可以访问账单门户并更改关联的卡片以进行付款。如果这些方法不起作用并且您需要进一步帮助,请通过 [email protected]

价格由月度或年度订阅决定,具体取决于所选计划。

API 调用根据成功请求从您的计划中扣除。每个计划都包含您每月可以进行的特定数量的调用。只有成功的调用(由状态 200 响应指示)才会计入您的总数。这确保失败或不完整的请求不会影响您的月度配额。

Zyla API Hub 采用月度订阅系统。您的计费周期将从您购买付费计划的那一天开始,并在下个月的同一日期续订。因此,如果您想避免未来的费用,请提前取消订阅。

要升级您当前的订阅计划,只需转到 API 的定价页面并选择您要升级到的计划。升级将立即生效,让您立即享受新计划的功能。请注意,您之前计划中的任何剩余调用都不会转移到新计划,因此在升级时请注意这一点。您将被收取新计划的全部金额。

要检查您本月剩余多少 API 调用,请参考响应标头中的 "X-Zyla-API-Calls-Monthly-Remaining" 字段。例如,如果您的计划允许每月 1,000 个请求,而您已使用 100 个,则响应标头中的此字段将显示 900 个剩余调用。

要查看您的计划允许的最大 API 请求数,请检查 "X-Zyla-RateLimit-Limit" 响应标头。例如,如果您的计划包括每月 1,000 个请求,此标头将显示 1,000。

"X-Zyla-RateLimit-Reset" 标头显示您的速率限制重置之前的秒数。这告诉您何时您的请求计数将重新开始。例如,如果它显示 3,600,则意味着还有 3,600 秒直到限制重置。

是的,您可以随时通过访问您的账户并在账单页面上选择取消选项来取消您的计划。请注意,升级、降级和取消会立即生效。此外,取消后,您将不再有权访问该服务,即使您的配额中还有剩余调用。

您可以通过我们的聊天渠道联系我们以获得即时帮助。我们始终在线,时间为上午 8 点至下午 5 点(EST)。如果您在该时间之后联系我们,我们将尽快回复您。此外,您可以通过 [email protected]

为了让您有机会在没有任何承诺的情况下体验我们的 API,我们提供 7 天免费试用,允许您免费进行最多 50 次 API 调用。此试用只能使用一次,因此我们建议将其应用于您最感兴趣的 API。虽然我们的大多数 API 都提供免费试用,但有些可能不提供。试用在 7 天后或您进行了 50 次请求后结束,以先发生者为准。如果您在试用期间达到 50 次请求限制,您需要"开始您的付费计划"以继续发出请求。您可以在个人资料中的订阅 -> 选择您订阅的 API -> 定价标签下找到"开始您的付费计划"按钮。或者,如果您在第 7 天之前不取消订阅,您的免费试用将结束,您的计划将自动计费,授予您访问计划中指定的所有 API 调用的权限。请记住这一点以避免不必要的费用。

7 天后,您将被收取试用期间订阅的计划的全额费用。因此,在试用期结束前取消很重要。因忘记及时取消而提出的退款请求不被接受。

当您订阅 API 免费试用时,您可以进行最多 50 次 API 调用。如果您希望超出此限制进行额外的 API 调用,API 将提示您执行"开始您的付费计划"。您可以在个人资料中的订阅 -> 选择您订阅的 API -> 定价标签下找到"开始您的付费计划"按钮。

付款订单在每月 20 日至 30 日之间处理。如果您在 20 日之前提交请求,您的付款将在此时间范围内处理。


相关 API


您可能还喜欢