[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EN03KTWKPQGJ5FVYK1PTP4":3,"skill-same:01M7EN03KTWKPQGJ5FVYK1PTP4":78},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":6,"ownerHtmlUrl":43,"ownerBlogUrl":6,"ownerDescription":44,"updatedAt":45,"install":46,"resources":59},"01M7EN03KTWKPQGJ5FVYK1PTP4","instagram-api",null,"Use when wiring an agent into Instagram's Graph API: publishing a Reel through the create\u002Fpoll\u002Fpublish container dance, reading per-media insights, checking the 24h publish cap, or ingesting Reel metrics into 02-DOCS\u002Fwiki\u002Fshortform. NOT TikTok (that is `tiktok-api`), NOT YouTube (that is `youtube-api`), NOT cross-platform cadence (that is `social-publisher`).","lza6\u002FArmor-piercing-system-prompts","lza6","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F128880206?v=4","01M7EB3K7WPX5T28EJ2NVHE6EG","Chinese-tingfeng","01M7EB3K97E1KQ16QWKJMFNGX8",11,"MIT","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Finstagram-api\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: instagram-api\ndescription: \"Use when wiring an agent into Instagram's Graph API: publishing a Reel through the create\u002Fpoll\u002Fpublish container dance, reading per-media insights, checking the 24h publish cap, or ingesting Reel metrics into 02-DOCS\u002Fwiki\u002Fshortform. NOT TikTok (that is `tiktok-api`), NOT YouTube (that is `youtube-api`), NOT cross-platform cadence (that is `social-publisher`).\"\ntags: [instagram, graph-api, content-publishing, reels, insights, shortform]\nrecommends: [tiktok-api, youtube-api, social-publisher, shortform-strategy, api-connector-builder]\norigin: risco\n---\n\n# instagram-api\n\nThe wire between an agent and Instagram's Graph API: publish Reels, pull the metrics that still exist, and write them to the wiki. You speak HTTP, OAuth scopes, container IDs, and metric names. You do not decide what to post, write the caption's voice, or cut the video — route those out.\n\nAll facts below are pinned to **Graph API v25.0** (current as of 2026-06-02). When you generate code, pin the version explicitly; Meta breaks metrics on version boundaries.\n\n## Route out\n\n| The ask | Skill |\n|---|---|\n| Post the same clip to **TikTok** | `tiktok-api` |\n| Upload to **YouTube** \u002F pull YouTube stats | [`youtube-api`](..\u002Fyoutube-api\u002FSKILL.md) |\n| Cadence, best-time, multi-platform calendar | [`social-publisher`](..\u002Fsocial-publisher\u002FSKILL.md) |\n| What to make \u002F shortform content strategy | `shortform-strategy` |\n| Hook, cuts, on-screen captions | [`video-shorts`](..\u002Fvideo-shorts\u002FSKILL.md) |\n| Generic OAuth\u002Fwebhook plumbing not IG-specific | `api-connector-builder` |\n\n## Prereqs & auth\n\nYou cannot publish from a personal account. Confirm these before writing any call.\n\n- **IG professional account** (Business or Creator). Why: the publishing and insights endpoints reject personal accounts outright.\n- **Auth path + host** — pick one and stay on it:\n  - Facebook Login for Business → IG account linked to a FB Page → host `graph.facebook.com`.\n  - Instagram Login (direct) → host `graph.instagram.com`.\n  Why: the host is not interchangeable per call; mixing tokens and hosts throws auth errors.\n- **Scopes (current names):** `instagram_business_content_publish` to publish, `instagram_business_manage_insights` to read metrics. Why: the old `instagram_basic` \u002F `instagram_content_publish` were deprecated 2025-01-27 and silently grant nothing now.\n- **Long-lived token = 60 days**, refreshable before expiry. A short-lived user token lasts ~1h. Why: anything in a script needs the long-lived token or it dies within the hour.\n\nEnv block — generate code that reads these, never hard-code the token:\n\n```bash\nexport IG_USER_ID=\"17841400000000000\"      # the IG professional account id (NOT the page id)\nexport IG_ACCESS_TOKEN=\"EAAG...long-lived\"  # 60-day token, refresh before expiry\nexport GRAPH_VERSION=\"v25.0\"                # pin it — never blank\nexport GRAPH_HOST=\"graph.facebook.com\"      # or graph.instagram.com for IG Login\n```\n\n## Publish a Reel — the 3-step container dance\n\nPublishing is never one call. It is create → poll → publish. Skipping the poll is the #1 failure.\n\n**Step 1 — create the container.** `video_url` must be a publicly reachable MP4 (no auth header, no signed-URL-that-expires-in-30s) for the entire processing window.\n\n```bash\ncurl -s -X POST \"https:\u002F\u002F$GRAPH_HOST\u002F$GRAPH_VERSION\u002F$IG_USER_ID\u002Fmedia\" \\\n  -d \"media_type=REELS\" \\\n  -d \"video_url=https:\u002F\u002Fcdn.example.com\u002Fclip.mp4\" \\\n  -d \"caption=Shipped it.\" \\\n  -d \"share_to_feed=true\" \\\n  -d \"access_token=$IG_ACCESS_TOKEN\"\n# -> {\"id\":\"17999999999999999\"}   \u003C- this is the CONTAINER id, not a published post\n```\n\n**Step 2 — poll status until `FINISHED`.** Meta recommends ~once per minute, ceiling ~5 minutes.\n\n```bash\ncurl -s \"https:\u002F\u002F$GRAPH_HOST\u002F$GRAPH_VERSION\u002F$CONTAINER_ID?fields=status_code,status\" \\\n  -d \"access_token=$IG_ACCESS_TOKEN\"\n# -> {\"status_code\":\"FINISHED\", ...}\n```\n\n**Step 3 — publish.** Only after `FINISHED`.\n\n```bash\ncurl -s -X POST \"https:\u002F\u002F$GRAPH_HOST\u002F$GRAPH_VERSION\u002F$IG_USER_ID\u002Fmedia_publish\" \\\n  -d \"creation_id=$CONTAINER_ID\" \\\n  -d \"access_token=$IG_ACCESS_TOKEN\"\n# -> {\"id\":\"17888888888888888\"}   \u003C- THIS is the published media id\n```\n\nA compact Python helper that does the whole dance:\n\n```python\nimport os, time, requests\n\nHOST = os.environ[\"GRAPH_HOST\"]\nVER  = os.environ[\"GRAPH_VERSION\"]          # v25.0 — pinned\nUID  = os.environ[\"IG_USER_ID\"]\nTOK  = os.environ[\"IG_ACCESS_TOKEN\"]\nBASE = f\"https:\u002F\u002F{HOST}\u002F{VER}\"\n\ndef publish_reel(video_url: str, caption: str) -> str:\n    cid = requests.post(f\"{BASE}\u002F{UID}\u002Fmedia\", data={\n        \"media_type\": \"REELS\", \"video_url\": video_url,\n        \"caption\": caption, \"share_to_feed\": \"true\",\n        \"access_token\": TOK,\n    }).json()[\"id\"]\n\n    for _ in range(10):                      # ~5 min ceiling at 30s steps\n        st = requests.get(f\"{BASE}\u002F{cid}\", params={\n            \"fields\": \"status_code\", \"access_token\": TOK,\n        }).json()[\"status_code\"]\n        if st == \"FINISHED\":\n            break\n        if st in (\"ERROR\", \"EXPIRED\"):\n            raise RuntimeError(f\"container {cid} -> {st}\")\n        time.sleep(30)\n    else:\n        raise TimeoutError(f\"container {cid} never reached FINISHED\")\n\n    return requests.post(f\"{BASE}\u002F{UID}\u002Fmedia_publish\", data={\n        \"creation_id\": cid, \"access_token\": TOK,\n    }).json()[\"id\"]\n```\n\n```text\nBad:  publish immediately after create -> \"Media ID is not available\" \u002F silent fail.\nGood: poll status_code until FINISHED, then media_publish.\n\nBad:  video_url behind auth or a 30s signed URL -> container stalls in ERROR.\nGood: a plain public MP4 that stays reachable for the full ~5 min window.\n```\n\nFull container field reference (reels \u002F carousel \u002F story), cover & thumb handling, error codes, retry\u002Fbackoff, and batch publish with cap check → `references\u002Fpublish-reel.md`.\n\n## Status polling rules\n\n`status_code` is the only honest signal. Branch on it, do not guess from timing.\n\n| `status_code` | Meaning | Action |\n|---|---|---|\n| `IN_PROGRESS` | Still transcoding | Keep polling (~60s) |\n| `FINISHED` | Ready | Call `media_publish` now |\n| `ERROR` | Failed (bad url, bad codec, eligibility) | Stop; read `status`, fix source |\n| `EXPIRED` | Container unpublished too long | Stop; recreate from step 1 |\n\nWhy the 5-min ceiling: containers expire. If you poll forever you will eventually publish an `EXPIRED` id and get an error. Cap retries.\n\n## Limits — check before a batch\n\n| Rule | How |\n|---|---|\n| **50 API-published posts per rolling 24h** per IG account | `GET \u002F{IG_USER_ID}\u002Fcontent_publishing_limit?fields=quota_usage,config` |\n| Over the cap | `media_publish` rejects with **error subcode #51** (\"publishing limit reached\") |\n\n```bash\ncurl -s \"https:\u002F\u002F$GRAPH_HOST\u002F$GRAPH_VERSION\u002F$IG_USER_ID\u002Fcontent_publishing_limit?fields=quota_usage\" \\\n  -d \"access_token=$IG_ACCESS_TOKEN\"\n# -> {\"data\":[{\"quota_usage\": 12, \"config\": {\"quota_total\": 50}}]}\n```\n\nWhy check first: in a batch, hitting #51 mid-run leaves half your queue unpublished and no clean resume point. Read `quota_usage` and stop early.\n\n## Fetch insights\n\n```bash\ncurl -s \"https:\u002F\u002F$GRAPH_HOST\u002F$GRAPH_VERSION\u002F$IG_MEDIA_ID\u002Finsights\" \\\n  -d \"metric=reach,views,likes,comments,shares,saved,total_interactions,ig_reels_avg_watch_time,ig_reels_video_view_total_time\" \\\n  -d \"access_token=$IG_ACCESS_TOKEN\"\n```\n\n**Valid Reels metric set (v25.0):** `reach`, `views`, `likes`, `comments`, `shares`, `saved`, `total_interactions`, `ig_reels_avg_watch_time`, `ig_reels_video_view_total_time` (plus optional `crossposted_views`, `facebook_views`, `reposts`). Why a fixed list: the metric set differs by media type (feed \u002F story \u002F reels), and one invalid name fails the **whole** call — not just that field.\n\n**Units trap:** the API returns `ig_reels_avg_watch_time` and `ig_reels_video_view_total_time` in **milliseconds**, not seconds. Store the raw value verbatim (suffix the key `_ms`) so the artifact matches the API, or divide by 1000 at ingest and rename to `_s` — never label a raw millisecond value \"seconds\". A 7.4s avg watch arrives as `7400`.\n\n## The deprecated-metric trap\n\nRequesting any retired metric does not return null — it **400s the entire insights call**. Map old → new before you send.\n\n| Deprecated | Replacement | Deprecated on |\n|---|---|---|\n| `plays` | `views` | 2025-04-21 (v22.0 + all versions) |\n| `clips_replays_count` | — (removed) | 2025-04-21 |\n| `ig_reels_aggregated_all_plays_count` | `views` | 2025-04-21 |\n| `impressions` | `views` \u002F `reach` | gone for media created after 2024-07-02 |\n| `video_views` | `views` | 2025-01-08 |\n| `profile_views` (media) | — | 2025-03-25 |\n\nIf a previously-working call started erroring, this table is almost certainly why: a metric you used to request was retired on a version boundary. Swap to `views` and drop the dead names.\n\nComplete current metric tables per media type, the full deprecated→replacement map with dates, version-gated 2025–2026 additions, and the `02-DOCS\u002Fwiki\u002Fshortform\u002F` ingest schema spec → `references\u002Finsights-metrics.md`.\n\n## Ingest into 02-DOCS\u002Fwiki\u002Fshortform\u002F\n\nThis is the checkable deliverable. One file per media id, idempotent overwrite (re-running a pull refreshes `pulled_at` and metrics, never duplicates).\n\n- **Path:** `02-DOCS\u002Fwiki\u002Fshortform\u002Fig-reel-\u003Cmedia_id>.md`\n- **Naming:** always `ig-reel-` prefix + the published media id (not the container id).\n- **Re-runs:** overwrite the same file in place — the media id is the natural key.\n\n```markdown\n---\ntype: instagram-metrics\ntitle: \"Reel 17888888888888888\"\ndescription: Performance snapshot for one Instagram Reel, pulled from Graph API v25.0.\ntags: [instagram, reels, insights, shortform]\ntimestamp: \"2026-06-02T08:00:00Z\"\ntopic: shortform\nstatus: stable\nplatform: instagram\nmedia_type: REELS\nmedia_id: \"17888888888888888\"\npermalink: \"https:\u002F\u002Fwww.instagram.com\u002Freel\u002FCxxxxxx\u002F\"\npublished_at: \"2026-05-30T09:12:00Z\"\ngraph_version: v25.0\npulled_at: \"2026-06-02T08:00:00Z\"\nmetrics:\n  reach: 41200\n  views: 58800\n  total_interactions: 3120\n  saved: 410\n  shares: 220\n  ig_reels_avg_watch_time_ms: 7400        # raw API value — MILLISECONDS (avg per view)\n  ig_reels_video_view_total_time_ms: 435120000 # raw API value — MILLISECONDS (summed)\n---\n\n# Reel 17888888888888888\n\nPerformance snapshot pulled from Graph API v25.0. Metric set is the\ncurrent valid Reels set; no deprecated names requested.\n```\n\n`type` is the only required OKF v0.1 field; `title`\u002F`description`\u002F`tags`\u002F`timestamp` are the recommended OKF surface (`timestamp` mirrors the pull instant). The DOMAIN keys below are mandatory and stay byte-for-byte — `verify.sh` requires a pinned `graph_version` and greps the `metrics` block for deprecated names; `pulled_at` is the API-pull instant verify\u002Fdiff rely on. Keep both `pulled_at` and `timestamp`. Why front-matter + media-id filename: the wiki is queried by key, and re-pulls must be diffable, not additive (the idempotent overwrite re-stamps `timestamp` and `pulled_at` together).\n\n## Anti-patterns\n\n| Anti-pattern | Why it bites | Do instead |\n|---|---|---|\n| Publish right after `media` create | Container isn't `FINISHED`; publish errors | Poll `status_code` first |\n| Requesting `plays` \u002F `impressions` | 400s the whole insights call | Use `views`; consult the trap table |\n| Leaving `GRAPH_VERSION` blank \u002F using default | Metric set silently shifts on Meta's rollout | Pin `v25.0` in every call |\n| Signed\u002Fauth-gated `video_url` | Container stalls in `ERROR` | Plain public MP4 for the full window |\n| Batch publishing without cap check | Hit #51 mid-run, half-published queue | `content_publishing_limit` before the loop |\n| Old scopes (`instagram_basic`, `instagram_content_publish`) | Grant nothing since 2025-01-27 | `instagram_business_basic` \u002F `instagram_business_content_publish` |\n| Storing the container id as \"the post\" | It's not the published media id | Persist the `media_publish` id |\n| Sending a `graph.instagram.com` token to `graph.facebook.com` | Host is fixed by the login path, not chosen per call | Pick the host with the auth path and stay on it |\n| Letting the 60-day long-lived token lapse | Every call fails with an auth error, not a 404 | Refresh before expiry |\n| A source video outside Reel eligibility | Surfaces as container `ERROR`, not a clean validation message | 9:16, 5–90s, H.264\u002FHEVC |\n| Requesting the 2025–2026 additions (Reels skip rate, repost counts, crossposted views) blind | Version-gated — trips the same 400 trap as a deprecated name | Confirm they exist on `GRAPH_VERSION` first |\n","# instagram-api\n\nThe wire between an agent and Instagram's Graph API: publish Reels, pull the metrics that still exist, and write them to the wiki. You speak HTTP, OAuth scopes, container IDs, and metric names. You do not decide what to post, write the caption's voice, or cut the video — route those out.\n\nAll facts below are pinned to **Graph API v25.0** (current as of 2026-06-02). When you generate code, pin the version explicitly; Meta breaks metrics on version boundaries.\n\n## Route out\n\n| The ask | Skill |\n|---|---|\n| Post the same clip to **TikTok** | `tiktok-api` |\n| Upload to **YouTube** \u002F pull YouTube stats | [`youtube-api`](..\u002Fyoutube-api\u002FSKILL.md) |\n| Cadence, best-time, multi-platform calendar | [`social-publisher`](..\u002Fsocial-publisher\u002FSKILL.md) |\n| What to make \u002F shortform content strategy | `shortform-strategy` |\n| Hook, cuts, on-screen captions | [`video-shorts`](..\u002Fvideo-shorts\u002FSKILL.md) |\n| Generic OAuth\u002Fwebhook plumbing not IG-specific | `api-connector-builder` |\n\n## Prereqs & auth\n\nYou cannot publish from a personal account. Confirm these before writing any call.\n\n- **IG professional account** (Business or Creator). Why: the publishing and insights endpoints reject personal accounts outright.\n- **Auth path + host** — pick one and stay on it:\n  - Facebook Login for Business → IG account linked to a FB Page → host `graph.facebook.com`.\n  - Instagram Login (direct) → host `graph.instagram.com`.\n  Why: the host is not interchangeable per call; mixing tokens and hosts throws auth errors.\n- **Scopes (current names):** `instagram_business_content_publish` to publish, `instagram_business_manage_insights` to read metrics. Why: the old `instagram_basic` \u002F `instagram_content_publish` were deprecated 2025-01-27 and silently grant nothing now.\n- **Long-lived token = 60 days**, refreshable before expiry. A short-lived user token lasts ~1h. Why: anything in a script needs the long-lived token or it dies within the hour.\n\nEnv block — generate code that reads these, never hard-code the token:\n\n```bash\nexport IG_USER_ID=\"17841400000000000\"      # the IG professional account id (NOT the page id)\nexport IG_ACCESS_TOKEN=\"EAAG...long-lived\"  # 60-day token, refresh before expiry\nexport GRAPH_VERSION=\"v25.0\"                # pin it — never blank\nexport GRAPH_HOST=\"graph.facebook.com\"      # or graph.instagram.com for IG Login\n```\n\n## Publish a Reel — the 3-step container dance\n\nPublishing is never one call. It is create → poll → publish. Skipping the poll is the #1 failure.\n\n**Step 1 — create the container.** `video_url` must be a publicly reachable MP4 (no auth header, no signed-URL-that-expires-in-30s) for the entire processing window.\n\n```bash\ncurl -s -X POST \"https:\u002F\u002F$GRAPH_HOST\u002F$GRAPH_VERSION\u002F$IG_USER_ID\u002Fmedia\" \\\n  -d \"media_type=REELS\" \\\n  -d \"video_url=https:\u002F\u002Fcdn.example.com\u002Fclip.mp4\" \\\n  -d \"caption=Shipped it.\" \\\n  -d \"share_to_feed=true\" \\\n  -d \"access_token=$IG_ACCESS_TOKEN\"\n# -> {\"id\":\"17999999999999999\"}   \u003C- this is the CONTAINER id, not a published post\n```\n\n**Step 2 — poll status until `FINISHED`.** Meta recommends ~once per minute, ceiling ~5 minutes.\n\n```bash\ncurl -s \"https:\u002F\u002F$GRAPH_HOST\u002F$GRAPH_VERSION\u002F$CONTAINER_ID?fields=status_code,status\" \\\n  -d \"access_token=$IG_ACCESS_TOKEN\"\n# -> {\"status_code\":\"FINISHED\", ...}\n```\n\n**Step 3 — publish.** Only after `FINISHED`.\n\n```bash\ncurl -s -X POST \"https:\u002F\u002F$GRAPH_HOST\u002F$GRAPH_VERSION\u002F$IG_USER_ID\u002Fmedia_publish\" \\\n  -d \"creation_id=$CONTAINER_ID\" \\\n  -d \"access_token=$IG_ACCESS_TOKEN\"\n# -> {\"id\":\"17888888888888888\"}   \u003C- THIS is the published media id\n```\n\nA compact Python helper that does the whole dance:\n\n```python\nimport os, time, requests\n\nHOST = os.environ[\"GRAPH_HOST\"]\nVER  = os.environ[\"GRAPH_VERSION\"]          # v25.0 — pinned\nUID  = os.environ[\"IG_USER_ID\"]\nTOK  = os.environ[\"IG_ACCESS_TOKEN\"]\nBASE = f\"https:\u002F\u002F{HOST}\u002F{VER}\"\n\ndef publish_reel(video_url: str, caption: str) -> str:\n    cid = requests.post(f\"{BASE}\u002F{UID}\u002Fmedia\", data={\n        \"media_type\": \"REELS\", \"video_url\": video_url,\n        \"caption\": caption, \"share_to_feed\": \"true\",\n        \"access_token\": TOK,\n    }).json()[\"id\"]\n\n    for _ in range(10):                      # ~5 min ceiling at 30s steps\n        st = requests.get(f\"{BASE}\u002F{cid}\", params={\n            \"fields\": \"status_code\", \"access_token\": TOK,\n        }).json()[\"status_code\"]\n        if st == \"FINISHED\":\n            break\n        if st in (\"ERROR\", \"EXPIRED\"):\n            raise RuntimeError(f\"container {cid} -> {st}\")\n        time.sleep(30)\n    else:\n        raise TimeoutError(f\"container {cid} never reached FINISHED\")\n\n    return requests.post(f\"{BASE}\u002F{UID}\u002Fmedia_publish\", data={\n        \"creation_id\": cid, \"access_token\": TOK,\n    }).json()[\"id\"]\n```\n\n```text\nBad:  publish immediately after create -> \"Media ID is not available\" \u002F silent fail.\nGood: poll status_code until FINISHED, then media_publish.\n\nBad:  video_url behind auth or a 30s signed URL -> container stalls in ERROR.\nGood: a plain public MP4 that stays reachable for the full ~5 min window.\n```\n\nFull container field reference (reels \u002F carousel \u002F story), cover & thumb handling, error codes, retry\u002Fbackoff, and batch publish with cap check → `references\u002Fpublish-reel.md`.\n\n## Status polling rules\n\n`status_code` is the only honest signal. Branch on it, do not guess from timing.\n\n| `status_code` | Meaning | Action |\n|---|---|---|\n| `IN_PROGRESS` | Still transcoding | Keep polling (~60s) |\n| `FINISHED` | Ready | Call `media_publish` now |\n| `ERROR` | Failed (bad url, bad codec, eligibility) | Stop; read `status`, fix source |\n| `EXPIRED` | Container unpublished too long | Stop; recreate from step 1 |\n\nWhy the 5-min ceiling: containers expire. If you poll forever you will eventually publish an `EXPIRED` id and get an error. Cap retries.\n\n## Limits — check before a batch\n\n| Rule | How |\n|---|---|\n| **50 API-published posts per rolling 24h** per IG account | `GET \u002F{IG_USER_ID}\u002Fcontent_publishing_limit?fields=quota_usage,config` |\n| Over the cap | `media_publish` rejects with **error subcode #51** (\"publishing limit reached\") |\n\n```bash\ncurl -s \"https:\u002F\u002F$GRAPH_HOST\u002F$GRAPH_VERSION\u002F$IG_USER_ID\u002Fcontent_publishing_limit?fields=quota_usage\" \\\n  -d \"access_token=$IG_ACCESS_TOKEN\"\n# -> {\"data\":[{\"quota_usage\": 12, \"config\": {\"quota_total\": 50}}]}\n```\n\nWhy check first: in a batch, hitting #51 mid-run leaves half your queue unpublished and no clean resume point. Read `quota_usage` and stop early.\n\n## Fetch insights\n\n```bash\ncurl -s \"https:\u002F\u002F$GRAPH_HOST\u002F$GRAPH_VERSION\u002F$IG_MEDIA_ID\u002Finsights\" \\\n  -d \"metric=reach,views,likes,comments,shares,saved,total_interactions,ig_reels_avg_watch_time,ig_reels_video_view_total_time\" \\\n  -d \"access_token=$IG_ACCESS_TOKEN\"\n```\n\n**Valid Reels metric set (v25.0):** `reach`, `views`, `likes`, `comments`, `shares`, `saved`, `total_interactions`, `ig_reels_avg_watch_time`, `ig_reels_video_view_total_time` (plus optional `crossposted_views`, `facebook_views`, `reposts`). Why a fixed list: the metric set differs by media type (feed \u002F story \u002F reels), and one invalid name fails the **whole** call — not just that field.\n\n**Units trap:** the API returns `ig_reels_avg_watch_time` and `ig_reels_video_view_total_time` in **milliseconds**, not seconds. Store the raw value verbatim (suffix the key `_ms`) so the artifact matches the API, or divide by 1000 at ingest and rename to `_s` — never label a raw millisecond value \"seconds\". A 7.4s avg watch arrives as `7400`.\n\n## The deprecated-metric trap\n\nRequesting any retired metric does not return null — it **400s the entire insights call**. Map old → new before you send.\n\n| Deprecated | Replacement | Deprecated on |\n|---|---|---|\n| `plays` | `views` | 2025-04-21 (v22.0 + all versions) |\n| `clips_replays_count` | — (removed) | 2025-04-21 |\n| `ig_reels_aggregated_all_plays_count` | `views` | 2025-04-21 |\n| `impressions` | `views` \u002F `reach` | gone for media created after 2024-07-02 |\n| `video_views` | `views` | 2025-01-08 |\n| `profile_views` (media) | — | 2025-03-25 |\n\nIf a previously-working call started erroring, this table is almost certainly why: a metric you used to request was retired on a version boundary. Swap to `views` and drop the dead names.\n\nComplete current metric tables per media type, the full deprecated→replacement map with dates, version-gated 2025–2026 additions, and the `02-DOCS\u002Fwiki\u002Fshortform\u002F` ingest schema spec → `references\u002Finsights-metrics.md`.\n\n## Ingest into 02-DOCS\u002Fwiki\u002Fshortform\u002F\n\nThis is the checkable deliverable. One file per media id, idempotent overwrite (re-running a pull refreshes `pulled_at` and metrics, never duplicates).\n\n- **Path:** `02-DOCS\u002Fwiki\u002Fshortform\u002Fig-reel-\u003Cmedia_id>.md`\n- **Naming:** always `ig-reel-` prefix + the published media id (not the container id).\n- **Re-runs:** overwrite the same file in place — the media id is the natural key.\n\n```markdown\n---\ntype: instagram-metrics\ntitle: \"Reel 17888888888888888\"\ndescription: Performance snapshot for one Instagram Reel, pulled from Graph API v25.0.\ntags: [instagram, reels, insights, shortform]\ntimestamp: \"2026-06-02T08:00:00Z\"\ntopic: shortform\nstatus: stable\nplatform: instagram\nmedia_type: REELS\nmedia_id: \"17888888888888888\"\npermalink: \"https:\u002F\u002Fwww.instagram.com\u002Freel\u002FCxxxxxx\u002F\"\npublished_at: \"2026-05-30T09:12:00Z\"\ngraph_version: v25.0\npulled_at: \"2026-06-02T08:00:00Z\"\nmetrics:\n  reach: 41200\n  views: 58800\n  total_interactions: 3120\n  saved: 410\n  shares: 220\n  ig_reels_avg_watch_time_ms: 7400        # raw API value — MILLISECONDS (avg per view)\n  ig_reels_video_view_total_time_ms: 435120000 # raw API value — MILLISECONDS (summed)\n---\n\n# Reel 17888888888888888\n\nPerformance snapshot pulled from Graph API v25.0. Metric set is the\ncurrent valid Reels set; no deprecated names requested.\n```\n\n`type` is the only required OKF v0.1 field; `title`\u002F`description`\u002F`tags`\u002F`timestamp` are the recommended OKF surface (`timestamp` mirrors the pull instant). The DOMAIN keys below are mandatory and stay byte-for-byte — `verify.sh` requires a pinned `graph_version` and greps the `metrics` block for deprecated names; `pulled_at` is the API-pull instant verify\u002Fdiff rely on. Keep both `pulled_at` and `timestamp`. Why front-matter + media-id filename: the wiki is queried by key, and re-pulls must be diffable, not additive (the idempotent overwrite re-stamps `timestamp` and `pulled_at` together).\n\n## Anti-patterns\n\n| Anti-pattern | Why it bites | Do instead |\n|---|---|---|\n| Publish right after `media` create | Container isn't `FINISHED`; publish errors | Poll `status_code` first |\n| Requesting `plays` \u002F `impressions` | 400s the whole insights call | Use `views`; consult the trap table |\n| Leaving `GRAPH_VERSION` blank \u002F using default | Metric set silently shifts on Meta's rollout | Pin `v25.0` in every call |\n| Signed\u002Fauth-gated `video_url` | Container stalls in `ERROR` | Plain public MP4 for the full window |\n| Batch publishing without cap check | Hit #51 mid-run, half-published queue | `content_publishing_limit` before the loop |\n| Old scopes (`instagram_basic`, `instagram_content_publish`) | Grant nothing since 2025-01-27 | `instagram_business_basic` \u002F `instagram_business_content_publish` |\n| Storing the container id as \"the post\" | It's not the published media id | Persist the `media_publish` id |\n| Sending a `graph.instagram.com` token to `graph.facebook.com` | Host is fixed by the login path, not chosen per call | Pick the host with the auth path and stay on it |\n| Letting the 60-day long-lived token lapse | Every call fails with an auth error, not a 404 | Refresh before expiry |\n| A source video outside Reel eligibility | Surfaces as container `ERROR`, not a clean validation message | 9:16, 5–90s, H.264\u002FHEVC |\n| Requesting the 2025–2026 additions (Reels skip rate, repost counts, crossposted views) blind | Version-gated — trips the same 400 trap as a deprecated name | Confirm they exist on `GRAPH_VERSION` first |\n",{"name":5,"tags":24,"origin":31,"recommends":32,"description":7},[25,26,27,28,29,30],"instagram","graph-api","content-publishing","reels","insights","shortform","risco",[33,34,35,36,37],"tiktok-api","youtube-api","social-publisher","shortform-strategy","api-connector-builder","main","d69096e239f2a89aabc2cd078c47664a9d3b1e11","04-安全渗透\u002Finstagram-api",3,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts","https:\u002F\u002Fgithub.com\u002Flza6","个人vx：Tf00798\r\n个人✈：@TFGY999","2026-10-08 14:29:22",{"source":8,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add lza6\u002FArmor-piercing-system-prompts --skill instagram-api",{"tool":52,"command":53},"bunx","bunx skills add lza6\u002FArmor-piercing-system-prompts --skill instagram-api",{"tool":55,"command":56},"pnpm","pnpm dlx skills add lza6\u002FArmor-piercing-system-prompts --skill instagram-api","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Finstagram-api\u002FSKILL.md",true,[60,66,70,74],{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"evals\u002Fcases.yaml","REFERENCE","参考文档",2686,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Finstagram-api\u002Fevals\u002Fcases.yaml",{"path":67,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":68,"sourceHtmlUrl":69},"evals\u002FREADME.md",1050,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Finstagram-api\u002Fevals\u002FREADME.md",{"path":71,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Finsights-metrics.md",4637,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Finstagram-api\u002Freferences\u002Finsights-metrics.md",{"path":75,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fpublish-reel.md",3784,"https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F04-安全渗透\u002Finstagram-api\u002Freferences\u002Fpublish-reel.md",[79,87,92,99,106,113],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":86},"01M7FFG485KY83TD6HSC4YPCMC","obsidian-clipper-template-creator","Guide for creating templates for the Obsidian Web Clipper. Use when you want to create a new clipping template, understand available variables, or format clipped content.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":88,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":86},"01M7FFG0T6AZ0STEJPSB3CX84K","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobsidian-clipper-template-creator-antigravity-awesome-skills-main\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":86},"01M7FFFY0QEM14SKWPDYGMXM2P","python-api","Programmatic Object-Detection-Metrics API guidance for BoundingBox, BoundingBoxes, Evaluator, enums, coordinate conversion, AP\u002FmAP semantics, and source-style import diagnostics.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Fpython-api\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":86},"01M7FFFVZQZ2GJ0C0TGP7JHD20","file-evaluation","Folder-based PASCAL VOC AP\u002FmAP evaluation from ground-truth and detection text files.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002Fsub-skills\u002Ffile-evaluation\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":86},"01M7FFFSFNYSE77SJ6PE1CK2DA","object-detection-metrics","Guides legacy Object-Detection-Metrics PASCAL VOC AP\u002FmAP evaluation from detection text folders and direct Python API classes.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fobject-detection-metrics\u002FSKILL.md",[],[],{"skillNo":114,"name":115,"nameZh":6,"description":116,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":117,"categories":118,"keywords":119,"publishedAt":86},"01M7FFFP0GCK1RVXBCPQ8APBMT","nx-workspace-patterns","Configure and optimize Nx monorepo workspaces. Use when setting up Nx, configuring project boundaries, optimizing build caching, or implementing affected commands.","https:\u002F\u002Fgithub.com\u002Flza6\u002FArmor-piercing-system-prompts\u002Fblob\u002Fmain\u002F07-后端与架构\u002Fnx-workspace-patterns\u002FSKILL.md",[],[]]