prepare_domain
Prepares a domain for extraction after a domain_not_prepared error by submitting the host and 1–5 example URLs, then checking status before retrying extraction.
Instructions
Prepare a domain so extract (mode=auto) works on it.
Use this when extract returns error REQS007 with reason domain_not_prepared. Send the domain (the host, e.g. shop.example.com; a leading www. is dropped, and each host is prepared separately) and 1 to 5 example URLs of real pages you want extracted. One works; we recommend 3 or more of the same page type, so pass 3 or more when you can, up to 5 (e.g. 3 product pages: https://www.example.com/products/a, /products/b and /products/c), because Extract compares pages of one type to check the fields it found and fill in fields one page is missing. Several page types can share the 5 (e.g. 3 product pages + 2 search-result pages). It returns at once with status "preparing" and never waits; preparation takes a few minutes and costs no credits. Then call prepared_domain_status about every 30 seconds until status is "ready", and call extract again. Each new domain uses one slot of the account's monthly allowance (prepared_domain_status shows it). A domain already being prepared returns its current status; a domain already prepared returns "ready" at once with already_prepared: true and uses no slot.
Do not call this for REQS007 with reason page_not_recognised: the domain is already prepared and preparing again does not change that answer.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | The host to prepare, e.g. shop.example.com (a URL is accepted; a leading www. is dropped) | |
| example_urls | Yes | 1 to 5 full URLs of real pages on this domain that you want to extract. One works; we recommend 3 or more of the same page type when you can | |
| idempotency_key | No | Optional. Resending the same key with the same body returns the original submission |