Track Instagram Tags with Python and Slack Alerts
Zusammenfassung
Pixel shares a lightweight Python workflow for monitoring Instagram tagged posts every 15 minutes and sending new alerts to a private Slack channel. The setup uses a VPS cron job, SQLite to prevent duplicate notifications, and an API service to avoid OAuth complexity, with tips for handling varied post formats and filtering spam tags.
DEV Community
Small Python script to catch Instagram tags in Slack before they get buried
I threw together a quick Python cron job that checks Instagram every 15 minutes for new tagged posts on my store's account, saves the seen IDs in a local SQLite file, and pings a private Slack channel with the caption and handle. Honestly, I just got tired of missing customer shoutouts and unboxing posts. On Instagram, tags get completely drowned out by random likes and follow notifications, and by the time I notice them, it's days later. I looked at Meta's official Graph API first, but dealing with app reviews and refreshing OAuth tokens just to check basic tags felt like overkill for a tiny store. So I kept the setup as basic as possible: • A simple Python script running on a cheap VPS via cron • A local SQLite DB just to log media IDs so I don't get spammed twice • https://hikerapi.com to grab the public profile and tagged media endpoints without OAuth headaches • A basic Slack incoming webhook The request logic itself is pretty straightforward: python import requests headers = {"x-access-key": "YOUR_KEY"}
r = requests.get("https://api.hikerapi.com/v2/user/by/username?username=google", headers=headers)
print(r.json())
The only annoying part was dealing with the different post formats. Reels, carousels, and normal photo posts don't always return captions or tag arrays in the exact same nested structure. My script kept throwing KeyError crashes at first, or pinging Slack a second time whenever someone edited a typo in their caption. Stripping the media IDs down to their base format before checking SQLite finally stopped the duplicate alerts. If anyone else is doing basic social listening for a small shop, how are you filtering out spam/bot tags? Right now I'm getting a few random giveaway tags mixed in with real customers.

Powered by Readybot.io