> ## 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.

# 실행 레코드 조회

> 실행 레코드 페이지 조회. JSON/JSONL/CSV 지원.

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

인증: API 키 필요(`Authorization: Bearer <API Key>`).

실행 산출 레코드를 페이지로 읽음. `format`은 `json`(기본, 페이지매김), `jsonl`, `csv`. `fields`는 쉼표 구분 열 지정.

실행 중에도 읽기 가능. 지금까지 분이 반환되고 `pagination.total`은 계속 증가. 전체는 종료 대기. `partial`은 부분 성공/취소 시 `true`. 해당 레코드는 유효·과금됨.

본인이 시작한 실행만 읽기 가능. 다른 계정 `run_id`와 없는 `run_id`는 모두 `404`.

## 요청

### 경로 파라미터

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

### 쿼리 파라미터

<ParamField query="offset" type="integer" default="0">
  페이지 오프셋.

  범위 ≥ 0.
</ParamField>

<ParamField query="limit" type="integer" default="100">
  페이지 크기, 최대 10000.

  범위 1\~10000.
</ParamField>

<ParamField query="format" type="string" default="json">
  출력 형식. `json`은 페이지매김 엔벨로프. `jsonl`은 줄당 1레코드. `csv`는 표 형식.

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

<ParamField query="fields" type="string">
  쉼표 구분 필드명. 해당 열만. 예: `title,price,url`.
</ParamField>

### 요청 예시

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

## 응답

### 200 성공

```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
    }
  }
}
```

`jsonl`/`csv`는 엔벨로프 없는 원시 텍스트. 페이지 파라미터 유효.

페이로드는 `data`로 감쌉니다. 필드:

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

<ResponseField name="dataset_id" type="string" required>
  결과를 담는 데이터셋.
</ResponseField>

<ResponseField name="records" type="object[]" required>
  레코드 배열. 각 항목은 `output_schema.record` 형태.
</ResponseField>

<ResponseField name="partial" type="boolean">
  부분 성공 또는 취소 여부.
</ResponseField>

<ResponseField name="pagination" type="object" required>
  페이징 객체.

  <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>

### 오류

| HTTP | `code`          | `category`  | 설명                  |
| ---- | --------------- | ----------- | ------------------- |
| 401  | `unauthorized`  | `forbidden` | API 키 누락 또는 무효.     |
| 404  | `run-not-found` | `not_found` | 실행 없거나 현재 계정 시작 아님. |

오류 응답은 `{"error": {code, category, message, retryable}}`입니다. <a href="/docs/ko/datahub/api/reference/introduction#errors">오류</a> 참고.

## 클라이언트 라이브러리

<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>
