Skip to main content
Your endpoint serves one catalog API. AnyAPI sends it signed POST requests in that API’s input format, and your endpoint answers in its output format.
APIs open to sellers lists the APIs you can register, with each one’s request, response, and published price. To sell any other API, email support@getanyapi.com.

The request you receive

AnyAPI POSTs the API’s input as JSON to your registered path (default /run):
The body always matches the API’s input JSON Schema. Read it and the output schema from the catalog:
The response includes inputSchema and outputSchema, which the compatibility checks and the live trial judge against. The register dialog in the dashboard shows them too. Redirects are never followed, so answer directly at the registered URL.

Verifying the signature (required)

Every request carries four headers: Recompute the signature over this dot-joined string:
method is POST, path is your registered path, and sha256hex(body) is the lowercase-hex SHA-256 of the raw body bytes. Then:
  1. HMAC-SHA256 the string with the signing secret you got at registration.
  2. Compare it with the header in constant time.
  3. Reject timestamps older than about 5 minutes.
  4. Remember nonces for that window to block replays.
Reject failures with 401 and never process an unverified body.
Rotating the secret (dashboard > endpoint > Rotate secret, or POST /v1/operator/endpoints/{id}/rotate-secret) starts a 24-hour window in which both the old and new secret verify, so you can roll your deployment without dropping requests.

The response you must return

Reply 2xx with JSON that validates against the API’s output schema, in this envelope:
  • Extra fields are kept; missing declared fields fail. Anything beyond the schema is passed to the customer, but every declared field must be present.
  • No result is not an error. When the entity does not exist, return the schema’s found: false shape with a 2xx. That is a valid, billable answer.
  • A non-2xx status, output that does not validate, or a timeout is a failed attempt. The request fails over to another provider, you do not earn it, and repeated failures pause the endpoint.

What you’re paid for

Every answer your endpoint gives is either charged to the customer, and you are paid 80% of what they paid, or free to the customer and unpaid. If the site blocked you, rate limited you, or anything else went wrong, answer with a non-2xx status (429 for a rate limit). Never answer found: false or an empty result for a call you could not make. A found: false may only carry a reason the API’s output schema lists.

Spot-checks

AnyAPI re-runs some of your answers on its own sources, at its own cost, and compares them field by field. Counts, timestamps, and media links can change between two calls and are not compared.
  • How often. Every answer is checked until your record shows you answer falsely under 1% of the time. After that a sample keeps being checked, and a caught answer starts the full checks again. Answers that come back faster than AnyAPI’s own sources can fetch, repeat the same body for different inputs, or carry impossible timestamps are checked more often.
  • A caught answer is unpaid, and what it earned is taken back from your available balance. It counts as a failed request when AnyAPI shares requests among sellers. You get an email naming the request, what was wrong, and what it cost.
  • Repeat offences. If spot-checks catch more than 1% of your sampled answers on an API over 30 days, that endpoint is paused and you are emailed. Reply to that email to talk about turning it back on.

Budgets

How requests reach your endpoint

AnyAPI sends each request to the cheapest source on the API first, whoever runs it. Your endpoint goes ahead of one of AnyAPI’s own sources only when your price is lower; at the same price, AnyAPI’s goes first. Your endpoint gets at most its capacity in requests at once; further requests go to the next cheapest source until one of yours finishes.
  • Capacity is how many requests your endpoint takes at once. Declare it as capacity when you register with POST /v1/operator/endpoints; it defaults to 4. Change it from the endpoint’s page in the dashboard or with POST /v1/operator/endpoints/{id}/capacity and a body of {"capacity": 8}.
  • 429 pauses your endpoint. Answer 429 when you are overloaded. AnyAPI stops sending you requests until your Retry-After has passed, honored as given in seconds or as an HTTP date. Without a usable Retry-After, the pause lasts 60 seconds. Requests during the pause go to other endpoints.
  • The time limit is set per API. AnyAPI sets how long it waits for any seller’s endpoint on each API. The endpoint’s page shows it, and so does timeLimitSeconds in GET /v1/operator/endpoints/{id}. A response after the limit counts as timed out: the buyer is not charged and you are not paid for it.
  • Ahead only while you finish as often. Your endpoint stays ahead of one of AnyAPI’s sources only while the share of its requests it finishes is at least that source’s; otherwise it is asked right after it.
  • Endpoints at the same price share the requests. Each request picks among them at random, weighted by how many paid requests each completed for the time its requests took over the last 30 days. A new endpoint with no traffic yet starts at the average of the endpoints at its price.

What the compatibility checks test

When you run the checks from the dashboard or POST /v1/operator/endpoints/{id}/conformance, AnyAPI sends the API’s schema examples to your endpoint as signed requests and verifies, per request:
  1. HTTP 2xx
  2. Output validates against the output schema
  3. found: true for the example inputs
  4. Answer within the API’s time limit, the same limit live traffic runs under
  5. Body under the 8 MB cap
Every check must pass to enter the live trial, and a pass starts it. A failed run returns a per-check report, and you can rerun without limit. During the live trial, mirrored requests also carry X-AnyAPI-Trial: 1, so you can tell trial traffic from paid traffic in your logs.

How the live trial works

An endpoint in the trial receives up to 500 mirrored real customer requests, paced evenly across 7 days from its first request. Trial traffic is neither billed nor paid. Each trial response is compared with what the customer was served:
  • Agreeing on an empty list, or agreeing on found: false, counts as a pass.
  • A non-2xx, a timeout, or output that does not validate against the schema counts as a failure.
Graduation needs at least 95% of compared requests passing, over at least 200 compared requests spanning at least 7 days, with no fabricated or injected content. A fix shipped part-way through the trial is measured by the remaining paced requests, so a bad first day is not permanent.