<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: M F</title>
    <description>The latest articles on DEV Community by M F (@m_f_ad0192e876dd88525c003).</description>
    <link>https://dev.to/m_f_ad0192e876dd88525c003</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4271831%2Fa5a1c959-bca0-42ab-96d5-7fc1bef4c0fc.jpg</url>
      <title>DEV Community: M F</title>
      <link>https://dev.to/m_f_ad0192e876dd88525c003</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/m_f_ad0192e876dd88525c003"/>
    <language>en</language>
    <item>
      <title>Building an X Shadowban Checker with twitterapi.io — endpoints, gotchas, and real costs</title>
      <dc:creator>M F</dc:creator>
      <pubDate>Sun, 29 Nov 2026 06:59:52 +0000</pubDate>
      <link>https://dev.to/m_f_ad0192e876dd88525c003/building-an-x-shadowban-checker-with-twitterapiio-endpoints-gotchas-and-real-costs-4c5m</link>
      <guid>https://dev.to/m_f_ad0192e876dd88525c003/building-an-x-shadowban-checker-with-twitterapiio-endpoints-gotchas-and-real-costs-4c5m</guid>
      <description>&lt;p&gt;Shadowban checkers all promise the same four tests: whether the account is missing from search suggestions, excluded from search, has its replies hidden in threads, or has those replies demoted behind "show more replies".&lt;/p&gt;

&lt;p&gt;I wanted to run those checks myself for an illustration account I operate (~780 followers). The first attempt used X's guest (logged-out) GraphQL surface. That worked for profile data and per-post view counts, but in the current X web build the operations behind all four checks — &lt;code&gt;SearchByRawQuery&lt;/code&gt;, &lt;code&gt;globalSearchTypeaheadQuery&lt;/code&gt;, &lt;code&gt;UserRepliesTimeline&lt;/code&gt;, &lt;code&gt;TweetDetail&lt;/code&gt; — return a bare HTTP 404 to guest sessions. Search, typeahead, and threads are simply not exposed to guests anymore.&lt;/p&gt;

&lt;p&gt;So the measurement has to come from a third-party data API. I used twitterapi.io (pay-per-result, no affiliation) and rebuilt the checker on top of it. This post is the endpoint mapping, the traps, and the measured cost.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mapping the four checks to endpoints
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Suggestion ban → user search as a proxy&lt;/strong&gt;&lt;br&gt;
There is no typeahead endpoint, so I use &lt;code&gt;GET /twitter/user/search?query=&amp;lt;handle&amp;gt;&lt;/code&gt; and check whether the account itself appears. It is a proxy for the People/typeahead surface, and I label it as such in the report.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Search ban → advanced search vs. the account's own posts&lt;/strong&gt;&lt;br&gt;
Fetch the account's recent posts, then run &lt;code&gt;GET /twitter/tweet/advanced_search?query=from:&amp;lt;handle&amp;gt;&amp;amp;queryType=Latest&lt;/code&gt; and intersect the returned IDs with the account's own recent IDs. Hits mean the posts are indexed and shown; if the account has recent posts but none of them overlap with the search results, that is the failure signal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Ghost ban → replies live under the conversation root&lt;/strong&gt;&lt;br&gt;
For each recent reply, query &lt;code&gt;GET /twitter/tweet/replies?tweetId=&amp;lt;root_id&amp;gt;&lt;/code&gt; and check that the reply appears in its thread. This is where the biggest trap was (below).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Reply deboosting → position in the thread&lt;/strong&gt;&lt;br&gt;
Using the same &lt;code&gt;/twitter/tweet/replies&lt;/code&gt; pages, if the reply only shows up on page 2+, treat it as pushed down. It is a position-based proxy, disclosed in the report.&lt;/p&gt;

&lt;p&gt;Profile and reach stats (top post vs. typical post view counts) come from &lt;code&gt;/twitter/user/info&lt;/code&gt;, &lt;code&gt;/twitter/user/last_tweets&lt;/code&gt;, and &lt;code&gt;/twitter/tweets?tweet_ids=&lt;/code&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Gotcha 1: the replies endpoint only answers for the conversation root
&lt;/h2&gt;

&lt;p&gt;My first ghost check reported that &lt;strong&gt;all three&lt;/strong&gt; of the account's recent replies were missing from their threads — a full ghost ban. That was wrong.&lt;/p&gt;

&lt;p&gt;The replies I sampled were nested: the account had replied to someone else's reply. Calling &lt;code&gt;/twitter/tweet/replies?tweetId=&amp;lt;mid-thread id&amp;gt;&lt;/code&gt; returns an &lt;strong&gt;empty list&lt;/strong&gt;, even though the reply exists. The endpoint answers for the conversation root tweet, and the root's reply list includes the nested replies.&lt;/p&gt;

&lt;p&gt;The fix is to walk &lt;code&gt;inReplyToId&lt;/code&gt; up to the root before querying (here &lt;code&gt;norm_tweets&lt;/code&gt; normalizes &lt;code&gt;inReplyToId&lt;/code&gt; to &lt;code&gt;reply_to&lt;/code&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;conversation_root&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;tweet_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;cur&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tweet_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="nb"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="c1"&gt;# cap traversal depth&lt;/span&gt;
        &lt;span class="n"&gt;ts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;norm_tweets&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tweets_by_ids&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;cur&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;ts&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;ts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"reply_to"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;
        &lt;span class="n"&gt;cur&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"reply_to"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;cur&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After this fix, all three replies were exactly where they should be — first page of their threads. (&lt;code&gt;/twitter/tweet/thread_context&lt;/code&gt; also resolves nested threads and works as a fallback.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Gotcha 2: retweets poison your view counts
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;last_tweets&lt;/code&gt; includes retweets, and a retweet carries the &lt;strong&gt;original tweet's&lt;/strong&gt; &lt;code&gt;viewCount&lt;/code&gt;. One retweet of a popular post made my "top post" stat jump to 12,766 views on an account whose own posts get a few hundred. Exclude anything with &lt;code&gt;isRetweet&lt;/code&gt; / &lt;code&gt;retweeted_tweet&lt;/code&gt; set before computing reach stats.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gotcha 3: parameter naming varies by endpoint
&lt;/h2&gt;

&lt;p&gt;Copy parameter names verbatim from the docs — do not normalize them: &lt;code&gt;/twitter/tweets&lt;/code&gt; takes &lt;code&gt;tweet_ids&lt;/code&gt; (snake_case), while &lt;code&gt;/twitter/tweet/replies&lt;/code&gt; takes &lt;code&gt;tweetId&lt;/code&gt; (camelCase). Response envelopes vary too — some endpoints wrap in &lt;code&gt;data&lt;/code&gt;, others are flat &lt;code&gt;{tweets, has_next_page, next_cursor}&lt;/code&gt;. I wrote one tolerant extractor that looks for the list under either shape.&lt;/p&gt;

&lt;h2&gt;
  
  
  Gotcha 4: the free tier rate limit is 1 request per 5 seconds
&lt;/h2&gt;

&lt;p&gt;Back-to-back calls return HTTP 429 with &lt;code&gt;For free-tier users, the QPS limit is one request every 5 seconds&lt;/code&gt;. Space your calls (~5.3s) and back off on 429 instead of hammering. A full check takes about 90 seconds at that pace, which is fine for a daily job.&lt;/p&gt;

&lt;h2&gt;
  
  
  What one full check costs (measured)
&lt;/h2&gt;

&lt;p&gt;A complete run for one account — profile, one page of recent activity, user search, advanced search, root resolution and thread scans for three replies — came out to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;13 API calls, 104 returned items&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;$0.0156 per check&lt;/strong&gt; at $0.00015 per returned item&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run daily for 30 days that is roughly &lt;strong&gt;$0.47 per account&lt;/strong&gt;. The signup bonus (10,000 credits) covered my first several full runs, including all the failed experiments above. For comparison, the official X API charges $0.005 per post read on its pay-per-use plan — about 33× more per post read.&lt;/p&gt;

&lt;h2&gt;
  
  
  Result
&lt;/h2&gt;

&lt;p&gt;With the root-resolution fix in, the checker agrees with Shadowban Radar (the reference site I was replicating) on this clean account: all four checks pass — including the two proxy checks — and the reach numbers land in the same range (top post 406 views vs. their 396, typical post 202 vs. their 180, measured at slightly different times).&lt;/p&gt;

&lt;p&gt;The main takeaway from the ghost-ban false alarm is simple: &lt;strong&gt;a missing reply is a data-model question before it is a moderation conclusion&lt;/strong&gt;. If your checker queries threads by the wrong tweet ID, it will "detect" bans that do not exist. Verify the measurement path against a thread you can inspect by hand before trusting any verdict — positive or negative.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Disclosure: this post was submitted to twitterapi.io's community rewards program, and I may receive API credits for it. If you want to try the API yourself, here is my referral link: &lt;a href="https://twitterapi.io/?ref=205tya2u" rel="noopener noreferrer"&gt;https://twitterapi.io/?ref=205tya2u&lt;/a&gt; — if you later move to a paid plan, I may receive an affiliate reward.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>twitter</category>
      <category>api</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
