Skip to content

Making requests

This page covers the conventions every route shares. The API reference documents each operation, and the OpenAPI document is the authoritative schema.

Setup

export EXTRALT_API_KEY="your-api-key"
export EXTRALT_API_URL="https://api.extralt.com/v1"

JSON requests

Send request bodies as JSON with Content-Type: application/json. Fields use snake_case. Another content type returns 415.

curl -s -X POST "$EXTRALT_API_URL/runs" \
  -H "Authorization: Bearer $EXTRALT_API_KEY" \
  -H "Idempotency-Key: run-start-example-1" \
  -H "Content-Type: application/json" \
  -d '{
    "store_id": "example-store.com-US",
    "budget": 100
  }' | jq

Creating an Import is the exception: the body is the catalog file itself, and its settings are query parameters. See Imports.

A request body can be up to 10 MiB; a larger one returns 413.

Do not infer response casing or optionality from a request example. Generate types from the OpenAPI document or validate responses against its schemas.

Idempotency keys

Writes that create work require an Idempotency-Key header:

RouteOperation
POST /v1/storesAdd a Store
POST /v1/runsStart a Run
POST /v1/runs/{id}/restartRestart a Run
POST /v1/schedulesCreate a Schedule
POST /v1/importsCreate an Import
POST /v1/webhooksCreate a webhook

The other writes take no key: marking a Store as your own (PATCH), untracking a Store, updating a Schedule (PATCH), stopping a Run, pausing or resuming a Schedule, deleting, and sending a webhook test.

Use one unique key per logical operation, and send the same key when you retry it:

  • A key is 1 to 255 visible ASCII characters. A missing or malformed key returns 400.
  • Extralt keeps a key for 24 hours from its first request. Within that time, retrying with the same key and the same request returns the first request's resource, read as it is now, without doing the work again.
  • Reusing a key for a different request returns 409 Conflict. Keys are shared by every route of the organization, so do not reuse one across operations.
  • After 24 hours the key is forgotten, and a request with it starts new work.

For an Import, the request compared is the file, its Content-Type and its query parameters. For a webhook, a retry returns the signing secret again.

A retry of a completed request still returns its result after a subscription ends; a new request then returns 402. See Subscriptions and access.

Asynchronous work

A Store's crawler, Runs and Imports take time. Their create request returns at once, and the work continues in the background: a Run or Import with 202 Accepted, a new Store with 201 Created. Adding a Store your organization already has returns it with 200 OK, and checks it again if its crawler is none or failed.

Read the resource until it reaches a final state:

ResourceRead untilFinal states
Storecrawler.status is finalready, failed
Runfinished is truecompleted, stopped, failed
Importfinished is truecompleted, validation_failed, failed

Keep the Run or Import id: its PDPs name it as their source.id, and listing or exporting them takes it. The API has no route that lists Imports.

Poll with a bounded delay, as in Waiting for a Run, or receive a webhook when the work finishes.

Lists

List routes take a limit and, when they page, a cursor. Schedules take only these two. Stores also take max_staleness_days, Runs finished_since, and PDPs run_id, import_id, store_id, listing_id, url and latest. Explore routes take the filters the API reference lists for each. Prefer the narrowest server-side filter over downloading a whole collection and filtering it yourself.

curl -s "$EXTRALT_API_URL/pdps" \
  --url-query "run_id=$RUN_ID" \
  -H "Authorization: Bearer $EXTRALT_API_KEY" | jq

A route that pages returns next_cursor: pass it back as cursor until it is null. See Pagination.

Page sizes

A limit outside the route's range returns 400.

RouteDefaultMaximumNext page
GET /v1/stores, /v1/runs, /v1/schedules100100next_cursor
GET /v1/pdps50100next_cursor
GET /v1/changes, /v1/markets, /v1/variants/{id}/history1001,000next_cursor
GET /v1/variants/{id}/offers1001,000None; has_more says more exist
GET /v1/activity/events10100None
GET /v1/analyses/*100 evidence rows1,000None
GET /v1/facets50 per dimension100None
GET /v1/search25 results, no limit25None; has_more says more exist
GET /v1/webhooksEvery webhook, no limitNone

An Analysis does not page: its summary, coverage and freshness always cover the complete scope, and limit bounds only the evidence rows in data. To get every PDP of one Run or Import, use the export rather than paging.

Status codes

Check the status before reading a success body. Every error uses the same envelope, { "error": { "code", "message", "request_id" } }: branch on its code, and keep the request_id when you contact support. Error codes lists every status and code, with what to do about each.

Retry reads freely after a delay. Retry a create or restart only with its original Idempotency-Key and the same request.