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

# Get run records

> Page through records produced by a run. Supports JSON, JSONL, CSV, and column projection.

**`GET`** `https://api-datahub.octoparse.com/v1/runs/{run_id}/records`

Authentication: API key required (`Authorization: Bearer <API Key>`).

Page through records produced by a run. `format` supports `json` (default, enveloped with pagination), `jsonl`, and `csv`. `fields` is a comma-separated column projection.

You can read while the run is still in progress; you get what has been produced so far, and `pagination.total` keeps growing. Wait for a terminal state for the complete result. `partial` is `true` when the run partially succeeded or was cancelled; those records are valid and already billed.

You can only read runs you started. Another account’s `run_id` and a missing `run_id` both return `404`.

## Request

### Path parameters

<ParamField path="run_id" type="string" required>
  Run id.
</ParamField>

### Query parameters

<ParamField query="offset" type="integer" default="0">
  Pagination offset.

  Range ≥ 0.
</ParamField>

<ParamField query="limit" type="integer" default="100">
  Page size, max 10000.

  Range 1 to 10000.
</ParamField>

<ParamField query="format" type="string" default="json">
  Output format. `json` is enveloped with pagination; `jsonl` is one record per line; `csv` is tabular.

  Values: `json` / `jsonl` / `csv`.
</ParamField>

<ParamField query="fields" type="string">
  Comma-separated field names. Only these columns are returned, for example `title,price,url`.
</ParamField>

### Example request

```bash theme={null}
curl \
  -H "Authorization: Bearer $OCTOPARSE_API_KEY" \
  "https://api-datahub.octoparse.com/v1/runs/run_c62bc0fb8df2/records?offset=0&limit=100"
```

## Response

### 200 success

```json theme={null}
{
  "data": {
    "run_id": "run_c62bc0fb8df2",
    "dataset_id": "ds_0bd5345d13d0",
    "records": [
      {
        "review_id": "103c9e-0000"
      },
      {
        "review_id": "103c9e-0001"
      }
    ],
    "partial": false,
    "pagination": {
      "offset": 0,
      "limit": 2,
      "count": 2,
      "total": 20,
      "has_more": true
    }
  }
}
```

With `format=jsonl` or `format=csv`, the response body is raw text without the envelope. Pagination parameters still apply.

The payload is wrapped in `data`. Fields:

<ResponseField name="run_id" type="string">
  Run id.
</ResponseField>

<ResponseField name="dataset_id" type="string" required>
  Dataset that holds the result.
</ResponseField>

<ResponseField name="records" type="object[]" required>
  Record array. Each item is shaped by the app `output_schema.record`.
</ResponseField>

<ResponseField name="partial" type="boolean">
  Whether the run partially succeeded or was cancelled.
</ResponseField>

<ResponseField name="pagination" type="object" required>
  Pagination object.

  <Expandable title="fields">
    <ResponseField name="offset" type="integer">
      —
    </ResponseField>

    <ResponseField name="limit" type="integer">
      —
    </ResponseField>

    <ResponseField name="count" type="integer">
      —
    </ResponseField>

    <ResponseField name="total" type="integer">
      —
    </ResponseField>

    <ResponseField name="has_more" type="boolean">
      —
    </ResponseField>
  </Expandable>
</ResponseField>

### Errors

| HTTP | `code`          | `category`  | Description                                                    |
| ---- | --------------- | ----------- | -------------------------------------------------------------- |
| 401  | `unauthorized`  | `forbidden` | Missing or invalid API key.                                    |
| 404  | `run-not-found` | `not_found` | Run does not exist, or was not started by the current account. |

Error responses use `{"error": {code, category, message, retryable}}`. See <a href="/docs/en/datahub/api/reference/introduction#errors">Errors</a>.

## Client libraries

<CodeGroup>
  ```python Python theme={null}
  # Auto-paginate all records
  for record in client.iterate_records("run_c62bc0fb8df2", batch=500):
      print(record)

  # One page
  page = client.get_records("run_c62bc0fb8df2", offset=0, limit=100, fields="title,price")

  # Export the full result as text (jsonl / csv)
  text = client.export_records("run_c62bc0fb8df2", format="csv")
  ```

  ```js JavaScript theme={null}
  // Auto-paginate all records
  for await (const record of client.iterateRecords("run_c62bc0fb8df2", { batch: 500 })) {
    console.log(record);
  }

  // One page
  const page = await client.getRecords("run_c62bc0fb8df2", { offset: 0, limit: 100, fields: "title,price" });

  // Export the full result as text (jsonl / csv)
  const text = await client.exportRecords("run_c62bc0fb8df2", "csv");
  ```
</CodeGroup>
