<?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: prodkit-labs</title>
    <description>The latest articles on DEV Community by prodkit-labs (@prodkit).</description>
    <link>https://dev.to/prodkit</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3920335%2F5c6eb37d-5a4b-4258-bdd4-08c01b7a60f6.png</url>
      <title>DEV Community: prodkit-labs</title>
      <link>https://dev.to/prodkit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prodkit"/>
    <language>en</language>
    <item>
      <title>Build an Instagram Competitor Report Generator with Python</title>
      <dc:creator>prodkit-labs</dc:creator>
      <pubDate>Fri, 08 May 2026 15:39:53 +0000</pubDate>
      <link>https://dev.to/prodkit/build-an-instagram-competitor-report-generator-with-python-28hf</link>
      <guid>https://dev.to/prodkit/build-an-instagram-competitor-report-generator-with-python-28hf</guid>
      <description>&lt;p&gt;Most social media reporting workflows start the same way:&lt;/p&gt;

&lt;p&gt;Someone opens a few competitor profiles, checks recent posts, copies links into a spreadsheet, guesses which Reels performed best, and turns everything into a weekly report.&lt;/p&gt;

&lt;p&gt;That works once.&lt;/p&gt;

&lt;p&gt;It becomes painful when you want to do it every week.&lt;/p&gt;

&lt;p&gt;So I built a small open-source Python starter that turns public Instagram-style data into repeatable competitor intelligence reports.&lt;/p&gt;

&lt;p&gt;The project is here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/prodkit-labs/instagram-competitor-intelligence" rel="noopener noreferrer"&gt;https://github.com/prodkit-labs/instagram-competitor-intelligence&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is intentionally not an Instagram bot, not a login automation tool, and not an API wrapper.&lt;/p&gt;

&lt;p&gt;It is a reporting workflow.&lt;/p&gt;

&lt;p&gt;The goal is simple:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Take public profile and media data, rank what performed well, extract useful patterns, and generate a weekly competitor report.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What the project does
&lt;/h2&gt;

&lt;p&gt;The current version can help you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;compare public competitor accounts&lt;/li&gt;
&lt;li&gt;rank recent posts and Reels by engagement&lt;/li&gt;
&lt;li&gt;extract hashtag trends from captions&lt;/li&gt;
&lt;li&gt;detect creator, influencer, and brand mentions&lt;/li&gt;
&lt;li&gt;export CSV-friendly metrics&lt;/li&gt;
&lt;li&gt;generate weekly Markdown and HTML reports&lt;/li&gt;
&lt;li&gt;run with mock data before connecting any real provider&lt;/li&gt;
&lt;li&gt;schedule reports with GitHub Actions or cron&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The most important design decision was this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The project runs with mock data first.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That means you can try the full workflow without needing an API key, a provider account, or any production setup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why mock data first?
&lt;/h2&gt;

&lt;p&gt;A lot of public-data projects fail at the first step because the user has to configure credentials before seeing any value.&lt;/p&gt;

&lt;p&gt;I wanted the opposite.&lt;/p&gt;

&lt;p&gt;You should be able to clone the repo, run one command, and immediately see the report structure.&lt;/p&gt;

&lt;p&gt;Mock data is useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;understanding the workflow&lt;/li&gt;
&lt;li&gt;testing the report generator&lt;/li&gt;
&lt;li&gt;checking the metrics&lt;/li&gt;
&lt;li&gt;reviewing the output format&lt;/li&gt;
&lt;li&gt;deciding whether the project fits your use case&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Only after that should you think about production data providers, scheduling, caching, cost control, and monitoring.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Start
&lt;/h2&gt;

&lt;p&gt;Clone the repo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/prodkit-labs/instagram-competitor-intelligence.git
&lt;span class="nb"&gt;cd &lt;/span&gt;instagram-competitor-intelligence
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a virtual environment:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv .venv
&lt;span class="nb"&gt;source&lt;/span&gt; .venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install dependencies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generate a sample weekly report with mock data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 examples/06_generate_weekly_report.py &lt;span class="nt"&gt;--mock&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The generated reports will be written to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reports/sample_weekly_report.md
reports/sample_weekly_report.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That is the fastest way to see the end-to-end workflow.&lt;/p&gt;

&lt;h2&gt;
  
  
  The basic workflow
&lt;/h2&gt;

&lt;p&gt;The reporting pipeline looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public account data
        ↓
recent posts and Reels
        ↓
engagement metrics
        ↓
hashtag extraction
        ↓
creator / brand mention detection
        ↓
competitor comparison
        ↓
weekly Markdown / HTML report
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The repo is organized around small examples instead of one large application.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;examples/01_get_profile.py
examples/02_get_recent_media.py
examples/03_rank_top_reels.py
examples/04_extract_hashtags.py
examples/05_compare_competitors.py
examples/06_generate_weekly_report.py
examples/07_export_csv.py
examples/08_schedule_with_github_actions.md
examples/09_extract_creator_mentions.py
examples/10_estimate_api_cost.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can run the full report workflow, or just inspect one piece at a time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calculating engagement rate
&lt;/h2&gt;

&lt;p&gt;For a simple competitor report, I usually start with a basic engagement rate:&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="n"&gt;engagement_rate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;like_count&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;comment_count&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;follower_count&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is not perfect.&lt;/p&gt;

&lt;p&gt;It does not account for reach, saves, shares, story views, or platform-specific ranking behavior.&lt;/p&gt;

&lt;p&gt;But it is useful for comparing public posts across competitor accounts when you only have public-facing metrics.&lt;/p&gt;

&lt;p&gt;For the first version of the project, I care more about a repeatable metric than a perfect metric.&lt;/p&gt;

&lt;p&gt;A weekly report does not need to answer every question.&lt;/p&gt;

&lt;p&gt;It needs to help you spot patterns.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the report includes
&lt;/h2&gt;

&lt;p&gt;The generated report includes sections like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Weekly Instagram Competitor Report

1. Summary
2. Competitor activity
3. Top-performing posts and Reels
4. Hashtag trends
5. Creator and brand mentions
6. Practical recommendations
7. Raw CSV-friendly metrics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A report might answer questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which competitor posted the most this week?&lt;/li&gt;
&lt;li&gt;Which Reels had the highest engagement rate?&lt;/li&gt;
&lt;li&gt;Which hashtags appeared repeatedly?&lt;/li&gt;
&lt;li&gt;Which creators or brands were mentioned?&lt;/li&gt;
&lt;li&gt;Which content formats seem worth testing next?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is the kind of information a social media analyst, indie brand, or agency might otherwise collect manually.&lt;/p&gt;

&lt;h2&gt;
  
  
  Production is a separate problem
&lt;/h2&gt;

&lt;p&gt;Running the mock workflow is easy.&lt;/p&gt;

&lt;p&gt;Running this in production is different.&lt;/p&gt;

&lt;p&gt;Production workflows need answers to questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Which public-data provider will you use?&lt;/li&gt;
&lt;li&gt;How often will the report run?&lt;/li&gt;
&lt;li&gt;How many competitor accounts will you monitor?&lt;/li&gt;
&lt;li&gt;How many recent media items do you need per account?&lt;/li&gt;
&lt;li&gt;What happens when a request fails?&lt;/li&gt;
&lt;li&gt;How will you control API cost?&lt;/li&gt;
&lt;li&gt;Where will reports be stored?&lt;/li&gt;
&lt;li&gt;How will you monitor scheduled jobs?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That is why the repo separates the basic examples from the production docs.&lt;/p&gt;

&lt;p&gt;The README is for trust and quick start.&lt;/p&gt;

&lt;p&gt;The production docs are for provider decisions, deployment, observability, and cost control.&lt;/p&gt;

&lt;h2&gt;
  
  
  Cost control matters
&lt;/h2&gt;

&lt;p&gt;A weekly competitor report can be cheap.&lt;/p&gt;

&lt;p&gt;A daily report across many clients can get expensive quickly.&lt;/p&gt;

&lt;p&gt;A rough estimate might look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;estimated_requests =
  competitors
  × endpoints_per_competitor
  × reports_per_month
  × retry_factor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;10 competitors
2 endpoints per competitor
4 weekly reports per month
1.2 retry factor

10 × 2 × 4 × 1.2 = 96 estimated requests / month
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For a small workflow, this is manageable.&lt;/p&gt;

&lt;p&gt;For an agency monitoring many clients, this becomes a real production decision.&lt;/p&gt;

&lt;p&gt;That is why the project includes cost-control notes instead of pretending provider choice does not matter.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this project is not for
&lt;/h2&gt;

&lt;p&gt;This project is only for public-data analysis and reporting.&lt;/p&gt;

&lt;p&gt;It is not for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;collecting private account data&lt;/li&gt;
&lt;li&gt;asking users for Instagram passwords&lt;/li&gt;
&lt;li&gt;automating likes, follows, comments, or DMs&lt;/li&gt;
&lt;li&gt;fake engagement&lt;/li&gt;
&lt;li&gt;spam workflows&lt;/li&gt;
&lt;li&gt;account automation&lt;/li&gt;
&lt;li&gt;claiming official affiliation with Instagram, Meta, or any provider&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I wanted the project to stay focused on reporting and analysis, not automation abuse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I built it this way
&lt;/h2&gt;

&lt;p&gt;The first version could have been a dashboard.&lt;/p&gt;

&lt;p&gt;But I chose a small Python workflow instead.&lt;/p&gt;

&lt;p&gt;A dashboard is useful once the data model is clear.&lt;/p&gt;

&lt;p&gt;A report generator is useful immediately.&lt;/p&gt;

&lt;p&gt;The current version is closer to a practical starter than a polished SaaS product:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;clone
run mock workflow
inspect report
modify examples
decide if production setup is worth it
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That felt like the right order.&lt;/p&gt;

&lt;h2&gt;
  
  
  Possible next steps
&lt;/h2&gt;

&lt;p&gt;The project is still early, but the obvious next improvements are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Streamlit dashboard demo&lt;/li&gt;
&lt;li&gt;Google Sheets export guide&lt;/li&gt;
&lt;li&gt;Notion report template&lt;/li&gt;
&lt;li&gt;multi-client agency report template&lt;/li&gt;
&lt;li&gt;more production deployment examples&lt;/li&gt;
&lt;li&gt;better benchmark scripts&lt;/li&gt;
&lt;li&gt;richer content theme classification&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I am especially interested in the agency-reporting use case:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Add a few competitor accounts, run a weekly job, and generate a client-ready report automatically.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That is probably where this workflow becomes most useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Repo:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/prodkit-labs/instagram-competitor-intelligence" rel="noopener noreferrer"&gt;https://github.com/prodkit-labs/instagram-competitor-intelligence&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Start with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 examples/06_generate_weekly_report.py &lt;span class="nt"&gt;--mock&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you try it, I would love to hear what workflow you are building:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;competitor reports&lt;/li&gt;
&lt;li&gt;Reels ranking&lt;/li&gt;
&lt;li&gt;hashtag tracking&lt;/li&gt;
&lt;li&gt;creator research&lt;/li&gt;
&lt;li&gt;agency client reporting&lt;/li&gt;
&lt;li&gt;dashboard exports&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The project is intentionally small right now, so feedback on the workflow is more useful than feature requests for a giant platform.&lt;/p&gt;

</description>
      <category>python</category>
      <category>tutorial</category>
      <category>data</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
