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

# Elenca esecuzioni

> Elenca ogni esecuzione avviata da te. Filtra per stato, app, credenziale, canale, kind e intervallo di tempo.

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

Autenticazione: API key obbligatoria (`Authorization: Bearer <API Key>`).

Tutti i run che hai avviato. La proprietà è per **account**: i run avviati con API key, SDK, MCP o accesso web compaiono nella stessa lista. Sempre dal più recente per ora di avvio. `pagination.total` è il totale filtrato.

I filtri si possono combinare. `status` accetta valori separati da virgola (OR). `credential` è l’id stabile non sensibile della credenziale di avvio, utile per tracciare quale key consuma quota. `created_from` / `created_to` usano l’ora di start, inizio inclusivo e fine esclusiva. Il vocabolario allinea <a href="/docs/it/datahub/api/reference/account/get-billing">Aggregazione fatturazione</a>: passa invariata una group key di billing per fare drill-down sulle run corrispondenti.

Ogni elemento include `billing` e `usage`, quindi la riconciliazione per singolo run non richiede una chiamata di dettaglio separata. L'oscuramento dell'eco dell'input corrisponde a quello del dettaglio del run.

## Richiesta

### Parametri di query

<ParamField query="status" type="string">
  Stato del run. Valori multipli separati da virgole. I valori fuori dal vocabolario restituiscono `400`.
</ParamField>

<ParamField query="credential" type="string">
  ID stabile della credenziale di avvio. Prendi il valore dall'aggregazione della fatturazione `group_by=credential` → `credential`.
</ParamField>

<ParamField query="data_app" type="string">
  Riferimento all'app: `<namespace>/<app_name>` o `app_<hex>`.
</ParamField>

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

<ParamField query="created_from" type="string">
  Limite inferiore dell'ora di avvio, incluso. Timestamp assoluto ISO-8601.
</ParamField>

<ParamField query="created_to" type="string">
  Bound superiore start-time, esclusivo.
</ParamField>

<ParamField query="run_kind" type="string">
  `production` per run normali; `test` per run di debug dell’autore.

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

<ParamField query="offset" type="integer" default="0">
  Offset di paginazione.

  Intervallo ≥ 0.
</ParamField>

<ParamField query="limit" type="integer" default="50">
  Dimensione pagina, max 200.

  Intervallo da 1 a 200.
</ParamField>

### Esempio di richiesta

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

## Risposta

### 200 successo

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

Il payload è wrappato in `data`. Campi:

<ResponseField name="items" type="object[]" required>
  Elenco dei run. Ogni elemento corrisponde ai campi del dettaglio del run (senza `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>
      Valori: `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` mentre l'annullamento è stato richiesto e il run è ancora in fase di chiusura (arresto cooperativo / recupero dei risultati parziali). Sempre `false` negli stati terminali (normalizzato lato server), quindi i client non devono ricavarlo da `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">
      Quando un worker ha claimato la run la prima volta. A differenza di `started_at` non viene mai riscritto al retry: ancora per il tempo in coda: queued = `first_started_at - created_at`, wall time totale = `finished_at - first_started_at`. Derivare il tempo in coda da `started_at` conta i tentativi precedenti come queueing. `null` solo per run mai claimate.
    </ResponseField>

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

    <ResponseField name="usage" type="object">
      Metering usage oggettivo: quanto ha fatto la run. Separato dalla fatturazione; è ciò che le evaluation confrontano.

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

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

    <ResponseField name="billing" type="object">
      Registro di fatturazione = utilizzo × prezzi × regole di fatturazione: quanto viene addebitato.

      <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">
  Oggetto di paginazione.

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

### Errori

| HTTP | `code`           | `category`      | Descrizione                                        |
| ---- | ---------------- | --------------- | -------------------------------------------------- |
| 401  | `unauthorized`   | `forbidden`     | API key mancante o non valida.                     |
| 400  | `invalid-status` | `invalid_input` | `status` contiene un valore fuori dal vocabolario. |

Le risposte di errore usano `{"error": {code, category, message, retryable}}`. Vedi <a href="/docs/it/datahub/api/reference/introduction#errors">Errori</a>.

## Librerie client

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