Skip to main content
By default AnyAPI picks the cheapest source that can serve your request, and falls back to the next if it fails. Use source, allowFallbacks, and ignoreSources when you want a say in which sources may serve it. Every API accepts these three optional fields in the request body, next to its normal input. They apply to one request only. There is no account-wide or per-key setting.

Find source ids

Source ids are published in lanes[].source.id on GET /catalog, no key needed, and on /apis:

The default: cheapest serves

Without any of the fields, the cheapest source serves and failover is automatic.

Allow only some sources

To allowlist sources, send source with allowFallbacks: false:
Only the listed sources may serve. If none of them is serving, the request is refused with no charge. If they are tried and all fail, it fails like any other request. With a single source and allowFallbacks: false, only that source serves, at its price. You are quoted and charged exactly that price, with no failover.

Skip sources

Send ignoreSources to skip sources for this request:
The cheapest remaining source serves.

Prefer without restricting

source on its own is a preference:
The listed sources are tried first, in the order you give. After them, any other source may serve at the normal price. An empty list or null counts as if you left the field out.

Errors

None of these charge you. The 400s return code: "invalid_input" with an error message that starts with source_unknown:, gives the reason, and lists the valid source ids for the API.

Pagination

To keep the restriction on every page, send the same source and allowFallbacks: false with each page’s cursor. The list must include the source that served page one, or the request is rejected with HTTP 400. See Pagination.

Example

Every successful response includes a source object (id, name, kind, artworkKey) for the source that served, so you can reuse its id on your next call. These fields combine with preferLatencyUnderMs; see Speed and price.