<?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: Mahendhar Seelam</title>
    <description>The latest articles on DEV Community by Mahendhar Seelam (@mahendhar2004).</description>
    <link>https://dev.to/mahendhar2004</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%2F4229395%2Fb79d6314-f1fa-4179-88c8-1976aed5d591.jpg</url>
      <title>DEV Community: Mahendhar Seelam</title>
      <link>https://dev.to/mahendhar2004</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mahendhar2004"/>
    <language>en</language>
    <item>
      <title>Monthly Instagram Reports for SMM Clients</title>
      <dc:creator>Mahendhar Seelam</dc:creator>
      <pubDate>Thu, 05 Nov 2026 23:21:31 +0000</pubDate>
      <link>https://dev.to/mahendhar2004/monthly-instagram-reports-for-smm-clients-1ak7</link>
      <guid>https://dev.to/mahendhar2004/monthly-instagram-reports-for-smm-clients-1ak7</guid>
      <description>&lt;p&gt;It was the last working day of the month, the day I send my clients their Instagram reports. I had a coffee, a half-finished report and a script that had worked fine the previous month. Then it died on a login challenge, and I spent the next hour re-authenticating an account instead of sending anything. I'm a freelance social media manager who writes just enough Python to get into trouble, and that hour was when I started asking whether I should be maintaining this at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  The job
&lt;/h2&gt;

&lt;p&gt;Once a month I pull stats for each client's account (followers, recent posts, how the posts did) and turn them into a report. The volume is small, but the deadline is real and the numbers have to be right, because clients read them.&lt;/p&gt;

&lt;h2&gt;
  
  
  instagrapi: what it's good at
&lt;/h2&gt;

&lt;p&gt;I used &lt;a href="https://github.com/subzeroid/instagrapi" rel="noopener noreferrer"&gt;instagrapi&lt;/a&gt; first, and I'd still recommend it in the right situation. It's free, it's well maintained, and it gives you a lot of control. For a hobby project or a one-off script it's hard to beat.&lt;/p&gt;

&lt;p&gt;My problems were all around the login:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It works through a logged-in account, so I had to manage sessions.&lt;/li&gt;
&lt;li&gt;When Instagram flagged the session, I got challenges and, once, a locked account.&lt;/li&gt;
&lt;li&gt;I never felt safe using an account that mattered for client work.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of that is the library's fault. It's how that approach works.&lt;/p&gt;

&lt;h2&gt;
  
  
  The hosted API route
&lt;/h2&gt;

&lt;p&gt;I moved the collection step to &lt;a href="https://hikerapi.com/instagrapi-alternative?utm_source=devto&amp;amp;utm_medium=rewards" rel="noopener noreferrer"&gt;HikerAPI&lt;/a&gt;, a hosted REST API. You send your key in an &lt;code&gt;x-access-key&lt;/code&gt; header and call an endpoint. It's pay-per-request, starting at about $0.001 per request, and there are 100 free requests to try it. I used those to compare the output with what I see in the app before changing anything.&lt;/p&gt;

&lt;p&gt;Here is the call for one profile:&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;r&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&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;params&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;username&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;nike&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;r&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;That's the whole login flow: there isn't one. My report script went from managing sessions and retries to looping over a list of usernames and saving each response to a file, so a failed run only re-fetches what's missing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Side by side
&lt;/h2&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;Hosted API&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Upfront cost&lt;/td&gt;
&lt;td&gt;Free&lt;/td&gt;
&lt;td&gt;Free tier to test&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ongoing cost&lt;/td&gt;
&lt;td&gt;Accounts, maybe proxies, your time&lt;/td&gt;
&lt;td&gt;Per request&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Login/session handling&lt;/td&gt;
&lt;td&gt;You&lt;/td&gt;
&lt;td&gt;Provider&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Ban or lock risk&lt;/td&gt;
&lt;td&gt;On your account&lt;/td&gt;
&lt;td&gt;Not on your accounts&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Control over how data is fetched&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Setup effort&lt;/td&gt;
&lt;td&gt;Medium&lt;/td&gt;
&lt;td&gt;Low&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dependency&lt;/td&gt;
&lt;td&gt;The library and Instagram&lt;/td&gt;
&lt;td&gt;The provider's uptime&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  When I'd pick each
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Use instagrapi if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you want full control and are happy to maintain sessions,&lt;/li&gt;
&lt;li&gt;you're doing a hobby project or a one-off,&lt;/li&gt;
&lt;li&gt;you have throwaway accounts and proxies already.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use a hosted API if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you have a deadline (mine is monthly) and can't afford a broken run,&lt;/li&gt;
&lt;li&gt;you don't want a real account tied to the job,&lt;/li&gt;
&lt;li&gt;your volume is low enough that per-request pricing beats paying for idle infrastructure.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What to watch for
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cost at scale.&lt;/strong&gt; Per-request pricing is cheap for a few clients. If you pull a very large number of records, do the math first.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Correctness.&lt;/strong&gt; Spot-check results against the app before sending a report to a client. That applies to any source, including your own scraper.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dependency.&lt;/strong&gt; If the provider goes down, so does your pipeline. I keep the saved responses from each run as a fallback.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where I ended up
&lt;/h2&gt;

&lt;p&gt;For my use, small and deadline-driven, the hosted API removed the part that kept breaking. If you're a developer who enjoys controlling every layer, or you run a lot of accounts yourself, instagrapi may still be the better fit.&lt;/p&gt;

&lt;p&gt;Disclosure: the provider offers free credits for write-ups like this one, so weigh my opinion accordingly. The comparison above comes from what I actually ran into.&lt;/p&gt;

&lt;p&gt;What's your setup for recurring Instagram reports? Still running your own, or have you handed it off?&lt;/p&gt;

</description>
      <category>automation</category>
      <category>freelance</category>
      <category>python</category>
      <category>socialmedia</category>
    </item>
  </channel>
</rss>
