Strategy Endpoints
Create and manage AI-generated extraction strategies via HTTP.Generate strategy
Generate a new extraction strategy using AI.Request body
Response
Response headers
This endpoint returns strategy quota headers on every response (success and the403 thrown when the quota is exceeded),
so clients can render quota state without an extra round-trip.
Idempotency
Pass anIdempotency-Key: <string> header to make retries safe — the server
caches the response for 24 hours and replays it on subsequent requests with
the same key. Cached replays do not run a new LLM job and do not consume
additional quota.
Notes:
- Keys are scoped per user / API key, so two accounts cannot collide on the same string.
- Use a client-generated unique value (e.g.
uuidgen, or a stable hash ofURL + description + run-id). Two semantically-equivalent retries must reuse the same key. - Pair this with your own retry-on-5xx logic to avoid duplicate strategies (and quota burn) on transient timeouts.
- The 24h TTL is fixed and not configurable.
Example
Idempotency-Key is also honored on POST /api/strategies/generate/stream.
Refine strategy
Improve an existing strategy with feedback.Request body
Response
Same as generate strategy response with updated preview data.Example
List strategies
Get all strategies for the authenticated user.Query parameters
Response
Example
Get strategy
Get details for a specific strategy.Response
Same format as list strategies items.Example
Update strategy
Update a strategy’s filter configuration and/or output schema.Request body
PATCH semantics
Each field follows three-state PATCH semantics:
This applies independently to both
filter_config and output_schema. To clear only one, send null for that field and omit the other.
Response
Updated strategy details.Examples
Replace the filter, leave the output schema unchanged:Strategy quota headers
Every response from a strategy-creation endpoint includes headers describing the caller’s current standing against the rolling 30-day strategy quota. These ride on successful responses and on the403 thrown when the quota
is exceeded, so a client can render quota state from any creation call
without an extra round-trip.
These headers are emitted by:
POST /api/strategies/generatePOST /api/strategies/generate/streamPOST /api/watch
GET /api/account/quota.
Strategy audit log
Paginated audit log of strategy create and delete events, merged into a single timeline (most recent first).createdevents from currently-active strategiescreatedevents from previously-deleted strategies (created within the window, then deleted)deletedevents
created events have counted_against_quota: true (every created
strategy consumed one slot of the rolling 30-day quota, whether or not it
was later deleted). deleted events have counted_against_quota: false —
they are tracking-only and do not consume quota.
Query parameters
Response
Example
Compare manifest
Compare a manifest of known items against the latest scrape results for a strategy. This is a convenience endpoint that automatically uses the most recent completed job.Request body
Response
Example
Delete strategy
Delete a strategy and all associated jobs and schedules.Response
Example
Error responses
See REST API Errors for detailed error handling.
Next steps
Job Endpoints
Execute scrapes using strategies
Python SDK
Use the Python SDK instead
Strategies Concept
Learn about strategies