Quick start
gra is a daemon that bridges Instagram to Telegram:
- You create a bot with @BotFather.
graruns in the background and answers the bot.- You add accounts to track — new posts and stories arrive in the chat as media.
Unofficial, not affiliated with Instagram or Meta Platforms, Inc. Use only to archive and watch content you are allowed to access, and respect Instagram's Terms of Use and rate limits.
Install
cargo install graor use the Docker image (see Docker):
docker run -d --name gra -v "$PWD/data:/data" -e GRA_BOT_TOKEN="<TOKEN>" \
--restart unless-stopped ghcr.io/maxylev/gra:latestConfigure
Create gra.toml in the working directory (see Configuration for every option):
bot_token = "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
db_path = "gra.db"
allowed_user_ids = [11111111] # recommended: only you can use the botThe token can also come from GRA_BOT_TOKEN or --bot-token. Your Telegram id is shown by /whoami.
Run
graThe daemon connects to your bot, registers the command list and starts long-polling for updates.
A complete first session
You: /start
Bot: 👋 Welcome to Gra! (main menu with buttons)
You: /login
Bot: 🔑 Add cookies — send k=v; k2=v2, a cookies.txt file, or a table
You: sessionid=...; csrftoken=...; ds_user_id=...
Bot: ✅ Cookies parsed (3 fields) — send your User-Agent or ⏭ Skip
You: ⏭ Skip
Bot: 🔑 Cookies saved as default ⭐ (your default)
✅ Authenticated as Instagram id 123456789
You: /add natgeo
Bot: 👤 natgeo — 283,000,000 followers · 150 following · 30,000 posts
Track it? [✅ Track] [❌ Cancel]
You: ✅ Track
Bot: ✅ Tracking natgeo — every 30m
…when a new post appears:
Bot: 🆕 natgeo posted [photo] ❤️ 1.2K · 💬 34 · 🕒 2m ago
🔗 https://www.instagram.com/p/AbC123/From then on the daemon polls the account on your chosen interval, records statistics, and delivers new posts and stories to the chat. Everything else — accounts, intervals, toggles, cookie sets — is managed with the buttons in the bot, no config editing needed.
Check connectivity first
gra doctor --cookies file:./cookies.txt --username natgeodoctor verifies that the cookies authenticate and that the profile is fetchable before you run the daemon.
What happens on each check
For every tracked account, at its configured interval, the daemon:
- fetches profile info (followers, following, posts) and records changes;
- looks for posts newer than the last delivered one, downloads the media and sends it to the chat (albums for carousels), oldest first;
- checks active stories (when cookies are available) and sends new ones;
- remembers what was delivered, so nothing is sent twice.
Only new content is delivered — there is no backfill.