GETInsights3–7 credits
Generate captions
GET https://api.instagramapi.dev/v1/insights/profile/captionLearns 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
| Name | Type | Required | Description |
|---|---|---|---|
| handle | string | yes | An Instagram account. Accepts a username (`nike`), a numeric user id (`13460080`), or a full profile URL (`https://instagram.com/nike`). We resolve it automatically. |
| topic | string | yes | What the new caption(s) should be about. |
| count | number | no | How many caption options to generate (1–5). Defaults to 3. |
| posts | number | no | Recent 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 creditsExample 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.
| Field | Type | Description |
|---|---|---|
| username | string | The account's @handle. |
| topic | string | The subject you asked captions for, echoed back. |
| captions | array<string> | Generated caption options written in the account's voice. |
| hashtags | array<string> | Suggested hashtags to pair with the captions. |
| voice_notes | string | Notes on the caption voice we matched. |