<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tarun Khatri on Medium]]></title>
        <description><![CDATA[Stories by Tarun Khatri on Medium]]></description>
        <link>https://medium.com/@ttkhatri559?source=rss-cc316ff6dbfc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*g2tVvSWaPxTK6OsfnhBLJw.jpeg</url>
            <title>Stories by Tarun Khatri on Medium</title>
            <link>https://medium.com/@ttkhatri559?source=rss-cc316ff6dbfc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 13:59:44 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ttkhatri559/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Can the Grok API Search Twitter? What X Search Really Costs]]></title>
            <link>https://medium.com/@ttkhatri559/can-the-grok-api-search-twitter-what-x-search-really-costs-5a84cddd3cf1?source=rss-cc316ff6dbfc------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a84cddd3cf1</guid>
            <category><![CDATA[xai]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[twitter-api]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[xai-grok]]></category>
            <dc:creator><![CDATA[Tarun Khatri]]></dc:creator>
            <pubDate>Tue, 20 Oct 2026 17:51:11 GMT</pubDate>
            <atom:updated>2026-10-20T17:51:11.724Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Yes, with the x_search tool. Since 21 September 2026 it bills $5 per 1,000 posts, like X’s own API, and returns an answer, not the tweets.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eK6kFzMvKTAqLXVCZz41IA.png" /></figure><p>Yes. The Grok API can search X (Twitter) through a built-in tool called x_search. It charges $5 for every 1,000 posts it fetches.</p><p>That price is new. Until 21 September 2026, xAI charged per search, not per post, and most guides still quote the old rate. I build a Twitter data API, so I track these prices closely. Here’s what x_search does, what it costs now, and when another route is cheaper.</p><p><em>Disclosure: I build Weir, one of the tools compared below. I’ve kept the comparison fair, including where others beat it.</em></p><p><strong>TL;DR</strong></p><ul><li><strong>Yes, Grok can search X.</strong> The x_search tool runs keyword, semantic and user searches, and fetches threads.</li><li><strong>It bills per post now:</strong> $5 per 1,000 posts and $10 per 1,000 profiles, plus tokens.</li><li><strong>You get an answer, not data.</strong> Grok writes a reply with links to the posts it used.</li><li><strong>The old Live Search API is gone.</strong> Calls to it now fail with 410 Gone.</li><li><strong>Raw tweets cost less elsewhere.</strong> Data APIs charge 10 to 21 cents per 1,000 posts.</li></ul><h3>What can the Grok API do on X?</h3><p>The x_search tool gives Grok four ways to read X:</p><ul><li><strong>Keyword search</strong> with X’s advanced search operators, sorted by Top or Latest.</li><li><strong>Semantic search</strong>, which matches meaning instead of exact words.</li><li><strong>User search</strong>, which finds accounts by name or bio.</li><li><strong>Thread fetch</strong>, which pulls one post with its parent posts and replies.</li></ul><p>You can limit a search to up to 20 handles, or exclude up to 20, but not both at once. You can set a date range in YYYY-MM-DD format. You can also let Grok look at the images and videos in the posts it finds.</p><p>Here’s a call with OpenAI’s Python SDK, which works with xAI’s API. It’s adapted from xAI’s own docs:</p><pre>import os<br>from openai import OpenAI</pre><pre>client = OpenAI(api_key=os.getenv(&quot;XAI_API_KEY&quot;), base_url=&quot;https://api.x.ai/v1&quot;)<br>response = client.responses.create(<br>    model=&quot;grok-4.7&quot;,<br>    input=&quot;What did SpaceX post about Starship in September 2026?&quot;,<br>    tools=[{&quot;type&quot;: &quot;x_search&quot;, &quot;allowed_x_handles&quot;: [&quot;SpaceX&quot;],<br>            &quot;from_date&quot;: &quot;2026-09-01&quot;, &quot;to_date&quot;: &quot;2026-10-01&quot;}],<br>    extra_body={&quot;max_turns&quot;: 2},<br>)<br>print(response.output_text)<br>print(response.usage.model_dump()[&quot;server_side_tool_usage_details&quot;])</pre><p>The last line prints how many posts and profiles the call fetched. That’s what you pay for.</p><h3>How much does Grok’s X Search cost?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q8jmTUsasRFbKzk3q88Pzw.png" /></figure><p>Since 21 September 2026, xAI bills x_search for each item it fetches:</p><ul><li><strong>$5 per 1,000 posts,</strong> counting parent posts and quoted posts too.</li><li><strong>$10 per 1,000 profiles</strong> from user searches.</li><li><strong>Plus tokens,</strong> because Grok reads the posts and writes an answer. On grok-4.7, that’s $2 per million input tokens and $6 per million output tokens.</li></ul><p>Before that date, xAI charged $5 per 1,000 calls. So a search that returns 100 posts used to cost half a cent. Now the fetch alone costs 50 cents, 100 times more.</p><p>Two details make bills bigger than people expect:</p><ul><li><strong>Duplicates count.</strong> A post that two searches return is billed twice.</li><li><strong>One question can mean many searches.</strong> Grok may run several rounds unless you cap them with max_turns.</li></ul><h3>Do you get the tweets back?</h3><p>No. You get Grok’s answer, with numbered links like [[1]](https://x.com/…) that point to the posts it used. xAI&#39;s citation docs describe each link&#39;s URL and its place in the text. They don&#39;t describe returning a post&#39;s text, author or likes as data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IhD1lbJt9eyQaq4oTKfUhQ.png" /></figure><p>That’s fine when you want a summary, like “what are people saying about our launch?” It’s a problem when you need the posts themselves: a dataset, a dashboard, a CSV, or an alert for each new mention. For those, you need an API that returns posts as data.</p><h3>What happened to Grok’s Live Search?</h3><p>xAI retired it. The old Live Search API, set with search_parameters, now fails with &quot;410 Gone&quot;, and the error points you to the tools API.</p><p>If an old tutorial or library still sends search_parameters, switch it to the x_search or web_search tool.</p><h3>Is the Grok API free?</h3><p>No. As of October 2026, xAI’s pricing page lists no free tier for the API. You pay for tokens plus each tool’s fee. Some guides mention promotional credits for new accounts, so check console.x.ai before you count on them.</p><p>The per-post price is for the API only. Asking Grok inside the X app doesn’t use that meter.</p><h3>What about Grok Bot?</h3><p>Grok Bot is xAI’s agent product. You give it tasks in a chat, and it works through them. Since 7 October 2026, it can “search, read, and monitor X”, in xAI’s words.</p><p>It comes with SuperGrok, Cursor Pro and Cursor Teams plans, and it has its own usage limits. But it’s a teammate you message, not an API your app calls. If you’re building your own product, you still need an API.</p><h3>Grok X Search vs the X API vs a data API</h3><p>The price per post is the same for Grok and X. What you get back is not.</p><ul><li><strong>Grok API (</strong><strong>x_search):</strong> an answer with links. $5 per 1,000 posts, plus tokens. Best for questions about X inside an AI agent.</li><li><strong>Official X API:</strong> posts as data. $5 per 1,000 posts. Best for apps that also post.</li><li><strong>TwitterAPI.io:</strong> posts as data. $0.15 per 1,000 posts. Best for cheap bulk reads.</li><li><strong>Weir:</strong> posts as data, plus Reddit. $0.105 to $0.21 per 1,000 posts. Best for X and Reddit in one API or MCP server.</li></ul><p>Prices are as of October 2026.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZC2M8XfsJiIMQYkssA-b3w.png" /></figure><p>The official X API costs the same per post as x_search. But it hands you the raw posts, and it can also post. The two data APIs above read public posts for 10 to 21 cents per 1,000.</p><h3>When is Grok’s X Search the right tool?</h3><ul><li><strong>You want an answer, not a dataset.</strong> “Summarize the reactions to our launch” is one call.</li><li><strong>Your agent already runs on Grok.</strong> You skip a second API and a second bill.</li><li><strong>You need images or videos understood.</strong> x_search can look inside the media it finds.</li></ul><p>Skip it when you need every matching post, exact counts, or data you store and reuse. A data API is cheaper for that, and it returns the posts themselves.</p><h3>FAQ</h3><p><strong>Does Grok have access to all tweets?</strong> It searches public posts on X, so it can’t see DMs or posts from protected accounts. Each search returns a set of posts sorted by Top or Latest, not every post that matches.</p><p><strong>Is the Grok API cheaper than the X API for reading tweets?</strong> No. Both charge $5 per 1,000 posts, and Grok adds token costs. Grok is worth it when you want its written analysis, not just the posts.</p><p><strong>Can I use x_search with the OpenAI SDK?</strong> Yes. Set the base URL to https://api.x.ai/v1 and call responses.create with a tool of type x_search. xAI&#39;s own examples do exactly this.</p><p><strong>How do I keep X Search costs down?</strong> Name the handles you care about, set a date range and lower max_turns. Then check x_posts_fetched in each response&#39;s usage to see what the call fetched.</p><h3>The short version</h3><p>The Grok API can search Twitter, and it’s handy when you want answers about X inside an AI agent. But since 21 September 2026, it charges per post, the same as X’s own API, plus tokens. If you need the tweets themselves, a data API is the cheaper route.</p><p>If you need tweets as data, the API I built returns them as JSON from $0.105 per 1,000, with 5,000 free credits a month: <a href="https://weirapp.io/?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=grok-api-x-search">weirapp.io</a>. To estimate an official X API bill first, try my <a href="https://weirapp.io/tools/x-api-cost-calculator?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=grok-api-x-search">free X API cost calculator</a>.</p><p><em>I drafted this with an AI assistant and checked every fact against the sources below.</em></p><p><strong>Sources</strong> (checked 20 October 2026)</p><ul><li><a href="https://docs.x.ai/developers/tools/x-search">xAI: X Search docs</a></li><li><a href="https://docs.x.ai/developers/pricing">xAI: API pricing</a></li><li><a href="https://docs.x.ai/developers/models">xAI: models and pricing</a></li><li><a href="https://docs.x.ai/developers/tools/citations">xAI: citations</a></li><li><a href="https://x.ai/news/grok-bot-more-plans">xAI: Grok Bot is now included with more plans, 26 Aug 2026</a></li><li><a href="https://x.com/bot/status/2107949161878606089">@bot: “Grok Bot can now search, read, and monitor X”, 7 Oct 2026</a></li><li><a href="https://www.ventureatlas.org/news/2026-09-13-xai-x-search-pricing">Venture Atlas: xAI will bill X Search by posts fetched, 13 Sep 2026</a></li><li><a href="https://community.make.com/t/x-ai-node-integration-error-410-live-search-deprecated-switch-to-agent-tools-api/102097">Make Community: 410 Live Search deprecated</a></li><li><a href="https://help.x.com/en/using-x/about-grok">X Help Center: About Grok</a></li><li><a href="https://docs.x.com/x-api/getting-started/pricing">X API pricing</a></li><li><a href="https://twitterapi.io/pricing">TwitterAPI.io pricing</a></li><li><a href="https://weirapp.io/pricing">Weir pricing</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a84cddd3cf1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is the Twitter API Free in 2026? What You Actually Get]]></title>
            <link>https://medium.com/@ttkhatri559/is-the-twitter-api-free-in-2026-what-you-actually-get-1f6165edfc50?source=rss-cc316ff6dbfc------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f6165edfc50</guid>
            <category><![CDATA[twitter]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[xs]]></category>
            <dc:creator><![CDATA[Tarun Khatri]]></dc:creator>
            <pubDate>Mon, 19 Oct 2026 21:01:21 GMT</pubDate>
            <atom:updated>2026-10-19T21:01:21.250Z</atom:updated>
            <content:encoded><![CDATA[<p><em>No. X ended its free tier in February 2026. Here are the 4 ways that still get you tweets for $0, and the ones that stopped working.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OJbO2RvZVeJkOlA8tbb1XQ.png" /></figure><p>No. Since 6 February 2026, the X (Twitter) API has no free tier for new developers. Every post you read costs half a cent.</p><p>That surprises a lot of people, because old tutorials still say “free Twitter API” everywhere. I build a Twitter data API, so I check X’s pricing page often. Here is what’s actually free today, what each option really gives you, and which one to pick.</p><p><em>Disclosure: I build Weir, one of the tools below. I’ve kept this list fair, including where other tools beat it.</em></p><p><strong>TL;DR</strong></p><ul><li><strong>The official API isn’t free.</strong> A thousand tweets cost $5.</li><li><strong>X gives up to $70 in starter credits,</strong> but only after you buy credits.</li><li><strong>Your own tweets are free</strong> through X’s archive download.</li><li><strong>Some third-party APIs have real free tiers,</strong> from a trial to a few thousand tweets a month.</li><li><strong>Free scrapers still exist,</strong> but they need your X accounts and break often.</li></ul><h3>What happened to the free Twitter API?</h3><p>It ended in two steps.</p><p>In February 2023, Twitter put its API behind a paywall. Researchers lost free access too. The cheapest plan for them became $100 a month for 10,000 tweets.</p><p>Then on 6 February 2026, X switched to pay-per-use. You buy credits up front, and every post, profile or follower you read is taken out of them. There’s no monthly plan and no free tier for new apps. Only approved “public utility” apps keep free access.</p><h3>What does the X API cost now?</h3><p>These are X’s read prices, as of October 2026:</p><ul><li><strong>Read a post:</strong> $0.005</li><li><strong>Read a profile or follower:</strong> $0.010</li><li><strong>Read your own app’s data:</strong> $0.001</li></ul><p>So 1,000 tweets cost $5, and 100,000 cost $500.</p><p>You can still sign up without a subscription. But X blocks your requests until you buy credits, so a “free API key” can’t fetch anything on its own.</p><h3>4 ways to get Twitter data for free</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dRSj-AatzkqfvnMZKnreaw.png" /></figure><h3>1. Use X’s starter credits (up to $70, once)</h3><p>X’s free-credits page lists two offers for new pay-per-use accounts:</p><ul><li><strong>$20</strong> after your first credit purchase with a card. Since 13 October 2026, just saving a card no longer counts.</li><li><strong>Your first auto-recharge, matched,</strong> up to $50.</li></ul><p>That’s up to $70, or about 14,000 post reads. The catch: you pay first, prepaid cards don’t qualify, and the credits expire three months after you get them.</p><p><strong>Best for:</strong> projects that also need to post tweets.</p><h3>2. Download your own archive (free)</h3><p>If you only need your own tweets, skip the API.</p><p>On x.com, open <strong>Settings and privacy → Your account → Download an archive of your data</strong>. X emails you when a .zip is ready. It holds your posts, followers, following, DMs and media as JSON and HTML.</p><p><strong>Best for:</strong> analysing your own account. It never covers anyone else’s tweets.</p><h3>3. Use a third-party API’s free tier</h3><p>Several companies sell public X data through their own APIs. A few let you start for free:</p><ul><li><strong>Weir:</strong> 5,000 credits every month, no card. That’s about 4,700 tweets a month, plus Reddit on the same key.</li><li><strong>TwitterAPI.io:</strong> about $1 of trial credit, valid for 31 days. At $0.15 per 1,000 tweets, that’s roughly 6,600 tweets, once.</li><li><strong>Xpoz:</strong> 500 credits, once.</li><li><strong>ScrapeCreators:</strong> 100 free credits.</li><li><strong>Apify:</strong> its free plan runs the popular tweet scraper in demo mode only, 5 runs of 10 items.</li></ul><p>Here’s a free-tier call. It searches recent tweets with one HTTP request:</p><pre>curl https://api.weirapp.io/v1/x/search \<br>  -H &quot;Authorization: Bearer $WEIR_API_KEY&quot; \<br>  --json &#39;{&quot;query&quot;: &quot;is the twitter api free&quot;, &quot;limit&quot;: 20}&#39;</pre><p><strong>Best for:</strong> prototypes, class projects and small dashboards. These services aren’t X, so read each one’s terms before you build on it.</p><h3>4. Use an open-source scraper (free, but fragile)</h3><p>Libraries like twscrape log in as a normal X user and read what the website reads. They cost nothing.</p><p>They cost you in other ways:</p><ul><li><strong>You need logged-in X accounts.</strong> twscrape’s README says it “requires authorized X/Twitter accounts”, and X can lock them.</li><li><strong>They break</strong> whenever X changes its website. twikit hasn’t shipped a release since February 2025.</li><li><strong>X’s terms forbid it.</strong> They say you “cannot scrape the Services without X’s express written permission.”</li></ul><p><strong>Best for:</strong> throwaway research on accounts you can afford to lose.</p><h3>What no longer works</h3><ul><li><strong>Student or academic access:</strong> there’s no student tier, and free research access ended in 2023.</li><li><strong>snscrape:</strong> broken for Twitter since June 2023.</li><li><strong>Nitter:</strong> the free front end many scrapers used. Its code repository is now archived.</li><li><strong>The old Free tier:</strong> closed to new developers since February 2026.</li></ul><h3>Which free option should you pick?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WyAwbPSCYdS6gJNQ8MmB_Q.png" /></figure><ul><li><strong>You need to post tweets:</strong> the official API with its starter credits.</li><li><strong>You only need your own tweets:</strong> your X archive.</li><li><strong>You’re building a prototype or class project:</strong> a third-party free tier.</li><li><strong>You need millions of tweets:</strong> free won’t cover it. Compare paid prices per 1,000.</li></ul><h3>What it costs once you outgrow free</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sAlJAt_ZDOYVPIyJIXecNg.png" /></figure><p>At 100,000 tweets a month, the gap is wide. The official API costs $500. TwitterAPI.io is the cheapest at about $15, and it can post too. Weir is close at about $18 on its $20 pack, and adds Reddit on the same key.</p><p>The official API is still the only one run by X. If you need that, it’s worth the price. If you only read public tweets, it rarely is.</p><h3>FAQ</h3><p><strong>Is the Twitter API free for students?</strong> No. X has no student or academic tier, and free research access ended in 2023. For a class project, a third-party free tier is the cheapest legit route.</p><p><strong>How many tweets can I get for free?</strong> From X, about 14,000 post reads with the $70 starter credits, once, after you buy credits. From third-party APIs, a few thousand. Weir’s free tier covers about 4,700 tweets every month.</p><p><strong>Does X still have a Basic plan?</strong> No. X moved legacy Basic plans to pay-per-use after 1 June 2026. Basic used to cost $200 a month.</p><p><strong>Is it legal to scrape Twitter?</strong> X’s terms forbid scraping without permission, and breaking them can get your accounts locked. Whether it’s legal depends on your country and what you collect, so ask a lawyer before anything serious.</p><p><strong>What’s the cheapest Twitter API in 2026?</strong> For reading tweets, TwitterAPI.io at $0.15 per 1,000, as of October 2026. If you need to post, compare it with the official API’s $0.015 per post.</p><h3>The short version</h3><p>The official Twitter API stopped being free in 2026, but $0 tweets still exist. Use your archive for your own account, a free tier for small projects, and X’s starter credits if you need to post.</p><p>If you want to try the free tier I built, Weir gives you 5,000 credits a month with no card: <a href="https://weirapp.io/?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=is-twitter-api-free">weirapp.io</a>. For every X API rate in one place, see my <a href="https://weirapp.io/blog/x-api-pricing-2026?utm_source=medium&amp;utm_medium=article&amp;utm_campaign=is-twitter-api-free">breakdown of X API pricing in 2026</a>.</p><p><em>I drafted this with an AI assistant and checked every fact against the sources below.</em></p><p><strong>Sources</strong> (checked 19 to 20 October 2026)</p><ul><li><a href="https://docs.x.com/x-api/getting-started/pricing">X API pricing</a></li><li><a href="https://docs.x.com/x-api/getting-started/free-credits">X API free credits</a></li><li><a href="https://x.com/XDevelopers/status/2019881223666233717">@XDevelopers on the pay-per-use launch, 6 Feb 2026</a></li><li><a href="https://x.com/XDevelopers/status/2019881225587167406">@XDevelopers on Free, Basic and Pro, 6 Feb 2026</a></li><li><a href="https://x.com/XDevelopers/status/2057572111020134462">@XDevelopers on legacy Basic plans, 21 May 2026</a></li><li><a href="https://help.x.com/en/managing-your-account/how-to-download-your-x-archive">X Help Center: download your archive</a></li><li><a href="https://www.cjr.org/tow_center/qa-what-happened-to-academic-research-on-twitter.php">CJR: what happened to academic research on Twitter, Dec 2023</a></li><li><a href="https://x.com/en/tos">X Terms of Service</a></li><li><a href="https://github.com/vladkens/twscrape">twscrape</a></li><li><a href="https://pypi.org/project/twikit/">twikit on PyPI</a></li><li><a href="https://github.com/JustAnotherArchivist/snscrape/issues/996">snscrape issue #996</a></li><li><a href="https://twitterapi.io/pricing">TwitterAPI.io pricing</a></li><li><a href="https://apify.com/apidojo/tweet-scraper">Apify Tweet Scraper V2</a></li><li><a href="https://weirapp.io/pricing">Weir pricing</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f6165edfc50" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>