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

# Update Settings

> Configure YouTube Comments Scraper settings

Configure your **YouTube Comments Scraper** squid. Control sorting, reply collection, date filtering, and result limits.

## Headers

<ParamField header="Authorization" type="string" required>
  Your API authentication token. Value: `Token YOUR_API_KEY`
</ParamField>

<ParamField header="Content-Type" type="string" required>
  Request body format. Value: `application/json`
</ParamField>

## Scraper Parameters

Set these parameters in the `params` object:

| Parameter                          | Type    | Default   | Description                                                                                                             |
| ---------------------------------- | ------- | --------- | ----------------------------------------------------------------------------------------------------------------------- |
| **max\_results**                   | integer | unlimited | Maximum comments to collect per video                                                                                   |
| **max\_unique\_results\_per\_run** | integer | null      | Maximum unique comments across all tasks in the run                                                                     |
| **sort\_by**                       | string  | `top`     | Comment sort order: `top` (most liked first) or `newest` (most recent first)                                            |
| **skip\_pinned\_comment**          | boolean | false     | Skip the pinned comment at the top of the thread                                                                        |
| **include\_replies**               | boolean | true      | Collect replies to top-level comments                                                                                   |
| **max\_replies**                   | integer | unlimited | Maximum replies to collect per comment. Only applies when `include_replies` is `true`                                   |
| **fetch\_since**                   | string  | null      | Only collect comments published after this date. Accepts `YYYY-MM-DD HH:MM:SS` or a relative value (`24h`, `7d`, `30d`) |
| **fetch\_since\_timezone**         | string  | UTC       | Timezone for `fetch_since`. Example: `Europe/Paris`                                                                     |

## Squid Settings

| Setting                     | Type    | Description                           |
| --------------------------- | ------- | ------------------------------------- |
| **name**                    | string  | Display name for your squid           |
| **concurrency**             | integer | Number of parallel tasks (default: 1) |
| **export\_unique\_results** | boolean | Export only unique comments           |
| **to\_complete**            | boolean | Run until all tasks complete          |
| **no\_line\_breaks**        | boolean | Remove line breaks from text fields   |

<Note>
  `max_replies` is only relevant when `include_replies` is `true`. Set it to cap reply collection on highly-commented threads.
</Note>

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST "https://api.lobstr.io/v1/squids/YOUR_SQUID_HASH" \
    -H "Authorization: Token YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "YouTube Comments (1)",
      "concurrency": 1,
      "params": {
        "sort_by": "top",
        "include_replies": true,
        "max_replies": 50,
        "skip_pinned_comment": false,
        "fetch_since": "7d"
      }
    }'
  ```

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

  API_KEY = "YOUR_API_KEY"
  BASE_URL = "https://api.lobstr.io/v1"
  headers = {"Authorization": f"Token {API_KEY}", "Content-Type": "application/json"}

  squid_id = "YOUR_SQUID_HASH"

  payload = {
      "name": "YouTube Comments (1)",
      "concurrency": 1,
      "params": {
          "sort_by": "top",
          "include_replies": True,
          "max_replies": 50,
          "skip_pinned_comment": False,
          "fetch_since": "7d",
      },
  }

  response = requests.post(f"{BASE_URL}/squids/{squid_id}", headers=headers, json=payload)
  print(f"Settings updated: {response.json()['name']}")
  ```
</CodeGroup>

## Response

```json 201 theme={null}
{
  "name": "YouTube Comments (1)",
  "concurrency": 1,
  "params": {
    "sort_by": "top",
    "include_replies": true,
    "max_replies": 50,
    "skip_pinned_comment": false,
    "fetch_since": "7d"
  }
}
```
