+X (Twitter) API
Public X (Twitter) profiles, recent tweets, highlights, communities and video transcripts as JSON, without an X developer account.
The API.SH X API, still searched as the Twitter API, returns public X data as JSON. A profile gives name, bio, location, website, join date, follower, following, tweet, like and media counts, verification type and pinned tweet ids. An account's recent tweets and its profile highlights come with text, language, likes, retweets, replies, quotes, bookmarks and views, plus hashtags, mentions, links, media and the tweet each one replies to or quotes. One tweet can be read by URL or id, with media, card and edit history, and the video in a post can be turned into a timestamped transcript with its video variants. Communities return name, description, member count, rules, moderators and trending hashtags, and the community's tweets have their own route.
- 7 endpoints
- from $1 / 1,000 calls
- 1,000 free credits / month
- failed calls free
GET https://api.api.sh/twitter/v1/ profile
{"id": "11348282","username": "NASA","name": "NASA","url": "https://x.com/NASA","bio": "Making the seemingly impossible, possible. ✨","location": "Pale Blue Dot","website": "http://www.nasa.gov/","created_at": "Wed Dec 19 20:20:32 +0000 2007","followers": 92290430,"following": 115,"tweets": 74490,"likes": 17060,"media": 28224,"listed": null,"verified": true,"verified_type": "Government","avatar": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg","banner": "https://pbs.twimg.com/profile_banners/11348282/1788992290","protected": false,"pinned_tweet_ids": [],"birthdate": "1958-10-1","avatar_original": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB.jpg","bio_urls": [],"website_display": "nasa.gov","website_short_url": "https://t.co/9NkQJKAnuU","media_tweets": 28224,"graphql_id": "VXNlcjoxMTM0ODI4Mg==","profile_image_shape": "Square","bio_language": "en","verified_legacy": false,"identity_verified": false,"verified_since": "2009-08-07T19:53:50.941Z","verification_reason": "This account is verified because it is a government or multilateral organization account. Learn more","affiliate_label": null,"business_affiliates": 85,"highlighted_tweets": 289,"creator_subscriptions": 0,"parody_label": null,"possibly_sensitive": false,"professional": null,"…": "6 more fields","cached": false,"credits_used": 1} What you can build with the X (Twitter) API
Account monitoring
Log follower, following and tweet counts from /twitter/v1/profile every day, and pull new posts with /twitter/v1/user/tweets (count, cursor) to track what a brand, newsroom or competitor publishes and how each post performs.
Post-level reporting
/twitter/v1/tweet takes a post URL and returns its likes, replies, author details, media, links and edit history, so earned-media and campaign reports can show the numbers behind each link a client sends.
Video to text
/twitter/v1/tweet/transcript transcribes the video in a post into text with timed segments and returns the MP4 variants by bitrate, for quoting clips, captioning or passing them to an LLM.
Community research
/twitter/v1/community gives member count, rules, join policy and trending hashtags, and /twitter/v1/community/tweets returns the posts, to study niche groups around crypto, gaming or developer tools.
Creator checks before a sponsorship
Read the posts a creator chose to feature with /twitter/v1/user/highlights, along with verified_type, affiliate label and follower count from the profile, before you agree a paid post.
X (Twitter) data you get
Field names from real responses. Numbers come parsed, URLs absolute, dates in ISO 8601.
X (Twitter) API endpoints and prices
Every X (Twitter) endpoint costs 1 credit per call: credits are $1 per 1,000 on a monthly plan, $2 pay-as-you-go. Pricing
| X profile /twitter/ | $1 · $2 PAYG 1 credit |
| X user highlights /twitter/ | $1 · $2 PAYG 1 credit |
| X user tweets /twitter/ | $1 · $2 PAYG 1 credit |
| X community tweets /twitter/ | $1 · $2 PAYG 1 credit |
| One tweet /twitter/ | $1 · $2 PAYG 1 credit |
| X video transcript /twitter/ | $1 · $2 PAYG 1 credit |
| X community /twitter/ | $1 · $2 PAYG 1 credit |
Call the X (Twitter) API
X profile: GET https://api.api.sh/twitter/
curl "https://api.api.sh/twitter/v1/profile?username=nasa" \
-H "x-api-key: $APISH_KEY" import os, requests
res = requests.get(
"https://api.api.sh/twitter/v1/profile",
params={"username": "nasa"},
headers={"x-api-key": os.environ["APISH_KEY"]},
timeout=120,
)
res.raise_for_status()
data = res.json() const url = new URL("https://api.api.sh/twitter/v1/profile");
url.searchParams.set("username", "nasa");
const res = await fetch(url, { headers: { "x-api-key": process.env.APISH_KEY } });
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
const data = await res.json(); # Google Sheets (API.SH add-on)
=APISH("/twitter/v1/profile", "username", "nasa")
# Zapier, Make, n8n (verified node): pick the API.SH app,
# choose "X (Twitter)" and "X profile".
# AI agents (Claude, ChatGPT, Cursor): add the
# API.SH MCP server https://api.sh/mcp - Create a free accountConfirm your email and get 1,000 free credits every month. No card needed.
- Create an API keyOne key works for all 918 platforms.
- Send the requestJSON back in one call. Add
output=csvoroutput=ndjsonfor files.
Why API.SH for X (Twitter) data
- Public data only: no X (Twitter) login, cookies or account needed
- One key and one response shape for X (Twitter) and 917 other platforms
- Built and maintained by API.SH, not third-party publishers
- Pay per call; errors on our side cost nothing
- No rate limits: run as many calls in parallel as you need
- Live status for every endpoint
API.SH vs the official X (Twitter) API
X's official API (formerly the Twitter API) needs a developer account, a project and app keys, and reading posts is billed under X's paid access, whose plans and prices X has changed several times. API.SH needs no X developer account and bills public profile and tweet reads from your API.SH balance.
Open-source Twitter scrapers such as snscrape stopped working when X changed its site, and tools like twscrape need X accounts to sign in with; Apify's Twitter actors are priced per result. API.SH covers public profiles, recent tweets, tweets by URL and communities from one key.
X (Twitter) API questions
What X (Twitter) data can I get?+
Profiles: /twitter/v1/profile with counts, bio, website and verification. Tweets: an account's recent tweets (/twitter/v1/user/tweets), its profile highlights, any single tweet by URL or id, and a transcript of a tweet's video. Communities: details and rules (/twitter/v1/community) and the community's tweets. Keyword search, follower lists and likes are not part of the X routes.
How much does the X API cost here?+
Every X (Twitter) endpoint costs 1 credit per call. On a monthly plan 1,000 credits cost $1 (Starter is $50/month for 50,000 credits). Pay-as-you-go is $2 per 1,000 credits, with top-ups from $15 that never expire.
Is there a free Twitter API?+
Yes. Every account gets 1,000 free credits every month. That is 1,000 calls to /twitter/v1/community at 1 credit each.
Is there an official X API?+
Yes. X runs the X API (v2) through its developer portal. You need a developer account and app keys, and read access is paid; X has revised its plans and prices several times, so check its developer site for current terms. API.SH is an alternative for reading public profiles and tweets with one key and no X app.
How do I get an X (Twitter) API key?+
From X, you sign up in the developer portal, create a project and app, and generate keys and a bearer token. For the public data on this page you only need an API.SH key: sign up at api.sh and copy it from the dashboard.
Do I need an X account to use it?+
No. You never sign in to X, and nothing is posted, liked or followed. Protected accounts and anything X hides from logged-out visitors are not returned.
How many tweets can I get from a user?+
/twitter/v1/user/tweets returns the recent tweets X serves to logged-out visitors, in pages sized with count; pass next_cursor back as cursor. It is not a full archive of an account's older posts.
Can I get the transcript of an X video?+
Yes. /twitter/v1/tweet/transcript with the post URL returns the spoken text, timed segments, language and duration, plus the MP4 variants of the video by bitrate.
Can I use the X API from Python?+
Yes. GET https://api.api.sh/twitter/v1/user/tweets?username=nasa&count=20 with the x-api-key header, through the Python SDK or requests; there are no OAuth signatures or bearer tokens.
How do I get started?+
Sign up at api.sh, copy your key, then open /twitter/v1/profile?username=nasa. The full reference is at https://api.sh/docs, and the JS and Python SDKs, Google Sheets, Zapier, Make, n8n and the MCP server at https://api.sh/mcp all call the same X routes.
Does the X (Twitter) API have a rate limit?+
No. API.SH puts no rate limit on your key: send as many X (Twitter) calls in parallel as you need and pay only for the calls that run. If X (Twitter) itself slows down, the call returns 503 with a retry-after header and is not charged.