<?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: Алексей Русаков</title>
    <description>The latest articles on DEV Community by Алексей Русаков (@__c8f1377d7).</description>
    <link>https://dev.to/__c8f1377d7</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%2F4091045%2Fc552a773-ba7a-4868-9a06-680dddd63511.png</url>
      <title>DEV Community: Алексей Русаков</title>
      <link>https://dev.to/__c8f1377d7</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/__c8f1377d7"/>
    <language>en</language>
    <item>
      <title>What a browser cannot do, and what that costs — notes from building a small paid lookup tool</title>
      <dc:creator>Алексей Русаков</dc:creator>
      <pubDate>Sun, 23 Aug 2026 16:36:49 +0000</pubDate>
      <link>https://dev.to/__c8f1377d7/what-a-browser-cannot-do-and-what-that-costs-notes-from-building-a-small-paid-lookup-tool-4f3j</link>
      <guid>https://dev.to/__c8f1377d7/what-a-browser-cannot-do-and-what-that-costs-notes-from-building-a-small-paid-lookup-tool-4f3j</guid>
      <description>&lt;p&gt;I spent a week building a small paid tool. The idea is boring on purpose: you type a&lt;br&gt;
public Instagram handle, and you get the two lists that profile already shows to&lt;br&gt;
anyone — who it follows and who follows it — complete, ordered, exportable.&lt;/p&gt;

&lt;p&gt;Nothing about that is secret. Anyone can open the app and scroll. The product is not&lt;br&gt;
access, it is &lt;strong&gt;completeness&lt;/strong&gt;: a few hundred names do not fit in a human head, and the&lt;br&gt;
app gives you no way to search them or keep them.&lt;/p&gt;

&lt;p&gt;What I did not expect was how much of the week went into things that have nothing to do&lt;br&gt;
with the feature itself.&lt;/p&gt;
&lt;h2&gt;
  
  
  The wall I hit on day one
&lt;/h2&gt;

&lt;p&gt;My first instinct was the obvious one: the visitor is already logged into Instagram in&lt;br&gt;
that same browser, so let the page read the data and be done with it.&lt;/p&gt;

&lt;p&gt;That does not work, and it cannot work. Session cookies on that domain are &lt;code&gt;HttpOnly&lt;/code&gt;,&lt;br&gt;
so no JavaScript can read them, and the Same-Origin Policy stops my domain from sending&lt;br&gt;
authenticated requests to theirs. This is not a gap to be clever about — it is the&lt;br&gt;
boundary the whole web security model is built on.&lt;/p&gt;

&lt;p&gt;That leaves three real options:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Ship a browser extension.&lt;/strong&gt; Extensions get host permissions, so they can do what a
page cannot. This works — it is exactly how the popular tools in this niche operate.
But then your "website" is an extension, and the install step kills most of your
funnel.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run your own logged-in accounts server-side.&lt;/strong&gt; I tried. Within a day the account
got flagged for automated behaviour. Burning accounts is a business, and it is not
the business I wanted.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Buy the data from someone who does option 2 professionally.&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I went with the third and used &lt;a href="https://hikerapi.com" rel="noopener noreferrer"&gt;hikerapi.com&lt;/a&gt;. One header, one&lt;br&gt;
GET, no session to babysit:&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="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;
&lt;span class="n"&gt;headers&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;x-access-key&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;YOUR_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;resp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.hikerapi.com/v2/user/by/username?username=nasa&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;resp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You get 100 requests free to check whether the shape of the data fits your product&lt;br&gt;
before paying anything, which is how I confirmed the ordering question below.&lt;/p&gt;
&lt;h2&gt;
  
  
  Why not instagrapi?
&lt;/h2&gt;

&lt;p&gt;This is the fork in the road for anyone in this space, so let me be concrete rather than&lt;br&gt;
diplomatic.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/subzeroid/instagrapi" rel="noopener noreferrer"&gt;instagrapi&lt;/a&gt; is excellent, and I read its source&lt;br&gt;
while working on this — it is the clearest documentation of Instagram's private API that&lt;br&gt;
exists. If you are doing research, automating your own account, or building something&lt;br&gt;
internal, use it. It is free and it works.&lt;/p&gt;

&lt;p&gt;The catch is the same one option 2 above: &lt;strong&gt;instagrapi needs an Instagram account, and&lt;br&gt;
that account is yours.&lt;/strong&gt; Every request carries your session. The library cannot change&lt;br&gt;
that — it is a client, not a proxy pool. For a personal script that runs a few times a&lt;br&gt;
day, fine. For a public product where strangers trigger scans at unpredictable times, you&lt;br&gt;
are volunteering an account for slaughter, and then a second, and then a third.&lt;/p&gt;

&lt;p&gt;The tradeoff is honest and it is not free:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;instagrapi&lt;/th&gt;
&lt;th&gt;Paid API&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cost&lt;/td&gt;
&lt;td&gt;free&lt;/td&gt;
&lt;td&gt;per request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Account risk&lt;/td&gt;
&lt;td&gt;yours&lt;/td&gt;
&lt;td&gt;theirs&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Session handling&lt;/td&gt;
&lt;td&gt;you own it&lt;/td&gt;
&lt;td&gt;none&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Proxies&lt;/td&gt;
&lt;td&gt;you arrange them&lt;/td&gt;
&lt;td&gt;included&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Control&lt;/td&gt;
&lt;td&gt;total&lt;/td&gt;
&lt;td&gt;whatever the endpoints expose&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That last row is real. You give something up: a library gives you every parameter the&lt;br&gt;
private API accepts, while a provider exposes the subset it chose to wrap. I ran into&lt;br&gt;
this — there is a sort-order parameter documented in instagrapi's source that the&lt;br&gt;
provider does not surface. For my use case it did not matter. For yours it might, and&lt;br&gt;
that is worth checking &lt;strong&gt;before&lt;/strong&gt; you build.&lt;/p&gt;

&lt;p&gt;So: not "instagrapi is worse". It is "whose account absorbs the risk", and once you are&lt;br&gt;
charging strangers money, that question answers itself.&lt;/p&gt;
&lt;h2&gt;
  
  
  The three things I wish I had known on day one
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Per-request and per-result pricing differ by two orders of magnitude
&lt;/h3&gt;

&lt;p&gt;This was the single biggest number in the whole project, and I nearly missed it.&lt;/p&gt;

&lt;p&gt;Some providers bill &lt;strong&gt;per result&lt;/strong&gt; — you pay for every row you pull. Others bill &lt;strong&gt;per&lt;br&gt;
request&lt;/strong&gt;, and one request returns a page of many rows. For a profile with a few&lt;br&gt;
thousand entries, the same data costs a couple of cents under one model and several&lt;br&gt;
dollars under the other.&lt;/p&gt;

&lt;p&gt;Work out your unit cost before you pick anything. Mine came out to roughly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;requests ≈ (followers + following) / page_size + 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two extra calls because I read the profile before and after the scan and refuse to save&lt;br&gt;
a snapshot if the counts moved — a half-collected list is worse than no list.&lt;/p&gt;

&lt;h3&gt;
  
  
  Not all endpoints returning "the same data" are the same
&lt;/h3&gt;

&lt;p&gt;The provider exposes several endpoint families that all return follower lists. They are&lt;br&gt;
not interchangeable. They differ in page size, in what a single call costs you, and —&lt;br&gt;
the part that actually mattered for my product — in the &lt;strong&gt;order&lt;/strong&gt; the rows come back.&lt;/p&gt;

&lt;p&gt;I tested them against what the app itself shows before writing a line of product code.&lt;br&gt;
That afternoon of comparing outputs saved me from building the whole thing on the wrong&lt;br&gt;
one and discovering it after launch.&lt;/p&gt;

&lt;h3&gt;
  
  
  Check the balance endpoint before long jobs
&lt;/h3&gt;

&lt;p&gt;Buried in the API docs is a &lt;code&gt;/sys/balance&lt;/code&gt; call that is &lt;strong&gt;not billed&lt;/strong&gt;. It returns how&lt;br&gt;
many requests you have left.&lt;/p&gt;

&lt;p&gt;I learned its value the hard way: a scan died a third of the way through because the&lt;br&gt;
balance ran out mid-job. Those requests were spent and produced nothing — the worst&lt;br&gt;
possible outcome. Now nothing long starts without a free balance check first, and if the&lt;br&gt;
remaining budget is smaller than the job needs, the user is told before anything is&lt;br&gt;
charged rather than after.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest limitation
&lt;/h2&gt;

&lt;p&gt;There is one thing people ask for constantly and no provider can deliver: &lt;strong&gt;the date&lt;br&gt;
someone followed someone.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It does not exist. Not in the private mobile API, not in the web GraphQL, not in Meta's&lt;br&gt;
official Graph API. The lists come back in a meaningful order, and that is all the&lt;br&gt;
information there is. Any product showing you "followed on March 14" invented that date.&lt;/p&gt;

&lt;p&gt;I put that in the FAQ instead of quietly hoping nobody notices. It is the kind of thing&lt;br&gt;
that turns into refund requests if you let people assume otherwise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Was it worth it?
&lt;/h2&gt;

&lt;p&gt;The engineering was two days. The rest of the week went to the offer document, the&lt;br&gt;
privacy policy, the payment provider's requirements, and a legal tax regime detail that&lt;br&gt;
turned out to remove an entire dependency I had budgeted for.&lt;/p&gt;

&lt;p&gt;If you are building something small and paid on top of someone else's data: budget for&lt;br&gt;
that half, not for the feature. The feature is the easy part.&lt;/p&gt;

&lt;p&gt;What surprised you most in your last "small" project?&lt;/p&gt;

</description>
      <category>python</category>
      <category>api</category>
      <category>webscraping</category>
    </item>
  </channel>
</rss>
