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

# Page Ranges

> Process specific pages of a document

Reducto allows you to specify which pages of a document to process using the `page_range` parameter in settings. You can specify a single range or multiple ranges.

## Single Range

For processing a continuous range of pages, specify `start` and `end` page numbers:

<CodeGroup>
  ```python Python theme={null}
  result = client.parse.run(
      input=upload.file_id,
      settings={
          "page_range": {"start": 1, "end": 10}
      }
  )
  ```

  ```javascript Node.js theme={null}
  const result = await client.parse.run({
    input: upload.file_id,
    settings: {
      page_range: { start: 1, end: 10 }
    }
  });
  ```

  ```go Go theme={null}
  result, _ := client.Parse.Run(context.Background(), reducto.ParseRunParams{
      ParseConfig: reducto.ParseConfigParam{
          DocumentURL: reducto.F[reducto.ParseConfigDocumentURLUnionParam](
              shared.UnionString(upload.FileID),
          ),
          AdvancedOptions: reducto.F(shared.AdvancedProcessingOptionsParam{
              PageRange: reducto.F[shared.AdvancedProcessingOptionsPageRangeUnionParam](
                  shared.PageRangeParam{
                      Start: reducto.F(int64(1)),
                      End:   reducto.F(int64(10)),
                  },
              ),
          }),
      },
  })
  ```

  ```bash cURL theme={null}
  curl -X POST https://platform.reducto.ai/parse \
    -H "Authorization: Bearer $REDUCTO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "input": "reducto://your-file-id",
      "settings": {
        "page_range": {"start": 1, "end": 10}
      }
    }'
  ```
</CodeGroup>

This processes pages 1 through 10.

## Multiple Ranges

For non-contiguous pages, provide an array of range objects:

<CodeGroup>
  ```python Python theme={null}
  result = client.parse.run(
      input=upload.file_id,
      settings={
          "page_range": [
              {"start": 1, "end": 5},
              {"start": 10, "end": 15}
          ]
      }
  )
  ```

  ```javascript Node.js theme={null}
  const result = await client.parse.run({
    input: upload.file_id,
    settings: {
      page_range: [
        { start: 1, end: 5 },
        { start: 10, end: 15 }
      ]
    }
  });
  ```

  ```go Go theme={null}
  result, _ := client.Parse.Run(context.Background(), reducto.ParseRunParams{
      ParseConfig: reducto.ParseConfigParam{
          DocumentURL: reducto.F[reducto.ParseConfigDocumentURLUnionParam](
              shared.UnionString(upload.FileID),
          ),
          AdvancedOptions: reducto.F(shared.AdvancedProcessingOptionsParam{
              PageRange: reducto.F[shared.AdvancedProcessingOptionsPageRangeUnionParam](
                  shared.AdvancedProcessingOptionsPageRangeArrayParam{
                      {Start: reducto.F(int64(1)), End: reducto.F(int64(5))},
                      {Start: reducto.F(int64(10)), End: reducto.F(int64(15))},
                  },
              ),
          }),
      },
  })
  ```

  ```bash cURL theme={null}
  curl -X POST https://platform.reducto.ai/parse \
    -H "Authorization: Bearer $REDUCTO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "input": "reducto://your-file-id",
      "settings": {
        "page_range": [
          {"start": 1, "end": 5},
          {"start": 10, "end": 15}
        ]
      }
    }'
  ```
</CodeGroup>

This processes pages 1-5 and 10-15.

## Notes

* Page numbers are 1-indexed (first page is page 1)
* Both `start` and `end` are inclusive
* If no page range is specified, the entire document is processed
* The `end` page must be greater than or equal to `start`
* Ranges do not need to be in order
* Overlapping ranges are processed only once
* If `end` exceeds the document length, processing stops at the last page

## With Split Endpoint

For the Split endpoint, `page_range` is nested under `parsing.settings`:

<CodeGroup>
  ```python Python theme={null}
  result = client.split.run(
      input=upload.file_id,
      split_description=[...],
      parsing={
          "settings": {
              "page_range": {"start": 40, "end": 80}
          }
      }
  )
  ```

  ```javascript Node.js theme={null}
  const result = await client.split.run({
    input: upload.file_id,
    split_description: [...],
    parsing: {
      settings: {
        page_range: { start: 40, end: 80 }
      }
    }
  });
  ```

  ```bash cURL theme={null}
  curl -X POST https://platform.reducto.ai/split \
    -H "Authorization: Bearer $REDUCTO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "document_url": "reducto://your-file-id",
      "split_description": [...],
      "parsing": {
        "settings": {
          "page_range": {"start": 40, "end": 80}
        }
      }
    }'
  ```
</CodeGroup>
