instagramlisted
Install: claude install-skill AceDataCloud/Skills
Call the **Instagram Graph API** (`graph.facebook.com`) with `curl + jq`. The
connector injects `$INSTAGRAM_ACCESS_TOKEN` (a token with
`instagram_content_publish` + `pages_read_engagement`; a Facebook Page token or
an Instagram-Login user token) and optionally `$INSTAGRAM_IG_USER_ID`. Never echo them.
Instagram publishes only **images / videos / reels** to a **professional**
(Business or Creator) account linked to a Facebook Page. There are no text-only posts.
### Resolve the Instagram account id
If `$INSTAGRAM_IG_USER_ID` is set, use it. Otherwise derive it from the token —
try the **Page-token** path first (`/me` is the Page), then fall back to the
**user-token** path (`/me/accounts` → linked Page → IG account), so either token
type the connector accepts resolves cleanly:
```bash
if [ -n "$INSTAGRAM_IG_USER_ID" ]; then
IGID="$INSTAGRAM_IG_USER_ID"
else
# Page access token: /me IS the Page, read its linked IG account directly
IGID=$(curl -sS "https://graph.facebook.com/v21.0/me?fields=instagram_business_account&access_token=$INSTAGRAM_ACCESS_TOKEN" | jq -r '.instagram_business_account.id // empty')
if [ -z "$IGID" ]; then
# User access token: list the managed Page, then its linked IG account
PAGE=$(curl -sS "https://graph.facebook.com/v21.0/me/accounts?access_token=$INSTAGRAM_ACCESS_TOKEN" | jq -r '.data[0].id // empty')
IGID=$(curl -sS "https://graph.facebook.com/v21.0/$PAGE?fields=instagram_business_account&access_token=$INSTAGRAM_ACCESS_TOKEN" | j