> ## 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 the Reddit Scraper settings and filters

Configure your Reddit Scraper squid settings. Control sort order per input type, filter by date, limit results, and choose whether to include posts, comments, or both.

## 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 number of rows (posts + comments) to collect per task                                                                                          |
| **max\_unique\_results\_per\_run** | integer | unlimited   | Maximum unique results across all tasks in the run                                                                                                     |
| **fetch\_since**                   | string  | null        | Stop collecting content older than this threshold. Use a relative duration (`24h`, `7d`, `2w`) or absolute date (`YYYY-MM-DD HH:MM:SS`)                |
| **fetch\_since\_timezone**         | string  | null        | Timezone for interpreting an absolute `fetch_since` date (e.g. `Europe/Paris`). Ignored for relative values                                            |
| **sort\_comments**                 | string  | `best`      | Sort order for post thread comments: `best`, `top`, `new`, `controversial`, `old`, `q&a`                                                               |
| **sort\_search**                   | string  | `relevance` | Sort order for search results: `relevance`, `hot`, `top`, `new`, `comments`                                                                            |
| **sort\_subreddit**                | string  | `hot`       | Sort order for subreddit feeds: `hot`, `new`, `top`, `rising`, `controversial`                                                                         |
| **include\_nsfw**                  | boolean | `false`     | Include NSFW (adult) posts and comments in results                                                                                                     |
| **skip\_comments**                 | boolean | `false`     | Return only post rows — skip all comments                                                                                                              |
| **skip\_posts**                    | boolean | `false`     | Skip post rows. For post URLs: returns comments only. For user URLs: returns profile and comments. For subreddit URLs: returns subreddit metadata only |
| **max\_depth**                     | integer | unlimited   | Maximum nesting depth of comments to collect. `0` = top-level comments only, `1` = top-level + first replies, etc. Leave empty for full thread         |
| **keyword**                        | string  | null        | Search keyword. Automatically constructs a Reddit search URL for the given keyword and subreddit(s) — no need to manually craft search URLs            |
| **post\_type**                     | string  | `any`       | Filter search results by post type: `any`, `link`, `self`, `image`, `video`, `richvideo`. Only applies to search URLs and keyword searches             |
| **search\_comments**               | boolean | false       | Search within comment bodies instead of post titles. Only applies to search URLs and keyword searches                                                  |

## Squid Settings

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

<Tip>
  The `sort_comments`, `sort_search`, and `sort_subreddit` parameters are each applied only when the input URL matches the corresponding type — they do not conflict with each other.
</Tip>

<Note>
  `fetch_since` filters based on the `created_at` field of each post or comment. It is useful for incremental runs to avoid re-collecting old content.
</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": "Reddit Scraper (1)",
      "concurrency": 1,
      "export_unique_results": true,
      "to_complete": false,
      "no_line_breaks": true,
      "params": {
        "max_results": 500,
        "fetch_since": "7d",
        "sort_subreddit": "hot",
        "sort_comments": "top",
        "skip_comments": false,
        "skip_posts": false,
        "include_nsfw": false
      }
    }'
  ```

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

  API_KEY = "YOUR_API_KEY"
  BASE_URL = "https://api.lobstr.io/v1"
  headers = {"Authorization": f"Token {API_KEY}"}

  squid_id = "YOUR_SQUID_HASH"

  response = requests.post(f"{BASE_URL}/squids/{squid_id}",
      headers=headers,
      json={
          "name": "Reddit Scraper (1)",
          "concurrency": 1,
          "export_unique_results": True,
          "to_complete": False,
          "no_line_breaks": True,
          "params": {
              "max_results": 500,
              "fetch_since": "7d",
              "sort_subreddit": "hot",
              "sort_comments": "top",
              "skip_comments": False,
              "skip_posts": False,
              "include_nsfw": False
          }
      }
  )

  data = response.json()
  print(f"Settings updated: {data['name']}")
  ```
</CodeGroup>

## Response

```json 201 theme={null}
{
  "name": "Reddit Scraper (1)",
  "concurrency": 1,
  "export_unique_results": true,
  "to_complete": false,
  "no_line_breaks": true,
  "params": {
    "max_results": 500,
    "fetch_since": "7d",
    "sort_subreddit": "hot",
    "sort_comments": "top",
    "skip_comments": false,
    "skip_posts": false,
    "include_nsfw": false
  }
}
```
