GETInsights3–7 credits

Generate captions

GET https://api.instagramapi.dev/v1/insights/profile/caption

Learns an account's voice from its recent captions, then writes new captions on a `topic` you give, in that exact voice, plus suggested hashtags. Pass `count` (1–5, default 3). Cost: 3–7 credits depending on the sample window.

Build this with an AI agent

Paste this prompt into Claude, Codex, or any coding agent.

Parameters

NameTypeRequiredDescription
handlestringyesAn Instagram account. Accepts a username (`nike`), a numeric user id (`13460080`), or a full profile URL (`https://instagram.com/nike`). We resolve it automatically.
topicstringyesWhat the new caption(s) should be about.
countnumbernoHow many caption options to generate (1–5). Defaults to 3.
postsnumbernoRecent posts to learn the voice from (1–50). Defaults to 12.

Example request

curl "https://api.instagramapi.dev/v1/insights/profile/caption?handle=nike&topic=summer%20running%20collection%20launch&count=3&posts=12" \
  -H "Authorization: Bearer $INSTAGRAMAPI_KEY"

Try it

Live request · uses 3 credits

Example responses

Switch tabs to see the body shape for success and each error status.

{
  "data": {
    "username": "nike",
    "topic": "summer running collection launch",
    "captions": [
      "The heat is just another excuse to go further. New summer running gear, out now. Just Do It."
    ],
    "hashtags": [
      "#nikerunning",
      "#justdoit",
      "#summerrun"
    ],
    "voice_notes": "Short, punchy, motivational; ends on a brand line."
  },
  "meta": {
    "endpoint": "insights/profile/caption",
    "request_id": "req_3f8a1c9e",
    "credits_charged": 3,
    "credits_remaining": 4987,
    "ms": 412
  }
}

Response fields

Fields returned under data on a 200 response. Every response also includes a meta object with billing info.

FieldTypeDescription
usernamestringThe account's @handle.
topicstringThe subject you asked captions for, echoed back.
captionsarray<string>Generated caption options written in the account's voice.
hashtagsarray<string>Suggested hashtags to pair with the captions.
voice_notesstringNotes on the caption voice we matched.