> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scraper.creatorlookup.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Comments

> Retrieve comments on an Instagram post

## Request

### Headers

| Name        | Required | Description  |
| ----------- | -------- | ------------ |
| `x-api-key` | Yes      | Your API key |

### Query parameters

<ParamField query="shortcode" type="string" required>
  The post shortcode to fetch comments for.
</ParamField>

<ParamField query="limit" type="number" default={20}>
  Number of comments to return. Min: 1, max: 200. Defaults to 20.
</ParamField>

## Response

<ResponseField name="data" type="InstagramComment[]">
  Array of comment objects.

  <Expandable title="InstagramComment">
    <ResponseField name="id" type="string">Unique comment identifier</ResponseField>
    <ResponseField name="text" type="string">Comment text</ResponseField>
    <ResponseField name="username" type="string">Username of the commenter</ResponseField>
    <ResponseField name="timestamp" type="number">Unix timestamp of when the comment was posted</ResponseField>
    <ResponseField name="like_count" type="number">Number of likes on the comment</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="credits_used" type="number">Credits deducted (2)</ResponseField>
<ResponseField name="credits_remaining" type="number">Remaining credit balance</ResponseField>

**Cost:** 2 credits

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -H "x-api-key: sk-your-api-key" \
    "https://api.scraper.creatorlookup.com/v1/instagram/post/comments?shortcode=CxAbCdEfGh&limit=10"
  ```

  ```javascript JavaScript theme={null}
  const res = await fetch(
    "https://api.scraper.creatorlookup.com/v1/instagram/post/comments?shortcode=CxAbCdEfGh&limit=10",
    { headers: { "x-api-key": "sk-your-api-key" } }
  );

  const { data } = await res.json();
  data.forEach((comment) => {
    console.log(`@${comment.username}: ${comment.text}`);
  });
  ```

  ```python Python theme={null}
  import requests

  res = requests.get(
      "https://api.scraper.creatorlookup.com/v1/instagram/post/comments",
      params={"shortcode": "CxAbCdEfGh", "limit": 10},
      headers={"x-api-key": "sk-your-api-key"},
  )

  for comment in res.json()["data"]:
      print(f"@{comment['username']}: {comment['text']}")
  ```
</CodeGroup>

### 200 — Success

```json theme={null}
{
  "data": [
    {
      "id": "17890012345678901",
      "text": "Amazing photo! Love the colors",
      "username": "photouser",
      "timestamp": 1700001000,
      "like_count": 42
    },
    {
      "id": "17890012345678902",
      "text": "Where was this taken?",
      "username": "traveler99",
      "timestamp": 1700002000,
      "like_count": 5
    }
  ],
  "credits_used": 2,
  "credits_remaining": 9998
}
```

### 402 — Insufficient credits

```json theme={null}
{
  "error": {
    "code": "INSUFFICIENT_CREDITS",
    "message": "This endpoint requires 2 credits, you have 1"
  }
}
```

### 504 — Timeout

```json theme={null}
{
  "error": {
    "code": "TIMEOUT",
    "message": "Scraping request timed out"
  }
}
```
