html
Set up the “Instagram → Meta app → access token” connection once, and then your AI (Claude, ChatGPT, any bot) can read statistics, reply to comments, and post for you. No account password needed, no risk of blocking. Below are step-by-step instructions with real, clear screenshots.
Instagram does not allow bots to log in with a password — it's risky and leads to bans. Instead, there's an official, secure method: you grant the program an access token with a clear list of permissions. The token can be revoked at any time, and no one sees your password.
Reach, impressions, saves, top posts — the AI retrieves the numbers itself and draws conclusions.
The bot sees new comments and responds in your tone — you just confirm.
A finished video with a cover goes live on schedule, without manual upload.
Direct messages and mentions are collected in one place — the AI sorts and suggests replies.
Between you and the AI is one layer — the “Meta app.” This isn't a downloadable program, but simply an entry in the developer console that can issue tokens. The full scheme:
The task is to follow the arrows from left to right one time. In the end, you'll have two things: access token (long token) and Account ID (number). You give these to the AI. That's it.
Check these three points — most people stumble here. If you have everything, it will go smoothly.
| Required | How to check / enable |
|---|---|
| 1. Professional Account (Business or Creator) | A regular personal account won't be allowed by the API. In the Instagram app: Settings → Account type and tools → Switch to professional account. Choose "Creator" or "Business" — both work. It's free and reversible. |
| 2. Facebook Account | You need any personal Facebook account to log into the Meta developer console. Instagram and Facebook are the same company, so the login is shared. |
| 3. Computer and Browser | It's easier to do all the setup from a laptop — there are many small buttons in the developer console. You can do it from a phone, but it's harder. |
Meta offers two methods. In July 2024, they added a simpler one — we'll follow that. The old one (via a Facebook Page and Graph API) is more powerful — that's the "everything is hidden in the Facebook console" method, which Anastasia used. An honest comparison:
Instagram Login. Keep one website open — developers.facebook.com. Everything is done there.
Open developers.facebook.com and log in with your regular Facebook account — button «Continue with Facebook». If Meta asks you to confirm that you are a developer — agree, enter the code from your phone/email. A one-time formality, no payment required.
Actual screen from the original guide package.
Top right — My Apps, then the green button Create App. Meta will ask what the app will do. Select the item about Instagram — «Manage messaging and content on Instagram», then type Business, come up with any name and click Create.
You are in the app dashboard. Find the card Instagram and click Set up. Then, in the left menu, expand Instagram and select “API Setup with Instagram Login”.
The list of checkboxes is “what the neural network is allowed to do.” Check what's needed. The basic set for “read + publish + reply”:
Don't be intimidated by the English names — these are just checkboxes describing actions.
Find the block Generate access tokens and click Add Instagram account. An Instagram login window will open — log in with a professional account and click Allow. After this, two valuable things will appear — copy both to a note:
After connecting the account, click Generate token. Confirm the warning “I understand” and immediately copy the string: the current Instagram Login dashboard already provides a long-lived token for approximately 60 days. There is no need to separately exchange the hourly token in this process.
The classic option: Instagram Graph API with Facebook Login. This is needed if Instagram is linked to a FacebookPage or if you need to work with both platforms. This is where the Graph API Explorer tool comes in — you use it to manually obtain the token.
As in steps 1–2 of the simple path, type — Business. In the dashboard, add the products Instagram Graph API and Facebook Login for Business. In App settings → Basic record the App ID and App Secret (these will be needed to renew the token).
In the top right, select your app. Click Generate Access Token and check the permissions in the list (below). Log in, allow access — you will receive a User Token (short-lived).
# select these permissions (scopes): instagram_basic instagram_content_publish instagram_manage_comments instagram_manage_insights pages_show_list pages_read_engagement business_management
In the Explorer query field, enter me/accounts and click Submit (▶). The response will be a list of your pages. Copy the id of the desired page (this is the IG_PAGE_ID) and its access_token (IG_PAGE_ACCESS_TOKEN).
Using the Page ID, we get the associated Instagram business account. Enter the following query in Explorer:
{PAGE_ID}?fields=instagram_business_account
Exchange the short-lived token for a long-lived one by making an API request (you'll need the App ID and App Secret from App settings → Basic):
GET https://graph.facebook.com/v23.0/oauth/access_token
?grant_type=fb_exchange_token
&client_id={APP_ID}
&client_secret={APP_SECRET}
&fb_exchange_token={short_lived_token}
You'll receive a 60-day long-lived token. Repeat me/accounts with it — you'll get a long-lived page token. Store this one.
.env:
IG_APP_ID=... IG_APP_SECRET=... IG_USER_ID=... # Instagram account ID IG_PAGE_ID=... # Facebook Page ID IG_PAGE_ACCESS_TOKEN=... # long-lived Page token IG_HANDLE=...
You have the key and ID — now you just need to put them where your neural network can read them. Two methods, by complexity.
.env file (Anastasia's method)Create a text file named .envnext to your project. Write the key and ID line by line into it. The script will read the file itself:
# .env — stored locally and never uploaded IG_USER_ID=178414XXXXXXXXXXX # account ID (placeholder) IG_ACCESS_TOKEN=IGAAXXXXXXXX... # long-lived token (placeholder) IG_HANDLE=my_blog # your @handle for reference
That's it — your neural network can now access Instagram. If you're working with Claude/ChatGPT/your own bot, just say: "Instagram data is in .env, keys are IG_USER_ID and IG_ACCESS_TOKEN».
There are ready-made "bridges" (MCP servers) that connect Instagram to Claude as an integrated tool — then commands like "publish," "read statistics" are visible directly in Claude. An open-source project is ig-mcp on GitHub. You provide it with the same key and ID as input. It's more powerful, but requires a bit more technical fuss — if you're unsure, start with Method A.
The biggest fear is, "Do I need to go through app review, record videos, wait for weeks?" My direct answer:
So, for the task of "connecting my blog to my neural network," you follow the steps — and that's it. No waiting screens or moderation.
The only regular concern. The key lives for 60 days — then the neural network will say "token expired." This isn't a breakdown, but an expiration date.
| What to do | How |
|---|---|
| Update manually | Go to developers.facebook.com → your app → Instagram → for the account, click Generate token again (or repeat the token exchange in the advanced path). Insert the new key into .env over the old one. |
| Update automatically | The key can be extended via an API request (after the first 24 hours). Your neural network can do this on a schedule — ask it to "set up automatic Instagram token renewal every 50 days." |
Common error messages and what they mean in plain English.
| What you see | What it means and what to do |
|---|---|
| "This account is not a professional account" / API doesn't see the account | Your Instagram is still a personal account. Switch to Business/Creator (section 03), wait a couple of minutes. |
(#10) Application does not have permission | Missing a permission checkbox. Go back to Permissions and add the necessary one (e.g., content_publish). |
"token expired" / (#190) | 60 days have passed. Renew the key (section 09). This is expected. |
Publishing Reels: status: ERROR | Usually, the video is unavailable via the link, or the format/length is incorrect. Reels should be MP4, 3–90 seconds, 9:16 vertical, with the file accessible via a public link. |
| No "API Setup with Instagram Login" option | First, click Set up on the Instagram product card — the option will then appear in the left menu. |
| Clicking the link "downloads" the page | This happens when the file is opened locally (file://). Open this guide via the web link (Vercel) — links open normally there. |
Meta screens periodically change their appearance, and live clicks are better seen in videos. Here are verified sources with screenshots and breakdowns (in English, but the pictures make everything clear).
Continue Reading
The CHI blog features tool breakdowns, business cases, and practical frameworks for those launching, selling, designing, and building processes with AI.
Go to Blog