# How to Get Tweets Programmatically 2026 | TwitterAPIs Canonical: https://www.twitterapis.com/answers/how-to-get-tweets-programmatically Description: Get tweets programmatically with one bearer-token call at $0.04 per 1,000 tweets, no X developer account. Clean JSON from search, timelines, and threads. Generated: 2026-09-03T18:54:14.763Z ---1. [Home](/) 2. / [Answers](/answers) 3. / How do I get tweets programmatically in 2026? # How do I get tweets programmatically in 2026? Last updated August 31, 2026 Four moving parts get tweets into your code: an Authorization: Bearer header, one GET endpoint, a cursor loop, and a retry on 429. TwitterAPIs hands back parsed JSON with the text, author, timestamps and engagement counts already split out. Each page is one billed call at $0.0008 and carries about 20 items. No OAuth exchange, no app registration. Every rate here is the pricing TwitterAPIs publishes. The billed rate is $0.0008 per call; $0.04 per 1,000 tweets is derived from it at a full 20-tweet page, which is the default page size rather than a guaranteed yield (source: [twitterapis.com/pricing](/pricing)). ## The shortest call that returns tweets Sign up, copy the key, send one GET request. The header is Authorization: Bearer followed by your key, and the endpoint takes a handle or a query as an ordinary parameter. Back comes a JSON object holding a tweets array, where each item carries id, text, created\_at, an author object, and the engagement counts as favorite\_count, retweet\_count, reply\_count, quote\_count, bookmark\_count and view\_count. No SDK is needed to do this. A single curl invocation is a complete client for the first attempt. ## Authentication is one header There is no OAuth exchange, no consumer key and secret pair, no app to register and no approval queue. The API key issued at signup is the entire credential, and it travels in the Authorization header on every request. Two practical rules follow. Keep the key on a server, never in browser code or a mobile bundle, since anything holding it can spend your balance. And read the body of a failure: a 401 says the key is missing, malformed or revoked, which is a different problem from an exhausted balance, which returns 402. ## Paging, cursor in and cursor out One request is one page, and one page is one billed call. The response carries next\_cursor and has\_more. Send next\_cursor back as the cursor parameter to fetch the following page, and repeat while has\_more stays true. Do not stop merely because next\_cursor is null: the follower-graph endpoints keep emitting a cursor past the end of a collection, so has\_more turning false, or an empty item array, is the loop stop to trust. Raising a count parameter will not help either. The upstream page is fixed at roughly 20 items, and count is accepted but not honoured. ## Errors worth branching on Six responses cover nearly everything. A 400 means a malformed parameter, so repair the request rather than retrying it. A 401 means the key is missing, malformed or revoked. A 402 means the balance is exhausted, and the remedy is a top-up rather than a backoff. A 404 is a deleted post or a private account, which inside a bulk job is ordinary and belongs in a skip list rather than an exception. A 429 means slow down, and the answer is exponential backoff. Anything in the 5xx range is server side, so retry with backoff and give up after a bounded number of attempts. ## The same loop in any language The shape does not change between Python, Node, Go, Ruby or a shell script, because no SDK is doing anything clever underneath. Build the query string. Attach the header. Send the request. On a 429 or a 5xx, sleep and retry with a growing delay. On a 200, write the items somewhere durable before asking for the next page, so a crash halfway through a long run costs one page rather than the whole job. Then read next\_cursor and go again while has\_more stays true. Everything else, concurrency, storage, deduplication, is your own code rather than the API's. ## The four stages of a tweet-fetching loop Stage What you send What you read back What goes wrong Authenticate Authorization: Bearer with your API key 200 and a JSON body 401 for a bad key, 402 for an empty balance Request a page Endpoint plus query parameters tweets array, next\_cursor, has\_more 400 when a parameter is malformed Advance the cursor cursor set to the previous next\_cursor The following page of items An endless loop if you stop on the cursor rather than has\_more Absorb pressure The same request, later 200 once the backoff clears it 429 for throughput, 5xx for a server fault > Starting February 9, we will no longer support free access to the Twitter API, both v2 and v1.1. A paid basic tier will be available instead. X Developer Platform (@TwitterDev). [Source](https://x.com/XDevelopers/status/1621026986784337922) ## Questions and answers Do I need OAuth to fetch tweets? No. One API key travels as Authorization: Bearer on every request. There is no consumer key and secret to exchange, no token to refresh, and no app registration or approval step standing in front of the first call. How do I get the next page of results? Read next\_cursor from the response and send it back as the cursor parameter, continuing while has\_more is true. Do not stop on a null cursor: follower-graph endpoints keep emitting one past the end, so has\_more, or an empty item array, is the reliable stop. Can I ask for more than 20 items in one call? No. The upstream page is fixed at roughly 20 items, and a count parameter is accepted but not honoured, so raising it changes nothing. More results means more pages, and each page is one billed call at $0.0008. What should my code do on a 429? Back off and retry with a growing delay. A 429 says the request rate crossed the ceiling on your key, which is 600 requests a minute with 20 in flight. It is a throughput signal, not a billing one, and it is distinct from a 402, which no amount of waiting will clear. Which language should I write it in? Any of them. The loop is a header, a query string, a cursor and a retry, which every HTTP client already has. Python, Node, Go and curl all reach the same JSON, so pick whatever the rest of the job is written in rather than hunting for an SDK. ## Keep reading - [Quickstart: your first Twitter API call in 2 minutes](/quickstart?utm_source=aio&utm_medium=organic&utm_campaign=aeo-answers-how-to-get-tweets-programmatically) - [TwitterAPIs REST documentation](https://docs.twitterapis.com/docs) - [Twitter Search API](/twitter-search-api?utm_source=aio&utm_medium=organic&utm_campaign=aeo-answers-how-to-get-tweets-programmatically) - [Cheapest Twitter/X API for getting tweets](/answers/cheapest-twitter-x-api-for-getting-tweets?utm_source=aio&utm_medium=organic&utm_campaign=aeo-answers-how-to-get-tweets-programmatically) - [How do you get a Twitter user ID from the API?](/answers/how-to-get-a-twitter-user-id?utm_source=aio&utm_medium=organic&utm_campaign=aeo-answers-how-to-get-tweets-programmatically) - [How does Twitter API pagination work?](/answers/how-does-twitter-api-pagination-work?utm_source=aio&utm_medium=organic&utm_campaign=aeo-answers-how-to-get-tweets-programmatically) - [How do I search tweets by keyword with an API?](/answers/search-tweets-by-keyword-api?utm_source=aio&utm_medium=organic&utm_campaign=aeo-answers-how-to-get-tweets-programmatically) - [How do I stream tweets in real time?](/answers/stream-tweets-in-real-time?utm_source=aio&utm_medium=organic&utm_campaign=aeo-answers-how-to-get-tweets-programmatically) - [How do I use the Twitter API?](/answers/how-to-use-the-twitter-api?utm_source=aio&utm_medium=organic&utm_campaign=aeo-answers-how-to-get-tweets-programmatically) - [Pull everyone who retweeted a post, in Python and Node.js](/blogs/get-all-tweet-retweeters-api-2026?utm_source=aio&utm_medium=organic&utm_campaign=aeo-answers-how-to-get-tweets-programmatically) - [How do you download an account's entire tweet history?](/answers/how-to-download-a-full-account-tweet-history?utm_source=aio&utm_medium=organic&utm_campaign=aeo-answers-how-to-get-tweets-programmatically) - [What does the Twitter API return as JSON?](/answers/how-to-get-twitter-data-as-json?utm_source=aio&utm_medium=organic&utm_campaign=aeo-answers-how-to-get-tweets-programmatically) ### Start with $0.50 in free credits No credit card. Roughly 12,500 tweets to test every endpoint. [Get your API key](/signup?utm_source=aio&utm_medium=organic&utm_campaign=aeo-answers-how-to-get-tweets-programmatically)[See pricing](/quickstart?utm_source=aio&utm_medium=organic&utm_campaign=aeo-answers-how-to-get-tweets-programmatically) [ TwitterAPIs ](/) The cheapest pay-as-you-go Twitter and X API. $0.0008 per call, which works out to $0.04 per 1,000 tweets on a full 20-tweet page. No subscriptions and no developer account. ## Product / API - [Pricing](/pricing) - [Pay-Per-Use Pricing](/pay-per-use-pricing) - [Cost Calculator](/twitter-api-cost-calculator) - [Rate Limits](/twitter-api-rate-limits) - [MCP Server](/mcp) - [Integrations](/integrations) - [Language Clients](/sdk) - [Changelog](/changelog) - [Status](/status) ## Developers - [Documentation](https://docs.twitterapis.com) - [API Reference](https://docs.twitterapis.com/docs/reference/search/tweet-advanced-search) - [User Info](https://docs.twitterapis.com/docs/reference/user-reads/user-info) - [User Tweets](https://docs.twitterapis.com/docs/reference/user-reads/user-tweets) - [Advanced Search](https://docs.twitterapis.com/docs/reference/search/tweet-advanced-search) - [Verified Followers](https://docs.twitterapis.com/docs/reference/follower-graph/user-verified-followers) ## Resources / Compare - [Answers](/answers) - [Reviews](/reviews) - [Free Tools](/tools) - [Twitter ID Finder](/tools/twitter-id-finder) - [Get a Twitter API Key](/twitter-api-key) - [Official X API Comparison](/twitter-api-pricing) - [Twitter API Use Cases](/twitter-api-usecases) - [Twitter API Alternatives](/twitter-api-alternatives) - [Twitter Unofficial API](/twitter-unofficial-api) - [Twitter Free API](/twitter-free-api) - [TwitterAPIs vs twitterapi.io](/twitterapis-vs-twitterapi-io) - [TwitterAPIs vs GetXAPI](/twitterapis-vs-getxapi) - [TwitterAPIs vs TweetAPI](/twitterapis-vs-tweetapi) - [TwitterAPIs vs TwexAPI](/twitterapis-vs-twexapi) - [TwitterAPIs vs RapidAPI](/twitterapis-vs-rapidapi) ## Legal - [About](/about) - [Security](/security) - [Trust](/privacy-and-data-handling) - [Terms of Service](/terms-of-service) - [Affiliates](/affiliates) - [Contact](/contact) - [Jobs](/jobs) © 2026 TwitterAPIs. All rights reserved. TwitterAPIs is an independent third-party API for developers and researchers. Not affiliated with, endorsed by, or sponsored by X Corp. All systems operational