# Get a crawl

`GET /v1/crawls/{id}`

A batch job and its tasks, or one task, with content and receipts.

Family: Crawl API

## Price

Unit: request

Free. Pages were billed when they were fetched.

## Description

`{id}` is a batch `job_…` id or a task `cr_…` id. A single task that robots.txt blocked responds 451; a batch always responds 200 and reports each task's state. Free.

## Authentication

HTTP Basic auth: any login, with your `dg_` API key as the password. A `Bearer` token header with the key also works.

## Request

No request body.

| Field | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | A `job_…` or `cr_…` id. |
| `include_receipt` | boolean | no | Include receipts. Defaults to the batch's setting. |

### Example request

```bash
curl -X GET "https://api.dataforgaio.com/v1/crawls/TASK_ID" \
  -u "api:$DATAFORGAIO_API_KEY"
```

## Response

| Field | Type | Description |
|---|---|---|
| `status` | string | Always `ok` for a 2xx response. |
| `job_id` | string | `job_…` for a batch, `cr_…` for a single task. |
| `job_status` | string | `completed` once every task finished, else `queued` or `processing`. one of `queued`, `processing`, `completed` |
| `cost` | number | Sum of the task costs, USD. |
| `tasks_count` | integer | Number of tasks. |
| `tasks_error` | integer | Tasks that failed or were blocked. |
| `tasks` | array<object> | The tasks. |
| `tasks.id` | string | Task id, `cr_…`. Use it with GET /v1/crawls/{id}. |
| `tasks.status` | string | Task state. one of `completed`, `failed`, `blocked`, `queued`, `processing` |
| `tasks.status_code` | integer | HTTP-style code for this task: 200 completed, 451 blocked by robots.txt, 422 invalid target or over `max_cost`, 502 upstream error, 503 level unavailable, 202 queued or processing. |
| `tasks.status_message` | string | Plain-language status. For a completed but non-substantive page, says why. |
| `tasks.cost` | number | What this task was charged, USD. |
| `tasks.fetch_level` | string\|null | The level that delivered the page. Null until a page was delivered. one of `standard`, `rendered`, `protected` |
| `tasks.upgraded` | boolean | True when Auto-upgrade moved past the requested level. |
| `tasks.upgrade_reason` | string | Why it upgraded, for example `403 at standard`. Empty when it didn't. |
| `tasks.content` | object | The page. Present when `status` is `completed`. |
| `tasks.content.title` | string | Page title. |
| `tasks.content.markdown` | string | Page as Markdown, for `output_format: markdown`. |
| `tasks.content.html` | string | Page HTML, for `output_format: html`. |
| `tasks.content.json` | object | Title, text and metadata, for `output_format: json`. |
| `tasks.error` | object | Present when `status` is `failed` or `blocked`. |
| `tasks.error.http_status` | integer | Same as `status_code`. |
| `tasks.error.code` | string | Error code, for example `blocked_by_policy` or `upstream_error`. |
| `tasks.receipt` | object | Provenance and cost. Present unless `include_receipt` is false. |
| `tasks.receipt.receipt_id` | string | Receipt id, `rc_…`. |
| `tasks.receipt.source_url` | string | The URL that was requested. |
| `tasks.receipt.fetched_at` | string\|null | When the page was fetched, ISO 8601 UTC. Null when it wasn't fetched. |
| `tasks.receipt.http_status` | integer\|null | HTTP status the site returned. |
| `tasks.receipt.content_sha256` | string\|null | SHA-256 of the content we returned, so you can prove what you saw. |
| `tasks.receipt.content_check` | string\|null | Whether the page is real content: `substantive`, or why not. one of `substantive`, `blocked`, `login_wall`, `error_page`, `empty_shell` |
| `tasks.receipt.content_check_reasons` | array<string> | Signals behind a non-substantive verdict. |
| `tasks.receipt.robots_txt` | string\|null | What the site's robots.txt says about this path for our crawler. one of `allowed`, `disallowed`, `not_found`, `unreachable` |
| `tasks.receipt.ai_use_signal` | string\|null | The site's declared stance on AI use, from robots.txt, meta tags, headers and its terms, for example `none_declared` or `opt_out`. |
| `tasks.receipt.ai_use_details` | object | Where each AI-use signal was found. |
| `tasks.receipt.engine` | string | The level you asked to start at. one of `standard`, `rendered` |
| `tasks.receipt.fetch_level` | string\|null | The level that delivered the page. Null until a page was delivered. one of `standard`, `rendered`, `protected` |
| `tasks.receipt.upgraded` | boolean | True when Auto-upgrade moved past the requested level. |
| `tasks.receipt.upgrade_reason` | string | Why it upgraded, for example `403 at standard`. Empty when it didn't. |
| `tasks.receipt.fetch_method` | string | Same as `fetch_level`, or `engine` when nothing was delivered. |
| `tasks.receipt.unit_cost_usd` | number\|null | What this page was charged, in USD. Null until the task has run. |
| `tasks.receipt.billed_usd` | number\|null | Same as `unit_cost_usd`. |
| `tasks.receipt.billed_pages` | integer\|null | 1 when the page was billed, 0 when it cost nothing. |
| `tasks.receipt.cost_breakdown` | object\|null | The charge split into the base page price and what an upgrade added. |
| `tasks.receipt.cost_breakdown.base` | number | Base page price, USD. |
| `tasks.receipt.cost_breakdown.upgrade` | number | Added by Auto-upgrade, USD. |
| `tasks.receipt.currency` | string | Always `USD`. |

### Example response

```json
{
  "status": "ok",
  "job_id": "job_8cbb5b5c8e155c82995945f93cdad009",
  "job_status": "completed",
  "cost": 0.00011,
  "tasks_count": 2,
  "tasks_error": 1,
  "tasks": [
    {
      "id": "cr_744695e7dd8a5016bb2b2d314ea9ef81",
      "status": "completed",
      "status_code": 200,
      "status_message": "Ok.",
      "cost": 0.00011,
      "fetch_level": "standard",
      "upgraded": false,
      "upgrade_reason": "",
      "content": {
        "title": "Trail running shoes",
        "markdown": "# Trail running shoes\n\nEvery trail shoe we stock comes with free gait analysis and 60-day returns."
      },
      "receipt": {
        "source_url": "https://summitrunning.example/trail-shoes",
        "fetched_at": "2026-12-03T10:42:18Z",
        "http_status": 200,
        "content_sha256": "9f2c4a1b7e0d3c58a6b1f4e2d7c9a0b3e5f8d1c4a7b0e3f6d9c2a5b8e1f4d7c0",
        "content_check": "substantive",
        "content_check_reasons": [],
        "robots_txt": "allowed",
        "ai_use_signal": "none_declared",
        "ai_use_details": {},
        "engine": "standard",
        "fetch_level": "standard",
        "upgraded": false,
        "upgrade_reason": "",
        "unit_cost_usd": 0.00011,
        "billed_usd": 0.00011,
        "currency": "USD",
        "receipt_id": "rc_744695e7dd8a5016bb2b2d314ea9ef81",
        "fetch_method": "standard",
        "billed_pages": 1,
        "cost_breakdown": {
          "base": 0.00011,
          "upgrade": 0
        }
      }
    },
    {
      "id": "cr_1160aaf84d8d5ca6a414351f2a73b5ab",
      "status": "blocked",
      "status_code": 451,
      "status_message": "Not fetched: robots.txt at https://summitrunning.example/robots.txt disallows /cart/.",
      "cost": 0,
      "fetch_level": null,
      "upgraded": false,
      "upgrade_reason": "",
      "error": {
        "http_status": 451,
        "code": "blocked_by_policy"
      },
      "receipt": {
        "source_url": "https://summitrunning.example/cart/checkout",
        "fetched_at": null,
        "http_status": null,
        "content_sha256": null,
        "content_check": null,
        "content_check_reasons": [],
        "robots_txt": "disallowed",
        "ai_use_signal": "none_declared",
        "ai_use_details": {},
        "engine": "standard",
        "fetch_level": null,
        "upgraded": false,
        "upgrade_reason": "",
        "unit_cost_usd": 0,
        "billed_usd": 0,
        "currency": "USD",
        "receipt_id": "rc_1160aaf84d8d5ca6a414351f2a73b5ab",
        "fetch_method": "standard",
        "billed_pages": 0,
        "cost_breakdown": {
          "base": 0,
          "upgrade": 0
        }
      }
    }
  ]
}
```

## Errors

| Code | When |
|---|---|
| unauthorized | HTTP 401. Missing, malformed or revoked API key. |
| not_found | HTTP 404. No job, task or tracker with that id in your organization. |
| rate_limited | HTTP 429. Too many requests, or too many inline requests in flight for your organization. Honor `Retry-After`. |

## Related

- [Crawl a page](https://dataforgaio.com/docs/api/crawls-create.md): Fetch one page now and get its content with a receipt: where and when it was fetched, what robots.txt and the site's AI-use signals said, a content hash and the cost.
- [Crawl a batch](https://dataforgaio.com/docs/api/crawls-batch.md): Queue up to 100 URLs in one request; poll the job or get it at your webhook.
- [Get crawl receipts](https://dataforgaio.com/docs/api/crawls-receipt.md): Just the receipts for a job or task, one per page.
