# Receipts and fetch facts

> What the receipt_id and fetch facts on every task record, and the full provenance receipt on Crawl API pages, including robots.txt and AI-use signals.

Every billed request leaves a receipt: what was fetched, how, when, and what it cost. How much the receipt holds depends on the route.

## Fetch facts on every compatible task

The last five fields of every task in the DataForSEO envelope are ours:

| Field | Type | Meaning |
|---|---|---|
| `receipt_id` | string | The id of this task's charge. It matches a line in **Dashboard → Billing**. |
| `fetch_level` | `standard` \| `rendered` \| `protected` \| null | The level that delivered the data. `null` where an endpoint has no levels (Google SERP) or nothing was delivered. |
| `upgraded` | boolean | The task cost more than the included price because it needed a higher level or the live SERP source. |
| `upgrade_reason` | string \| null | Why, in our level names and HTTP facts: `"403 at standard; challenge page at standard"`. |
| `cache_hit` | boolean | The result came from the shared cache. `result.fetched_at` gives the original fetch time. |

The Scale SERP shape carries the same fields in `request_info`, the Outscraper shape at the top level, and the Apify shape on every item (`receipt_id`) and in the `X-Receipt-Id` response header.

## The full receipt on Crawl API pages

`POST /v1/crawls`, `/v1/crawls/batch` and `GET /v1/crawls/{id}` attach a provenance receipt to each page. Read receipts alone with `GET /v1/crawls/{id}/receipt`.

```json
{
  "receipt_id": "rc_1f0c6b2e9d8a4c51b2a7e3f40c9d1e22",
  "source_url": "https://example.com/pricing",
  "fetched_at": "2026-12-03T09:00:00Z",
  "http_status": 200,
  "content_sha256": "9f2b5c...",
  "content_check": "substantive",
  "content_check_reasons": ["visible_text_chars:3120"],
  "robots_txt": "allowed",
  "ai_use_signal": "none_declared",
  "ai_use_details": {},
  "engine": "standard",
  "fetch_level": "rendered",
  "fetch_method": "rendered",
  "upgraded": true,
  "upgrade_reason": "403 at standard",
  "unit_cost_usd": 0.0011,
  "billed_usd": 0.0011,
  "billed_pages": 1,
  "cost_breakdown": { "base": 0.00011, "upgrade": 0.00099 },
  "currency": "USD"
}
```

| Field | Values | Meaning |
|---|---|---|
| `source_url` | URL | What you asked for. |
| `fetched_at` | ISO 8601 | When we fetched it. `null` if it was never fetched. |
| `http_status` | integer | The status the site returned. |
| `content_sha256` | hex | SHA-256 of the fetched content, so you can show the text hasn't changed since. |
| `content_check` | `substantive`, `blocked`, `login_wall`, `error_page`, `empty_shell` | Whether the page is real content. A page that isn't `substantive` costs $0. |
| `content_check_reasons` | list | The signals behind the verdict. |
| `robots_txt` | `allowed`, `disallowed`, `not_found`, `unchecked` | What the site's robots.txt says about this path. Recorded, not enforced: the page is fetched either way. |
| `ai_use_signal` | `none_declared`, `reserved`, `partially_reserved`, `unknown`, `unavailable`, `not_checked` | The site's declared position on AI use. |
| `ai_use_details` | object | The robots.txt rules for AI bots (such as `GPTBot`, `ClaudeBot`, `PerplexityBot`), TDM reservations and `ai.txt` behind the signal. |
| `engine` | `standard`, `rendered` | The level you requested. |
| `fetch_level` / `fetch_method` | `standard`, `rendered`, `protected` | The level that delivered the page. |
| `billed_usd`, `cost_breakdown` | numbers | What you paid, split into the base price and the upgrade. |

`POST /v1/serp` returns a receipt with the same provenance and cost fields, `fetch_method: "serp_api"`, and `null` for the page-only fields (`content_check`, `robots_txt`, `ai_use_signal`).

## Using receipts

- **Audit a charge.** Every line in billing history has the `receipt_id`, product, mode, fetch level, upgrade reason and amount.
- **Keep provenance with your data.** Store `source_url`, `fetched_at`, `content_sha256` and `ai_use_signal` next to each document in your index. The Python SDK's LangChain and LlamaIndex loaders do this for you; see [SDKs](https://dataforgaio.com/docs/sdks.md).
- **Respect AI-use signals in your own pipeline.** `robots_txt` and `ai_use_signal` tell you what the site declared. Decide in your code what to keep.
