# Instagram Engagement statistics API (instagram.engagement)

- Canonical page: [https://everyinfra.com/en/instagram-api/engagement](https://everyinfra.com/en/instagram-api/engagement?utm_medium=ai_doc&utm_campaign=page_md)
- Endpoint: POST https://api.everyinfra.com/api/v1/social with {"platform": "instagram", "action": "engagement", "params": {...}}
- Price: $0.000556 per call ($0.56 per 1,000 requests); failed calls and empty results are not charged
- Returns: single object
- Mode: sync; add "mode": "async" for slow tasks

## Health

- Live health (24h percent, hourly and daily trends): https://api.everyinfra.com/api/v1/social/availability?platform=instagram&action=engagement

## Parameters

| name | type | required | default | description |
|---|---|---|---|---|
| username | not declared | yes | not declared | Identifies an Instagram account handle without the @ symbol or as a full profile URL. Used by profile, persona, user_posts, and reels to fetch account data, and by engagement to work out one account's engagement. The followers action returns only total follower counts, whereas followers_list and following_list return account lists. |
| posts | integer | no | not declared | How many of the account's latest posts `engagement` counts: an integer from 3 to 60, 24 if left out. Pinned posts are counted; the latest are taken by post time. |

## Response fields (items in `results`)

| field | meaning |
|---|---|
| username | Username (@handle). |
| display_name | Display name; can differ from username. |
| url | Link to the record on the platform. |
| follower_count | Followers. null means not disclosed, not 0. |
| is_verified | Whether the platform verified the account. null means it cannot be determined. |
| sample_size | (engagement) Number of posts actually counted. |
| period_start | (engagement) Publish time of the earliest counted post, ISO 8601, UTC. |
| period_end | (engagement) Publish time of the latest counted post, ISO 8601, UTC. |
| posts_per_week | (engagement) Average number of posts per week over this period. |
| avg_like_count | (engagement) Average likes per post. Posts whose author hid the like count count as 0. |
| avg_comment_count | (engagement) Average comments per post. |
| avg_view_count | (engagement) Average views per post; image posts have no view count. |
| median_like_count | (engagement) Median likes per post. |
| avg_interactions | (engagement) Average interactions per post (likes + comments). |
| median_interactions | (engagement) Median interactions per post (likes + comments). |
| engagement_rate | (engagement) Engagement rate in %: average interactions per post ÷ follower_count × 100. 0.0118 means 0.0118%. |
| media_mix | (engagement) Number of posts of each type, as an object: image, carousel, reel (Reels). |
| posts_by_hour_utc | (engagement) Number of posts by hour of posting (UTC): 24 numbers, the first is for hour 0. |
| top_hours_utc | (engagement) The hours (0 to 23, UTC) with the most posts, most first. |
| posts_by_weekday_utc | (engagement) Number of posts by day of the week (UTC): 7 numbers, in the order Sunday, Monday, ... Saturday. |
| top_posts | (engagement) The 3 posts with the most interactions; each has url, text (the first 140 characters of the caption), posted_at, interactions (likes + comments), like_count, comment_count and view_count (absent for image posts). |
| platform | Source platform identifier, the same as platform in the request (for example xiaohongshu, tiktok). |

## Example

```bash
curl -X POST 'https://api.everyinfra.com/api/v1/social' \
  -H "Authorization: Bearer $EVERYINFRA_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "platform": "instagram",
  "action": "engagement",
  "params": {
    "username": "nasa"
  }
}'
```

```python
import os
import requests

response = requests.post(
    "https://api.everyinfra.com/api/v1/social",
    headers={"Authorization": f"Bearer {os.environ['EVERYINFRA_API_KEY']}"},
    json={
        "platform": "instagram",
        "action": "engagement",
        "params": {
            "username": "nasa",
        },
    },
    timeout=120,
)
print(response.status_code)
print(response.json())
```

## Response example

No real sample for these example parameters yet: structure only, every value is a placeholder (…).

```text
{
  "id": "req_…",
  "platform": "instagram",
  "action": "engagement",
  "results": {
    "username": …,
    "display_name": …,
    "url": …,
    "follower_count": …,
    "is_verified": …,
    "sample_size": …,
    "period_start": …,
    "period_end": …,
    "posts_per_week": …,
    "avg_like_count": …,
    "avg_comment_count": …,
    "avg_view_count": …,
    "median_like_count": …,
    "avg_interactions": …,
    "median_interactions": …,
    "engagement_rate": …,
    "media_mix": …,
    "posts_by_hour_utc": …,
    "top_hours_utc": …,
    "posts_by_weekday_utc": …,
    "top_posts": …,
    "platform": …
  },
  "billing": {
    "charged": …,
    "charged_usd": …,
    "balance_after_usd": …,
    …
  },
  "quota": { … }
}
```

## Also

- Capability catalog (no key): https://api.everyinfra.com/api/v1/social/catalog?platform=instagram
- OpenAPI: https://everyinfra.com/openapi.json · Agents guide: https://everyinfra.com/agents.md
