Agent skill

Instagram

by nicepkg in nicepkg/ai-workflow

Instagram Graph API integration via curl. An agent skill from nicepkg/ai-workflow.

MITAuto-check passedBackend & APIs

Install Instagram

skills CLI
$ npx skills add nicepkg/ai-workflow --skill instagram -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install nicepkg/ai-workflow instagram --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/nicepkg/ai-workflow.git skills-src && mkdir -p .claude/skills && cp -r skills-src/workflows/video-creator-workflow/.claude/skills/instagram .claude/skills/instagram && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
instagram
GitHub stars
285
Token cost
~1.8k tokens
SKILL.md length
709 words
Files
1
Skills in repo
61
Repo updated
First seen
Licence
MIT

At a glance

Instagram Graph API integration via curl. An agent skill from nicepkg/ai-workflow.

  • Works in 5 steps: Fetch recent media for the account → Get details for a single media → Search media by hashtag → …
  • Fetch and publish Instagram media
  • SKILL.md covers When to Use, Prerequisites, How to Use and Guidelines
  • Calls bash; reaches graph.facebook.com and developers.facebook.com; needs INSTAGRAM_ACCESS_TOKEN and API_KEY

What it does

Instagram is an agent skill from nicepkg/ai-workflow. Instagram Graph API integration via curl. Use this skill to fetch and publish Instagram media.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Third-party API integration. It works with Instagram and Bash. The repository describes itself as: 🚀 170+ pre-built skills for Claude Code, Cursor, Codex & 14+ AI tools. Stop re-teaching your AI the same things. One command → instant domain expertise. Marketing, SEO, Trading… The licence is MIT.

When your agent uses it

  • Fetch and publish Instagram media
  • Tasks that involve Third-party API integration

Example prompts

  • “/instagram”

Requirements

  • A credential in INSTAGRAM_ACCESS_TOKEN
  • A credential in API_KEY

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Fetch recent media for the account
  2. Get details for a single media
  3. Search media by hashtag
  4. Publish an image post
  5. Common errors and troubleshooting

What it can do on your machine

Read from SKILL.md and the folder at commit d167b41. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • graph.facebook.com
    • developers.facebook.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • INSTAGRAM_ACCESS_TOKEN
    • API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Instagram loads about 1.8k tokens when it runs. Until then it costs about 26 tokens; SKILL.md has 709 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~26
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from nicepkg/ai-workflow at commit d167b41, republished under its MIT licence (© nicepkg). 709 words, ~1,783 tokens.

Download SKILL.mdSave it as .claude/skills/instagram/SKILL.md (or your agent's skills folder).
name
instagram
description
Instagram Graph API integration via curl. Use this skill to fetch and publish Instagram media.
vm0_secrets
INSTAGRAM_ACCESS_TOKEN
vm0_vars
INSTAGRAM_BUSINESS_ACCOUNT_ID

Instagram API (Graph API)

Use the Instagram Graph API by directly executing curl commands to read and publish Instagram content.

Official docs: https://developers.facebook.com/docs/instagram-api


When to Use

Use this skill when you need to:

  • Fetch recent media (photos / videos / Reels) from an account
  • Get detailed information about a specific media item (caption, type, link, time, etc.)
  • Search recent media by hashtag
  • Publish image posts via API (with caption)

Prerequisites

  1. You must have an Instagram Business / Creator account linked to a Facebook Page
  2. Create an app in Facebook Developers and enable Instagram Basic Display / Instagram Graph API permissions
  3. Obtain:
  • INSTAGRAM_ACCESS_TOKEN: a long-lived user access token
  • INSTAGRAM_BUSINESS_ACCOUNT_ID: your Instagram Business account ID

Set the environment variables, for example:

bash
export INSTAGRAM_ACCESS_TOKEN="EAAG..."
export INSTAGRAM_BUSINESS_ACCOUNT_ID="1784140xxxxxxx"

These examples use Graph API version v21.0. You can replace this with the latest version if needed.

Required permissions (scopes)

Depending on which endpoints you use, make sure your app has requested and been approved for (at least):

  • instagram_basic
  • pages_show_list
  • instagram_content_publish (for publishing media)
  • instagram_manage_insights and related permissions (for insights / some hashtag use cases)

Important: When using $VAR in a command that pipes to another command, wrap the command containing $VAR in bash -c '...'. Due to a Claude Code bug, environment variables are silently cleared when pipes are used directly.

bash
bash -c 'curl -s "https://api.example.com" -H "Authorization: Bearer $API_KEY"' | jq '.'

How to Use

All examples below assume you have already set:

bash
INSTAGRAM_ACCESS_TOKEN
INSTAGRAM_BUSINESS_ACCOUNT_ID
1. Fetch recent media for the account

Fetch the most recent media (photos / videos / Reels) for the account:

bash
bash -c 'curl -s -X GET "https://graph.facebook.com/v21.0/${INSTAGRAM_BUSINESS_ACCOUNT_ID}/media?fields=id,caption,media_type,media_url,permalink,timestamp" --header "Authorization: Bearer ${INSTAGRAM_ACCESS_TOKEN}"'

Notes:

  • Each item in the returned JSON represents a media object
  • Common fields:
    • id: media ID (used for details / insights later)
    • caption: caption text
    • media_type: IMAGE / VIDEO / CAROUSEL_ALBUM
    • media_url: direct URL to the media
    • permalink: Instagram permalink
    • timestamp: creation time

2. Get details for a single media

If you already have a media id, you can fetch more complete information. Replace <your-media-id> with the id field from the "Get User Media" response (section 1 above):

bash
bash -c 'curl -s -X GET "https://graph.facebook.com/v21.0/<your-media-id>?fields=id,caption,media_type,media_url,permalink,thumbnail_url,timestamp,username" --header "Authorization: Bearer ${INSTAGRAM_ACCESS_TOKEN}"'

3. Search media by hashtag

Note: hashtag search requires proper business use cases and permissions as defined by Facebook/Instagram. Refer to the official docs.

This usually involves two steps:

3.1 Get the hashtag ID

Replace <hashtag-name> with any hashtag name you want to search for (without the # symbol), e.g., "travel", "food", "photography":

bash
bash -c 'curl -s -X GET "https://graph.facebook.com/v21.0/ig_hashtag_search?user_id=${INSTAGRAM_BUSINESS_ACCOUNT_ID}&q=<hashtag-name>" --header "Authorization: Bearer ${INSTAGRAM_ACCESS_TOKEN}"'

Note the id field in the returned JSON for use in the next step.

3.2 Fetch recent media for the hashtag

Replace <hashtag-id> with the id field from the "Search Hashtag" response (section 3.1 above):

bash
bash -c 'curl -s -X GET "https://graph.facebook.com/v21.0/<hashtag-id>/recent_media?user_id=${INSTAGRAM_BUSINESS_ACCOUNT_ID}&fields=id,caption,media_type,media_url,permalink,timestamp" --header "Authorization: Bearer ${INSTAGRAM_ACCESS_TOKEN}"'

4. Publish an image post

Publishing an image post via the Graph API usually requires two steps:

  1. Create a media container
  2. Publish the container to the feed
Show full SKILL.md (270 more words)Show less
4.1 Create a media container

Write the request data to /tmp/request.json:

json
{
  "image_url": "https://example.com/image.jpg",
  "caption": "Hello from Instagram API 👋"
}

Replace https://example.com/image.jpg with any publicly accessible image URL and update the caption text as needed.

bash
bash -c 'curl -s -X POST "https://graph.facebook.com/v21.0/${INSTAGRAM_BUSINESS_ACCOUNT_ID}/media" -H "Content-Type: application/json" -d @/tmp/request.json --header "Authorization: Bearer ${INSTAGRAM_ACCESS_TOKEN}"'

The response will contain an id (media container ID), for example:

json
{
  "id": "1790xxxxxxxxxxxx"
}

Note this ID for use in the next step.

4.2 Publish the media container to the feed

Write the request data to /tmp/request.json:

json
{
  "creation_id": "<your-creation-id>"
}

Replace <your-creation-id> with the id field from the "Create Media Container" response (section 4.1 above):

bash
bash -c 'curl -s -X POST "https://graph.facebook.com/v21.0/${INSTAGRAM_BUSINESS_ACCOUNT_ID}/media_publish" -H "Content-Type: application/json" -d @/tmp/request.json --header "Authorization: Bearer ${INSTAGRAM_ACCESS_TOKEN}"'

If successful, the response will contain the final media id:

json
{
  "id": "1791yyyyyyyyyyyy"
}

You can then use the "Get details for a single media" command to fetch its permalink.


5. Common errors and troubleshooting
  1. Permissions / OAuth errors
  • Typical error message: (#10) Application does not have permission for this action
  • Check:
  • Whether the app has been reviewed / approved
  • Whether the required Instagram permissions are enabled
  • Whether INSTAGRAM_ACCESS_TOKEN is a valid long-lived token
  1. Unsupported account type
  • Most Graph API features require Business / Creator accounts
  • Make sure the Instagram account type is correct and linked to a Facebook Page
  1. Rate limits
  • Too many requests in a short period may hit rate limits; add delays for bulk operations

Guidelines

  1. Do not log tokens: INSTAGRAM_ACCESS_TOKEN is sensitive; avoid printing it in logs or chat transcripts
  2. Validate curl commands in a test environment first: confirm flows before wiring them into automation / agents
  3. Keep API version up to date: periodically check Facebook docs and update the v21.0 version in URLs to the latest
  4. Use placeholder text for IDs: all examples use placeholder text like <your-media-id> instead of shell variables in URLs to avoid dependencies and make examples self-contained

© nicepkg, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in workflows/video-creator-workflow/.claude/skills/instagram of nicepkg/ai-workflow.

Open the folder on GitHubat commit d167b41

Compare with similar skills

Instagram next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Instagram compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Instagram this skillnicepkg/ai-workflow285—~1.8kAutomated safety check: PassMIT
TikHub API Helperliangdabiao/tikhub_api_skill129—~1.5kAutomated safety check: PassNone
Instagram Profile Metabrowser-act/skills6.1k—~1.2kAutomated safety check: PassMIT
Hugging Face API Tool Builderhuggingface/skills11k5 repos~1.5kAutomated safety check: PassApache-2.0
Sub2API AdminWei-Shaw/sub2api43k1 repos~717Automated safety check: PassLGPL-3.0
Firecrawl Build Onboardingfirecrawl/firecrawl190k1 repos~1.4kAutomated safety check: NotesISC

Similar skills

  • TikHub API Helper

    liangdabiao/tikhub_api_skill

    Searches TikHub's social media API endpoints and calls them from the command line for TikTok, Douyin, Xiaohongshu, Instagram, YouTube, Reddit and more.

    129 GitHub stars~1.5k tokensUpdated 3 mo ago
    Backend & APIsAuto-check passed
  • Instagram Profile Meta

    browser-act/skills

    Fetches Instagram user profile metadata including bio, follower count, following count, post count, verification status and other profile details.

    6.1k GitHub stars~1.2k tokensUpdated 1 mo ago
    Data & AnalyticsAuto-check passed
  • Official

    Builds reusable command line scripts that fetch, enrich or process data from the Hugging Face API, aimed at chained, repeated or automated tasks.

    11k GitHub starsUsed in 5 repos~1.5k tokens
    AI & LLM EngineeringAuto-check passed
  • Sub2API Admin

    Wei-Shaw/sub2api

    Manages a Sub2API deployment from the command line: accounts, redeem and invitation codes, groups, proxies, imports, exports and raw admin API calls.

    43k GitHub starsUsed in 1 repo~717 tokens
    Backend & APIsAuto-check passed
  • Firecrawl Build Onboarding

    firecrawl/firecrawl

    Gets Firecrawl working in a project: signs you in through the browser, saves FIRECRAWL_API_KEY to .env and picks the first SDK or REST path.

    190k GitHub starsUsed in 1 repo~1.4k tokens
    Backend & APIsAuto-check: notes
  • Turns an API description, such as an OpenAPI file or a Postman collection, into a connector plugin for ToolJet's marketplace and checks it with the repo's validator.

    41k GitHub stars~2.1k tokensUpdated today
    Backend & APIsAuto-check passed

More from nicepkg/ai-workflow

All 61 skills in this repo
  • Capture Triage

    nicepkg/ai-workflow

    Processes Drafts Pro captures from the Inbox folder. An agent skill from nicepkg/ai-workflow.

    285 GitHub stars~3k tokensUpdated 8 mo ago
    Auto-check passed
  • Legacy To AI Ready

    nicepkg/ai-workflow

    Transform legacy codebases into AI-ready projects with Claude Code configurations.

    285 GitHub stars~2.2k tokensUpdated 8 mo ago
    Auto-check: notes
  • Newsletter Coach

    nicepkg/ai-workflow

    Writing coach that extracts educational content from your daily experiences and turns it into publish-ready newsletter drafts.

    285 GitHub stars~3.7k tokensUpdated 8 mo ago
    Auto-check passed
  • Webfluence

    nicepkg/ai-workflow

    Content web architecture framework. An agent skill from nicepkg/ai-workflow.

    285 GitHub stars~1.4k tokensUpdated 8 mo ago
    Auto-check passed
  • Workflow Creator

    nicepkg/ai-workflow

    Create complete Claude Code workflow directories with curated skills.

    285 GitHub stars~2.6k tokensUpdated 8 mo ago
    Auto-check passed
  • Media Processing

    nicepkg/ai-workflow

    Video/audio/image processing with FFmpeg and ImageMagick. An agent skill from nicepkg/ai-workflow.

    285 GitHub stars~2.4k tokensUpdated 8 mo ago
    Auto-check: notes

Works with

Categories

Questions about Instagram

What does Instagram do?

Instagram Graph API integration via curl. An agent skill from nicepkg/ai-workflow. Instagram is an agent skill from nicepkg/ai-workflow. Instagram Graph API integration via curl.

When should I use Instagram?

Instagram fits situations like: fetch and publish Instagram media; tasks that involve Third-party API integration.

How do I install Instagram in Claude Code?

Run `npx skills add nicepkg/ai-workflow --skill instagram -a claude-code`. Or copy the skill folder (workflows/video-creator-workflow/.claude/skills/instagram in nicepkg/ai-workflow) into .claude/skills/instagram in your project. Claude Code loads it when a task matches its description.

How do I install Instagram in Codex?

Run `npx skills add nicepkg/ai-workflow --skill instagram -a codex`. Or copy the skill folder (workflows/video-creator-workflow/.claude/skills/instagram in nicepkg/ai-workflow) into .agents/skills/instagram in your project. Codex loads it when a task matches its description.

Can I use Instagram in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add nicepkg/ai-workflow --skill instagram -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/instagram, .gemini/skills/instagram, .github/skills/instagram and .opencode/skills/instagram in your project.

What does Instagram need to run?

Going by SKILL.md and its folder, Instagram needs the command-line tools its instructions call (bash) and credentials named INSTAGRAM_ACCESS_TOKEN and API_KEY. Our summary lists: A credential in INSTAGRAM_ACCESS_TOKEN; A credential in API_KEY.

Does Instagram access the network?

SKILL.md names 2 domains. In commands or code: graph.facebook.com and developers.facebook.com; the agent is likely to contact these when it follows the instructions. This is read from the text; nothing was executed.

Is Instagram safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Instagram use?

Instagram is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Instagram use?

About 1.8k tokens (SKILL.md is roughly 7.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Instagram?

Skills that share tags, products or a category with Instagram: TikHub API Helper (liangdabiao/tikhub_api_skill, 129 stars), Instagram Profile Meta (browser-act/skills, 6.1k stars), Hugging Face API Tool Builder (huggingface/skills, 11k stars) and Sub2API Admin (Wei-Shaw/sub2api, 43k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Instagram?

nicepkg (a GitHub organization) maintains it in nicepkg/ai-workflow, which has 285 GitHub stars. The repository holds 61 skills in this directory. The repository was last updated on January 20, 2026.

Source: nicepkg/ai-workflow on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.