# Instagram comments API and CSV export

Read available comments from one public Instagram post, reel or video. Use the browser viewer for a single batch or REST and MCP for explicit pagination.

Canonical: https://fetchfox.net/docs/instagram-comments-api

## Request

GET /instagram/comments (query parameters) or POST /instagram/comments (JSON). Authenticate with x-access-key. Keep keys server-side.

Credits: 1 credit per 50 returned comments, minimum 1 including verified empty results. Your balance must cover 1 per 20 requested comments. Failed processing uses no credits.

### curl

```
curl --fail-with-body --get 'https://api.fetchfox.net/instagram/comments' \
  -H 'x-access-key: YOUR_KEY' \
  --data-urlencode 'url=https://www.instagram.com/p/SHORTCODE/' \
  --data-urlencode 'limit=20'
```

### JavaScript

```
// Run on your server with FETCHFOX_API_KEY set.
const url = new URL('https://api.fetchfox.net/instagram/comments');
url.searchParams.set('url', 'https://www.instagram.com/p/SHORTCODE/');
url.searchParams.set('limit', '20');
const response = await fetch(url, {
  headers: { 'x-access-key': process.env.FETCHFOX_API_KEY },
  signal: AbortSignal.timeout(130000)
});
if (!response.ok) throw new Error('HTTP ' + response.status);
const result = await response.json();
if (!result.success) throw new Error('Request unsuccessful');
console.log(result.data);
```

### Python

```
import json, os
from urllib.parse import urlencode
from urllib.request import Request, urlopen

query = urlencode({"url":"https://www.instagram.com/p/SHORTCODE/","limit":20})
request = Request('https://api.fetchfox.net/instagram/comments?' + query,
    headers={'x-access-key': os.environ['FETCHFOX_API_KEY']})
with urlopen(request, timeout=130) as response:
    result = json.load(response)
if not result.get('success'):
    raise RuntimeError('Request unsuccessful')
print(result['data'])
```

## Read the returned comments

data.comments contains stable string IDs, text, available author fields, likes, replyCount and timestamps. Keep IDs as strings when storing or exporting. data.commentCount can be null and is not evidence that every comment was collected. The comments viewer exports selected public fields as CSV or the response as JSON.

## Continue a collection

limit defaults to 10 and accepts integers from 1 through 100. If hasMore is true, send the opaque cursor with the same post URL. For Instagram, preserve sortBy (popular by default, or recent). Each request is explicit and separately billed. Do not decode, modify or reuse a cursor for another post.

## Interpret collection status

collectionStatus is partial, exhausted or unknown. stopReason explains why collection stopped. Exhausted means the available source pagination ended; it does not include every hidden comment or reply. hasMore=false does not prove complete coverage. Private, removed, restricted or login-only content may fail.

## Related pages

- https://fetchfox.net/tools/instagram-comments-viewer

- https://fetchfox.net/guides/export-instagram-comments-csv

- https://fetchfox.net/guides/comments-pagination-python

- https://fetchfox.net/pricing

