Skip to main content

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 the 403 thrown when the quota is exceeded), so clients can render quota state without an extra round-trip.

Idempotency

Pass an Idempotency-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 of URL + 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

Idempotent retry — first call runs, second call replays the cached response:
The same 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.
Behavior change. Earlier versions of this endpoint cleared filter_config when it was omitted from the request body. The endpoint now treats omission as “leave unchanged” — consistent with standard PATCH semantics. If you were relying on the old behavior, send "filter_config": null explicitly to clear.

Response

Updated strategy details.

Examples

Replace the filter, leave the output schema unchanged:
Clear the output schema, leave the filter unchanged:
Update both at once:

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 the 403 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/generate
  • POST /api/strategies/generate/stream
  • POST /api/watch
For a pure read of the same numbers without making a creation call, use GET /api/account/quota.

Strategy audit log

Paginated audit log of strategy create and delete events, merged into a single timeline (most recent first).
The endpoint merges three event sources:
  • created events from currently-active strategies
  • created events from previously-deleted strategies (created within the window, then deleted)
  • deleted events
All 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

Learn more about how fuzzy matching works and best practices for tuning the threshold in the Manifest Comparison concept guide.

Delete strategy

Delete a strategy and all associated jobs and schedules.

Response

Example

This action is irreversible and deletes all associated resources.

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

Need help?

Email me at mckinnon@meter.sh