Local Python bot: logs into Instagram as @BOT over HTTP (instagrapi, no Chrome). When @HOST tags or @mentions the bot account, it starts a DM and chats with Groq.
This uses Instagram’s unofficial private API. Use at your own risk. Prefer testing carefully and keeping the poll interval slow.
Never commit .env — it holds your Instagram session cookie and API keys.
| Stars | Unlock |
|---|---|
| 50 ⭐ | Reels React |
| 100 ⭐ | Photo and video support |
Hit the goal → it ships.
pip install -r requirements.txt
copy .env.example .envEdit .env:
IG_USERNAME— bot account (BOT)IG_SESSIONID— browsersessionidcookie (required)TRIGGER_USERNAME— who must tag you (HOST)GROQ_API_KEY— from console.groq.comGROQ_MODEL— defaultllama-3.3-70b-versatile
- Log into https://www.instagram.com in Chrome as the bot account
- Finish any checkpoint in the browser
- F12 → Application → Cookies →
https://www.instagram.com→ copysessionid - Paste into
.envasIG_SESSIONID=...
When the cookie expires, refresh it the same way and update .env.
python main.py- Poll activity / photo tags for
@HOSTtagging@BOT - On a new tag → Groq writes an opener → DM
@HOST - Further DMs from
@HOSTget Groq replies - Handled events/messages are stored in
state.jsonso restarts don’t double-send
Stop with Ctrl+C.
YouTubr :- https://www.youtube.com/watch?v=fFDGgvPuVxc