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

# List runs

> List every run you started. Filter by status, app, credential, channel, kind, and time range.

**`GET`** `https://api-datahub.octoparse.com/v1/runs`

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

All runs you started. Ownership is by **account**: runs started with an API key, SDK, MCP, or web login appear in the same list. Always newest-first by start time. `pagination.total` is the filtered total.

Filters can be combined. `status` accepts comma-separated values (OR). `credential` is the non-sensitive stable id of the starting credential, useful for tracking which key is consuming quota. `created_from` / `created_to` use start time, start inclusive and end exclusive. The vocabulary matches <a href="/docs/en/datahub/api/reference/account/get-billing">Billing aggregation</a>: pass a billing group key through unchanged to drill into the matching runs.

Each item includes `billing` and `usage`, so per-run reconciliation does not need a separate detail call. Input echo redaction matches run detail.

## Request

### Query parameters

<ParamField query="status" type="string">
  Run state. Comma-separated multi-value. Values outside the vocabulary return `400`.
</ParamField>

<ParamField query="credential" type="string">
  Stable id of the starting credential. Take the value from billing aggregation `group_by=credential` → `credential`.
</ParamField>

<ParamField query="data_app" type="string">
  App reference: `<namespace>/<app_name>` or `app_<hex>`.
</ParamField>

<ParamField query="triggered_by" type="string">
  Start channel, for example `api` / `sdk` / `mcp` / `cli` / `web`.
</ParamField>

<ParamField query="created_from" type="string">
  Start-time lower bound, inclusive. Absolute ISO-8601 timestamp.
</ParamField>

<ParamField query="created_to" type="string">
  Start-time upper bound, exclusive.
</ParamField>

<ParamField query="run_kind" type="string">
  `production` for normal runs; `test` for author debug runs.

  Values: `test` / `production`.
</ParamField>

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

  Range ≥ 0.
</ParamField>

<ParamField query="limit" type="integer" default="50">
  Page size, max 200.

  Range 1 to 200.
</ParamField>

### Example request

```bash theme={null}
curl \
  -H "Authorization: Bearer $OCTOPARSE_API_KEY" \
  "https://api-datahub.octoparse.com/v1/runs?data_app=carol/probe-b&status=SUCCEEDED,PARTIALLY_SUCCEEDED&limit=50"
```

## Response

### 200 success

```json theme={null}
{
  "data": {
    "items": [
      {
        "run_id": "run_3b750088f51c",
        "namespace": "carol",
        "app_name": "probe-b",
        "app_version": "0.1.0",
        "build_id": null,
        "run_kind": "production",
        "state": "RUNNING",
        "input": {
          "product": "p-doc"
        },
        "progress": {
          "done": 0,
          "total": null,
          "status_text": null
        },
        "dataset_id": "ds_ec3ba97b8534",
        "partial": false,
        "cancel_requested": false,
        "triggered_by": "api",
        "upstream_ref": null,
        "created_at": "2026-09-15T07:45:41.876601+00:00",
        "started_at": "2026-09-15T07:45:41.883082+00:00",
        "first_started_at": "2026-09-15T07:45:41.883082+00:00",
        "finished_at": null,
        "usage": {
          "metrics": {
            "records_collected": 0
          },
          "duration_ms": null
        },
        "billing": {
          "events": [],
          "total": 0.0,
          "currency": "USD",
          "charged": false
        },
        "error": null
      },
      "…"
    ],
    "pagination": {
      "offset": 0,
      "limit": 2,
      "count": 2,
      "total": 2,
      "has_more": false
    }
  }
}
```

The payload is wrapped in `data`. Fields:

<ResponseField name="items" type="object[]" required>
  Run list. Each item matches run detail fields (without `sample_records`).

  <Expandable title="fields">
    <ResponseField name="run_id" type="string" required>
      —
    </ResponseField>

    <ResponseField name="namespace" type="string">
      —
    </ResponseField>

    <ResponseField name="app_name" type="string">
      —
    </ResponseField>

    <ResponseField name="app_version" type="string">
      —
    </ResponseField>

    <ResponseField name="build_id" type="string">
      —
    </ResponseField>

    <ResponseField name="run_kind" type="string">
      —
    </ResponseField>

    <ResponseField name="state" type="enum" required>
      Values: `PENDING` / `QUEUED` / `RUNNING` / `SUCCEEDED` / `PARTIALLY_SUCCEEDED` / `FAILED` / `CANCELLED` / `EXPIRED`.
    </ResponseField>

    <ResponseField name="input" type="object">
      —
    </ResponseField>

    <ResponseField name="progress" type="object">
      —

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

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

        <ResponseField name="status_text" type="string">
          —
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="dataset_id" type="string">
      —
    </ResponseField>

    <ResponseField name="partial" type="boolean">
      —
    </ResponseField>

    <ResponseField name="cancel_requested" type="boolean">
      `true` while cancellation has been requested and the run is still winding down (cooperative stop / partial-result recovery). Always `false` in terminal states (normalized server-side), so clients need not derive it from `state`.
    </ResponseField>

    <ResponseField name="triggered_by" type="string">
      —
    </ResponseField>

    <ResponseField name="upstream_ref" type="string">
      —
    </ResponseField>

    <ResponseField name="created_at" type="string">
      —
    </ResponseField>

    <ResponseField name="started_at" type="string">
      —
    </ResponseField>

    <ResponseField name="first_started_at" type="string">
      When a worker first claimed the run. Unlike `started_at`, this is never rewritten on retry, so it is the anchor for queue time: queued = `first_started_at - created_at`, and total wall time = `finished_at - first_started_at`. Deriving queue time from `started_at` counts earlier attempts as queueing. `null` only for runs never claimed.
    </ResponseField>

    <ResponseField name="finished_at" type="string">
      —
    </ResponseField>

    <ResponseField name="usage" type="object">
      Objective usage metering: how much the run did. Kept separate from billing; this is what evaluations compare against.

      <Expandable title="fields">
        <ResponseField name="metrics" type="object">
          —
        </ResponseField>

        <ResponseField name="duration_ms" type="integer">
          —
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="billing" type="object">
      Billing ledger = usage × pricing × billing rules: how much is charged.

      <Expandable title="fields">
        <ResponseField name="events" type="object[]">
          —
        </ResponseField>

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

        <ResponseField name="currency" type="string">
          —
        </ResponseField>

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

    <ResponseField name="error" type="object">
      —

      <Expandable title="fields">
        <ResponseField name="code" type="string" required>
          —
        </ResponseField>

        <ResponseField name="category" type="string">
          —
        </ResponseField>

        <ResponseField name="message" type="string" required>
          —
        </ResponseField>

        <ResponseField name="retryable" type="boolean">
          —
        </ResponseField>

        <ResponseField name="retry_after" type="number">
          —
        </ResponseField>

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

        <ResponseField name="details" type="object[]">
          —
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="pagination" type="object">
  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.                       |
| 400  | `invalid-status` | `invalid_input` | `status` contains a value outside the vocabulary. |

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
  for r in client.iterate_runs(data_app="carol/probe-b", created_from="2026-09-01T00:00:00+08:00"):
      print(r["run_id"], r["state"], r["billing"]["total"])

  # Use the page form when you need totals
  page = client.list_runs_page(status="QUEUED,RUNNING", limit=50)
  print(page["pagination"]["total"])
  ```

  ```js JavaScript theme={null}
  // Auto-paginate
  for await (const r of client.iterateRuns({ dataApp: "carol/probe-b", createdFrom: "2026-09-01T00:00:00+08:00" })) {
    console.log(r.run_id, r.state, r.billing.total);
  }

  // Use the page form when you need totals
  const page = await client.listRunsPage({ status: "QUEUED,RUNNING", limit: 50 });
  console.log(page.pagination.total);
  ```
</CodeGroup>
