Skip to content

Quick start ​

crates.ioCILicenseDocker

gra is a daemon that bridges Instagram to Telegram:

  1. You create a bot with @BotFather.
  2. gra runs in the background and answers the bot.
  3. 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 ​

sh
cargo install gra

or use the Docker image (see Docker):

sh
docker run -d --name gra -v "$PWD/data:/data" -e GRA_BOT_TOKEN="<TOKEN>" \
  --restart unless-stopped ghcr.io/maxylev/gra:latest

Configure ​

Create gra.toml in the working directory (see Configuration for every option):

toml
bot_token = "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
db_path   = "gra.db"
allowed_user_ids = [11111111]   # recommended: only you can use the bot

The token can also come from GRA_BOT_TOKEN or --bot-token. Your Telegram id is shown by /whoami.

Run ​

sh
gra

The daemon connects to your bot, registers the command list and starts long-polling for updates.

A complete first session ​

text
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 ​

sh
gra doctor --cookies file:./cookies.txt --username natgeo

doctor 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:

  1. fetches profile info (followers, following, posts) and records changes;
  2. looks for posts newer than the last delivered one, downloads the media and sends it to the chat (albums for carousels), oldest first;
  3. checks active stories (when cookies are available) and sends new ones;
  4. remembers what was delivered, so nothing is sent twice.

Only new content is delivered — there is no backfill.

Released under the MIT License. Not affiliated with Instagram or Meta.