# Instagram Comments API

> Get the comments on a public Instagram post (top or newest), replies to a comment and who liked a comment, as JSON with authors and like counts. 1 credit per page.

**Get the comments on a public Instagram post**, top or newest first, with author, text, time, like count and reply count. Then **read the replies to any comment** and **who liked it**.

```
GET https://api.handlehaul.com/v1/posts/{post}/comments
GET https://api.handlehaul.com/v1/comments/{comment}/replies?post=
GET https://api.handlehaul.com/v1/comments/{comment}/likers
```

- `GET /v1/posts/{post}/comments`: Comments on a post (about 15 a page)
- `GET /v1/comments/{comment}/replies?post=`: Replies to a comment
- `GET /v1/comments/{comment}/likers`: Accounts that liked a comment

**Cost:** 1 credit per successful call (free from cache). Failed calls and private accounts are free.

## Parameters

| Parameter | In | Description |
|---|---|---|
| `post` | path | Post shortcode (`C9xYzAbCdEf`), numeric id, or a URL-encoded instagram.com/p/… or /reel/… link. |
| `sort` | query | comments: `top` (default) or `newest`. |
| `comment` | path | Numeric comment id. |
| `post` | query | replies: the post the comment belongs to (shortcode or id). |
| `cursor` | query | `pagination.next_cursor` from the previous page. |
| `fresh` | query | `true` skips the cache. |

## Response

```json
{
  "data": [
    {
      "id": "782890015575457736",
      "text": "Love this!",
      "created_at": "2026-11-28T12:00:00.000Z",
      "like_count": 76,
      "reply_count": 0,
      "author": {
        "id": "6899639575",
        "username": "studio.atelier21",
        "full_name": "Studio Atelier",
        "is_private": false,
        "is_verified": false,
        "profile_pic_url": "https://scontent.cdninstagram.com/…/6899639575.jpg"
      }
    }
  ],
  "pagination": {
    "next_cursor": "Ym9v…sealed…",
    "has_more": true,
    "page_size": 15
  },
  "meta": {
    "request_id": "req_…",
    "cached": false,
    "cache_age_seconds": 0,
    "credits_charged": 1,
    "credits_remaining": 26943
  }
}
```

## Examples

```bash
curl "https://api.handlehaul.com/v1/posts/C9xYzAbCdEf/comments?sort=newest" -H "X-Api-Key: $HANDLEHAUL_API_KEY"
```

```python
import os, requests
r = requests.get("https://api.handlehaul.com/v1/posts/C9xYzAbCdEf/comments?sort=newest",
                 headers={"X-Api-Key": os.environ["HANDLEHAUL_API_KEY"]}, timeout=30)
r.raise_for_status()
for c in r.json()["data"]:
    print(c["author"]["username"], c["text"])
```

```javascript
const res = await fetch("https://api.handlehaul.com/v1/posts/C9xYzAbCdEf/comments?sort=newest", {
  headers: { "X-Api-Key": process.env.HANDLEHAUL_API_KEY },
});
const { data: comments, pagination } = await res.json();
```

```php
$ch = curl_init("https://api.handlehaul.com/v1/posts/C9xYzAbCdEf/comments?sort=newest");
curl_setopt_array($ch, [
    CURLOPT_HTTPHEADER => ["X-Api-Key: " . getenv("HANDLEHAUL_API_KEY")],
    CURLOPT_RETURNTRANSFER => true,
]);
$body = json_decode(curl_exec($ch), true);
print_r($body["data"]);
```

```go
req, _ := http.NewRequest("GET", "https://api.handlehaul.com/v1/posts/C9xYzAbCdEf/comments?sort=newest", nil)
req.Header.Set("X-Api-Key", os.Getenv("HANDLEHAUL_API_KEY"))
res, err := http.DefaultClient.Do(req)
if err != nil {
    log.Fatal(err)
}
defer res.Body.Close()
var body map[string]any
json.NewDecoder(res.Body).Decode(&body)
fmt.Println(body["data"])
```

## FAQ

### How do I scrape Instagram comments with an API?
Call `GET /v1/posts/{shortcode}/comments` and follow `pagination.next_cursor`. Each comment includes the author, text, time, like count and reply count.
