<?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: Tay Clompson</title>
    <description>The latest articles on DEV Community by Tay Clompson (@tay_clompson_122f694e0475).</description>
    <link>https://dev.to/tay_clompson_122f694e0475</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%2F4131157%2F79cd8675-367c-4865-bc66-e59d46532791.png</url>
      <title>DEV Community: Tay Clompson</title>
      <link>https://dev.to/tay_clompson_122f694e0475</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tay_clompson_122f694e0475"/>
    <language>en</language>
    <item>
      <title>I Broke My Instagram Giveaway Picker With Rate Limits — Here’s What I Learned</title>
      <dc:creator>Tay Clompson</dc:creator>
      <pubDate>Fri, 18 Sep 2026 08:34:43 +0000</pubDate>
      <link>https://dev.to/tay_clompson_122f694e0475/i-broke-my-instagram-giveaway-picker-with-rate-limits-heres-what-i-learned-llc</link>
      <guid>https://dev.to/tay_clompson_122f694e0475/i-broke-my-instagram-giveaway-picker-with-rate-limits-heres-what-i-learned-llc</guid>
      <description>&lt;p&gt;The first version of my Instagram giveaway picker worked perfectly.&lt;/p&gt;

&lt;p&gt;Until it didn’t.&lt;/p&gt;

&lt;p&gt;The idea was simple: get the comments under a giveaway post, process them, and pick a winner. I initially handled the Instagram data collection myself because it seemed unnecessary to use another service for something that sounded this straightforward.&lt;/p&gt;

&lt;p&gt;Then requests started failing. I retried them. Some worked again. Others didn’t. Then I ran into blocks and rate limits.&lt;/p&gt;

&lt;p&gt;At some point, I realized I was spending more time trying to collect the comments than actually working on the giveaway picker.&lt;/p&gt;

&lt;p&gt;The difficult part wasn’t picking a winner&lt;/p&gt;

&lt;p&gt;Once I have the comments, the rest is fairly ordinary code.&lt;/p&gt;

&lt;p&gt;The frustrating part was reliably getting the data in the first place.&lt;/p&gt;

&lt;p&gt;Instagram obviously has good reasons to limit automated requests, but from my side that meant dealing with things like failed requests, rate limits, blocks, retries, and changes in behavior.&lt;/p&gt;

&lt;p&gt;My first instinct was to keep fixing each problem myself.&lt;/p&gt;

&lt;p&gt;That works, but I learned that there’s a difference between getting a scraper to work once and keeping it working.&lt;/p&gt;

&lt;p&gt;I moved the data collection to an API&lt;/p&gt;

&lt;p&gt;Eventually I decided I didn’t actually want to maintain the Instagram scraping layer myself.&lt;/p&gt;

&lt;p&gt;I moved that part to HikerAPI⁠￼, which provides Instagram data through a hosted REST API.&lt;/p&gt;

&lt;p&gt;A basic Python request looks like this:&lt;/p&gt;

&lt;p&gt;import requests&lt;/p&gt;

&lt;p&gt;headers = {"x-access-key": "YOUR_KEY"}&lt;/p&gt;

&lt;p&gt;user = requests.get(&lt;br&gt;
    "&lt;a href="https://api.hikerapi.com/v2/user/by/username?username=instagram" rel="noopener noreferrer"&gt;https://api.hikerapi.com/v2/user/by/username?username=instagram&lt;/a&gt;",&lt;br&gt;
    headers=headers&lt;br&gt;
).json()&lt;/p&gt;

&lt;p&gt;r = requests.get(&lt;br&gt;
    f"&lt;a href="https://api.hikerapi.com/gql/user/followers/chunk?user_id=%7Buser%5B'pk'%5D%7D" rel="noopener noreferrer"&gt;https://api.hikerapi.com/gql/user/followers/chunk?user_id={user['pk']}&lt;/a&gt;",&lt;br&gt;
    headers=headers&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;print(r.json())&lt;/p&gt;

&lt;p&gt;For my giveaway use case, the important change wasn’t writing less Python. It was removing infrastructure that I didn’t really want to maintain.&lt;/p&gt;

&lt;p&gt;Instead of spending time figuring out why Instagram rejected a particular request, I can focus on processing the data my application needs.&lt;/p&gt;

&lt;p&gt;An API doesn’t remove every problem&lt;/p&gt;

&lt;p&gt;Moving to an API doesn’t mean errors suddenly disappear.&lt;/p&gt;

&lt;p&gt;I still need to handle failed requests properly. I still need sensible retry logic. I still need to think about rate limits and what happens if the data I expect isn’t returned.&lt;/p&gt;

&lt;p&gt;And there’s obviously a financial tradeoff.&lt;/p&gt;

&lt;p&gt;HikerAPI starts at $0.001 per request and offers 100 free requests, but using a hosted service means accepting an ongoing API cost instead of trying to run everything yourself.&lt;/p&gt;

&lt;p&gt;For a large enough system, that calculation could look very different.&lt;/p&gt;

&lt;p&gt;For my use case, though, developer time was becoming the more annoying cost.&lt;/p&gt;

&lt;p&gt;The main lesson&lt;/p&gt;

&lt;p&gt;The biggest thing I learned was that building the feature and maintaining the data source are two separate problems.&lt;/p&gt;

&lt;p&gt;I wanted to build a giveaway picker.&lt;/p&gt;

&lt;p&gt;I accidentally started maintaining Instagram scraping infrastructure.&lt;/p&gt;

&lt;p&gt;There’s nothing inherently wrong with doing that yourself, and for some projects it will absolutely make sense. But in my case, outsourcing that part made the project simpler.&lt;/p&gt;

&lt;p&gt;Sometimes the code you stop maintaining is more valuable than the code you write.&lt;/p&gt;

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