openapi: 3.2.0 info: contact: email: support@getanyapi.com description: 'Any API, one wallet, USD, no subscriptions. Each API is a single discovered operation: send the normalized input, get a normalized result. Prices and payment outcomes are reported in USD; each operation documents the settlement policy for its enabled payment rails.' title: Any Ahrefs API version: 1.0.0 x-guidance: 'Use each operation''s published method and path with its normalized JSON input (see the operation requestBody). Before setting a client or tool timeout, GET /v1/apis/{sku} and inspect its trailing-30-day latency p50/p95/p99 and sample; p99 is an observation, not a maximum. To pay: send your AnyAPI key (Authorization: Bearer, billed from your USD wallet). For operations that advertise an inline rail, pay per call inline with x402 - call with no key, receive HTTP 402 with a PAYMENT-REQUIRED header, then retry with the PAYMENT-SIGNATURE header (base, no account needed); or pay per call inline with MPP (Machine Payments Protocol) - call with no key, receive HTTP 402 with a WWW-Authenticate: Payment challenge, then retry with the Authorization: Payment header (tempo, no account needed). x402 settles after execution; execution failure is reported as released; mpp settles before execution; execution failure is reported as charged_undelivered.' servers: - url: https://api.getanyapi.com security: - bearerAuth: [] - apiKeyAuth: [] tags: - name: ahrefs x-group: Ahrefs paths: /v1/run/ahrefs.backlinks: post: description: 'Get the referring pages linking to a domain or URL, each with the source page, anchor text, linking domain rating, and page title. **Price:** billed per result - \$21.50 per 1,000 requests base + \$0.00 per 1,000 results, capped at \$21.50 per 1,000 requests. **Routing:** one lane serves this API today, so a failed attempt has nowhere to fail over to. Payment outcome follows the selected rail''s settlement policy. **Catalog:** Ahrefs Backlinks pricing and uptime - live USD price, lane routing, and measured 30-day uptime. Every Ahrefs endpoint.' operationId: ahrefs_backlinks parameters: - description: Optional. Comma-separated keys (dotted paths like `author.name` descend into nested objects) to keep on each result item. Keys are matched relative to each result item after the `data`/`items` envelope is unwrapped, not against the top-level response envelope, so use `jq` to reshape the whole envelope. Shrinks the response without changing cost. in: query name: fields required: false schema: type: string - description: Optional. Cap the number of result rows returned; a `_truncated` note reports how many were withheld so you can page via the API's own `limit`. Does not change cost. in: query name: max_items required: false schema: minimum: 0 type: integer - description: Optional. Return only a structural outline (top-level keys, item counts, and per-field byte sizes) instead of the full data. Does not change cost. in: query name: summary required: false schema: type: boolean - description: 'Optional. A jq expression applied to the result envelope; its output replaces `output` (multiple outputs collect into an array). Reshape freely, e.g. `jq=.data | {title, description, md: .markdown[:3500]}`. Runs sandboxed with a 250ms / 2MB budget; on failure the full result is returned with a `jqError`. Does not change cost.' in: query name: jq required: false schema: type: string - description: Optional. The most you are willing to pay for this one request, in US dollars (for example 0.05). Any route that would charge more than this is not used, so a request only ever runs on something you can afford. If nothing is available at or below your amount, the request is refused before it runs, nothing is charged, and the message tells you the cheapest price per request so you can raise it. Leave it out to accept the normal price. in: query name: max_cost_usd required: false schema: type: string - description: Optional wallet idempotency key, scoped to this customer for 24 hours. When the gateway honors the key, this synchronous in-process execution can continue after the caller disconnects, bounded by its execution deadline. A completed replayable result charges normally exactly once and can be replayed without another provider run or charge. A pending duplicate returns 409 idempotency_in_progress; reuse with different request semantics returns 409 idempotency_conflict. in: header name: Idempotency-Key required: false schema: maxLength: 255 minLength: 1 type: string requestBody: content: application/json: example: mode: exact url: ahrefs.com schema: additionalProperties: false example: mode: exact url: ahrefs.com properties: mode: default: subdomains description: 'Match scope: "exact" for the given URL only, or "subdomains" to include the domain and its subdomains.' enum: - exact - subdomains type: string preferLatencyUnderMs: description: 'Optional; omit it and routing is unchanged, with the cheapest source serving. Prefer sources whose typical response time (median over the trailing 30 days, as published on this endpoint''s lane health) is under this many milliseconds; among those, the cheapest serves. This can raise your price: when the cheapest source misses the target, a faster and dearer one serves, and you are quoted and charged its price. If no source is that fast the request is still served, by whichever source offers the best speed for its price - it is never refused for being slow. Sources we have not timed are tried last. This is a preference, not a guarantee: the median describes past requests and is not a ceiling on this one, and it excludes any wait this request itself asks for. On a paginated walk it applies to the first page only: later pages stay with the source that page chose, at the price it was quoted.' minimum: 1 type: integer url: description: The domain or page URL to find backlinks for (e.g. "ahrefs.com"). type: string required: - url title: Ahrefs backlinks input type: object required: true responses: '200': content: application/json: schema: properties: costUsd: description: USD charged on the original run. On a replay this value is echoed for parity; the replay itself is free. type: number hint: description: 'Optional one-line nudge, absent when there is nothing to say. `large_result:` suggests the fields/max_items/summary/jq controls for a big response. `paging_unavailable:` means this result came from a source that cannot return a `nextCursor`, so it may be INCOMPLETE and cannot be continued - re-run with `requireCursor: true` to be served only by a source that can page, which may cost more per request.' type: string items: description: Number of result rows returned. For per-result SKUs the per-item cost is charged against this count; for input-priced SKUs the charge is per submitted input, independent of this count. type: integer jqError: description: Present only when a `jq` expression failed; `output` then carries the full unshaped result and this explains why the reshape did not apply. type: string output: anyOf: - additionalProperties: false properties: data: oneOf: - type: 'null' - additionalProperties: false properties: items: description: Referring pages that link to the domain or URL. Populated whenever the provider has data for the entity. items: properties: anchor: description: Anchor text of the link. type: string contextAfter: description: Text immediately after the anchor on the referring page. type: string contextBefore: description: Text immediately before the anchor on the referring page. type: string domainRating: description: Ahrefs Domain Rating (0-100) of the linking domain. type: number title: description: Title of the referring page. type: string urlFrom: description: URL of the referring page that contains the link. Populated whenever the provider has data for the entity. type: string x-anyapi-must-populate: true urlTo: description: Target URL the link points to. type: string required: - urlFrom type: object type: array x-anyapi-must-populate: true required: - items type: object found: type: boolean required: - found - data title: Ahrefs backlinks output type: object - type: 'null' description: Normalized output, or null when the replay payload was not retained. provider: description: Always "AnyAPI". type: string replayed: description: True when this response replays the durable result of an earlier run without billing or upstream execution. type: boolean resultId: description: Opaque handle to the full unshaped result, cached ~15 min. Re-shape it for free (fields/max_items/summary/jq) via GET /v1/results/{id}, no re-billing. Absent when the result was too large to cache. type: string required: - output - provider - costUsd - items - replayed type: object description: Normalized result. headers: Idempotency-Replayed: description: Present only when the request carried an Idempotency-Key this gateway honored. "false" means the key was claimed and the run executed freshly; "true" means it replayed a prior identical run and was NOT charged again. Absent means either no key was sent or this gateway does not honor keys, so a retry could be charged twice. schema: enum: - 'false' - 'true' type: string PAYMENT-RESPONSE: description: Inline x402 payment receipt. schema: type: string Payment-Receipt: description: Inline mpp payment receipt. schema: type: string X-PAYMENT-RESPONSE: description: Inline x402 payment receipt. schema: type: string '400': content: application/json: schema: $ref: '#/components/schemas/Error' description: Input did not match the schema, or the upstream rejected the request. '401': content: application/json: schema: $ref: '#/components/schemas/Error' description: Missing or invalid API key. '402': content: application/json: schema: oneOf: - $ref: '#/components/schemas/PaymentRequiredError' - $ref: '#/components/schemas/TrialCapReached' application/problem+json: schema: properties: challengeId: minLength: 1 type: string status: const: 402 type: integer required: - status - challengeId type: object description: Insufficient wallet balance or spend cap, or an inline-payment challenge. Agent trials receive a trial_cap_reached continuation with a live RFC 8628 device authorization. headers: PAYMENT-REQUIRED: description: Inline x402 payment challenge. schema: type: string WWW-Authenticate: description: Inline mpp payment challenge. schema: type: string '404': content: application/json: schema: $ref: '#/components/schemas/Error' description: Unknown SKU, or the upstream had no matching resource. '409': content: application/json: schema: $ref: '#/components/schemas/Error' description: 'Idempotency collision. Codes: idempotency_in_progress means retry after the Retry-After delay; idempotency_conflict means use a new key for different request semantics; idempotency_needs_review means stop retrying and contact AnyAPI support with X-Anyapi-Request-Id.' '422': content: application/json: schema: $ref: '#/components/schemas/Error' description: The request was well formed but this API cannot serve the requested target site; the body's `alternatives` array lists the AnyAPI APIs that can. '429': content: application/json: schema: $ref: '#/components/schemas/Error' description: The upstream was rate limited; inspect `payment` when present before deciding whether to retry. '500': content: application/json: schema: $ref: '#/components/schemas/Error' description: An internal error prevented completion. Inspect payment when present before retrying. '502': content: application/json: schema: $ref: '#/components/schemas/Error' description: Every provider failed with a server/transport error, or inline payment settlement could not be confirmed; inspect `payment` when present before retrying. security: - bearerAuth: [] - apiKeyAuth: [] - {} summary: Ahrefs Backlinks tags: - ahrefs x-mint: href: /api-reference/ahrefs/backlinks x-payment-info: price: currency: USD max: '0.021500' min: '0.021500' mode: dynamic protocols: - x402: asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' network: eip155:8453 payTo: '0x754BD2A6799e766B1E2b9f1Ae7fBdC0CeD96ef13' scheme: exact - mpp: asset: '0x20c000000000000000000000b9537d11c60e8b50' currency: USD intent: charge method: tempo network: tempo payTo: '0x754BD2A6799e766B1E2b9f1Ae7fBdC0CeD96ef13' rail: tempo scheme: exact rails: - headers: challenge: - PAYMENT-REQUIRED credential: - PAYMENT-SIGNATURE - X-PAYMENT receipt: - PAYMENT-RESPONSE - X-PAYMENT-RESPONSE pricing: currency: USD max: '0.021500' min: '0.021500' minimumUsd: '0.001000' mode: dynamic quoteBasis: floor protocol: asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' network: eip155:8453 payTo: '0x754BD2A6799e766B1E2b9f1Ae7fBdC0CeD96ef13' scheme: exact rail: x402 settlement: onExecutionFailure: released onUnknownFinalization: indeterminate timing: after_execution - headers: challenge: - WWW-Authenticate credential: - Authorization receipt: - Payment-Receipt pricing: currency: USD max: '0.021500' min: '0.021500' minimumUsd: null mode: dynamic quoteBasis: funded_ceiling protocol: asset: '0x20c000000000000000000000b9537d11c60e8b50' currency: USD intent: charge method: tempo network: tempo payTo: '0x754BD2A6799e766B1E2b9f1Ae7fBdC0CeD96ef13' rail: tempo scheme: exact rail: mpp settlement: onExecutionFailure: charged_undelivered onVerificationError: indeterminate timing: before_execution /v1/run/ahrefs.keyword_ideas: post: description: 'Get related keyword suggestions for any seed term, each with an Ahrefs difficulty and search-volume bucket. **Price:** billed per result - \$1.65 per 1,000 requests base + \$19.80 per 1,000 results, capped at \$21.50 per 1,000 requests. **Routing:** one lane serves this API today, so a failed attempt has nowhere to fail over to. Payment outcome follows the selected rail''s settlement policy. **Catalog:** Ahrefs Keyword Ideas pricing and uptime - live USD price, lane routing, and measured 30-day uptime. Every Ahrefs endpoint.' operationId: ahrefs_keyword_ideas parameters: - description: Optional. Comma-separated keys (dotted paths like `author.name` descend into nested objects) to keep on each result item. Keys are matched relative to each result item after the `data`/`items` envelope is unwrapped, not against the top-level response envelope, so use `jq` to reshape the whole envelope. Shrinks the response without changing cost. in: query name: fields required: false schema: type: string - description: Optional. Cap the number of result rows returned; a `_truncated` note reports how many were withheld so you can page via the API's own `limit`. Does not change cost. in: query name: max_items required: false schema: minimum: 0 type: integer - description: Optional. Return only a structural outline (top-level keys, item counts, and per-field byte sizes) instead of the full data. Does not change cost. in: query name: summary required: false schema: type: boolean - description: 'Optional. A jq expression applied to the result envelope; its output replaces `output` (multiple outputs collect into an array). Reshape freely, e.g. `jq=.data | {title, description, md: .markdown[:3500]}`. Runs sandboxed with a 250ms / 2MB budget; on failure the full result is returned with a `jqError`. Does not change cost.' in: query name: jq required: false schema: type: string - description: Optional. The most you are willing to pay for this one request, in US dollars (for example 0.05). Any route that would charge more than this is not used, so a request only ever runs on something you can afford. If nothing is available at or below your amount, the request is refused before it runs, nothing is charged, and the message tells you the cheapest price per request so you can raise it. Leave it out to accept the normal price. in: query name: max_cost_usd required: false schema: type: string - description: Optional wallet idempotency key, scoped to this customer for 24 hours. When the gateway honors the key, this synchronous in-process execution can continue after the caller disconnects, bounded by its execution deadline. A completed replayable result charges normally exactly once and can be replayed without another provider run or charge. A pending duplicate returns 409 idempotency_in_progress; reuse with different request semantics returns 409 idempotency_conflict. in: header name: Idempotency-Key required: false schema: maxLength: 255 minLength: 1 type: string requestBody: content: application/json: example: country: us keyword: coffee schema: additionalProperties: false example: country: us keyword: coffee properties: country: default: us description: Two-letter country code that scopes the suggestions (e.g. us, gb, de). type: string keyword: description: The seed keyword to expand into related suggestions (e.g. "coffee"). type: string preferLatencyUnderMs: description: 'Optional; omit it and routing is unchanged, with the cheapest source serving. Prefer sources whose typical response time (median over the trailing 30 days, as published on this endpoint''s lane health) is under this many milliseconds; among those, the cheapest serves. This can raise your price: when the cheapest source misses the target, a faster and dearer one serves, and you are quoted and charged its price. If no source is that fast the request is still served, by whichever source offers the best speed for its price - it is never refused for being slow. Sources we have not timed are tried last. This is a preference, not a guarantee: the median describes past requests and is not a ceiling on this one, and it excludes any wait this request itself asks for. On a paginated walk it applies to the first page only: later pages stay with the source that page chose, at the price it was quoted.' minimum: 1 type: integer required: - keyword title: Ahrefs keyword ideas input type: object required: true responses: '200': content: application/json: schema: properties: costUsd: description: USD charged on the original run. On a replay this value is echoed for parity; the replay itself is free. type: number hint: description: 'Optional one-line nudge, absent when there is nothing to say. `large_result:` suggests the fields/max_items/summary/jq controls for a big response. `paging_unavailable:` means this result came from a source that cannot return a `nextCursor`, so it may be INCOMPLETE and cannot be continued - re-run with `requireCursor: true` to be served only by a source that can page, which may cost more per request.' type: string items: description: Number of result rows returned. For per-result SKUs the per-item cost is charged against this count; for input-priced SKUs the charge is per submitted input, independent of this count. type: integer jqError: description: Present only when a `jq` expression failed; `output` then carries the full unshaped result and this explains why the reshape did not apply. type: string output: anyOf: - additionalProperties: false properties: data: oneOf: - type: 'null' - additionalProperties: false properties: items: description: 'Keyword-idea records: the seed keyword and its related keyword suggestions, each with an Ahrefs difficulty and search-volume bucket. Populated whenever the provider has data for the entity.' items: properties: country: description: Two-letter country code the suggestions are scoped to. type: string ideas: description: Related keyword suggestions for the seed term. Populated whenever the provider has data for the entity. items: properties: difficulty: description: Relative Ahrefs difficulty bucket (a letter such as E, M, or H), not an exact number. type: string keyword: description: The suggested related keyword. Populated whenever the provider has data for the entity. type: string x-anyapi-must-populate: true updatedAt: description: Timestamp the suggestion metrics were last updated. type: string volume: description: Relative search-volume bucket (a letter grade), not an exact number. type: string required: - keyword type: object type: array x-anyapi-must-populate: true searchEngine: description: Search engine the suggestions are drawn from (e.g. Google). type: string sourceKeyword: description: The seed keyword the suggestions were expanded from. Populated whenever the provider has data for the entity. type: string x-anyapi-must-populate: true required: - sourceKeyword type: object type: array x-anyapi-must-populate: true required: - items type: object found: type: boolean required: - found - data title: Ahrefs keyword ideas output type: object - type: 'null' description: Normalized output, or null when the replay payload was not retained. provider: description: Always "AnyAPI". type: string replayed: description: True when this response replays the durable result of an earlier run without billing or upstream execution. type: boolean resultId: description: Opaque handle to the full unshaped result, cached ~15 min. Re-shape it for free (fields/max_items/summary/jq) via GET /v1/results/{id}, no re-billing. Absent when the result was too large to cache. type: string required: - output - provider - costUsd - items - replayed type: object description: Normalized result. headers: Idempotency-Replayed: description: Present only when the request carried an Idempotency-Key this gateway honored. "false" means the key was claimed and the run executed freshly; "true" means it replayed a prior identical run and was NOT charged again. Absent means either no key was sent or this gateway does not honor keys, so a retry could be charged twice. schema: enum: - 'false' - 'true' type: string PAYMENT-RESPONSE: description: Inline x402 payment receipt. schema: type: string Payment-Receipt: description: Inline mpp payment receipt. schema: type: string X-PAYMENT-RESPONSE: description: Inline x402 payment receipt. schema: type: string '400': content: application/json: schema: $ref: '#/components/schemas/Error' description: Input did not match the schema, or the upstream rejected the request. '401': content: application/json: schema: $ref: '#/components/schemas/Error' description: Missing or invalid API key. '402': content: application/json: schema: oneOf: - $ref: '#/components/schemas/PaymentRequiredError' - $ref: '#/components/schemas/TrialCapReached' application/problem+json: schema: properties: challengeId: minLength: 1 type: string status: const: 402 type: integer required: - status - challengeId type: object description: Insufficient wallet balance or spend cap, or an inline-payment challenge. Agent trials receive a trial_cap_reached continuation with a live RFC 8628 device authorization. headers: PAYMENT-REQUIRED: description: Inline x402 payment challenge. schema: type: string WWW-Authenticate: description: Inline mpp payment challenge. schema: type: string '404': content: application/json: schema: $ref: '#/components/schemas/Error' description: Unknown SKU, or the upstream had no matching resource. '409': content: application/json: schema: $ref: '#/components/schemas/Error' description: 'Idempotency collision. Codes: idempotency_in_progress means retry after the Retry-After delay; idempotency_conflict means use a new key for different request semantics; idempotency_needs_review means stop retrying and contact AnyAPI support with X-Anyapi-Request-Id.' '422': content: application/json: schema: $ref: '#/components/schemas/Error' description: The request was well formed but this API cannot serve the requested target site; the body's `alternatives` array lists the AnyAPI APIs that can. '429': content: application/json: schema: $ref: '#/components/schemas/Error' description: The upstream was rate limited; inspect `payment` when present before deciding whether to retry. '500': content: application/json: schema: $ref: '#/components/schemas/Error' description: An internal error prevented completion. Inspect payment when present before retrying. '502': content: application/json: schema: $ref: '#/components/schemas/Error' description: Every provider failed with a server/transport error, or inline payment settlement could not be confirmed; inspect `payment` when present before retrying. security: - bearerAuth: [] - apiKeyAuth: [] - {} summary: Ahrefs Keyword Ideas tags: - ahrefs x-mint: href: /api-reference/ahrefs/keyword-ideas x-payment-info: price: currency: USD max: '0.021500' min: '0.001650' mode: dynamic protocols: - x402: asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' network: eip155:8453 payTo: '0x754BD2A6799e766B1E2b9f1Ae7fBdC0CeD96ef13' scheme: exact - mpp: asset: '0x20c000000000000000000000b9537d11c60e8b50' currency: USD intent: charge method: tempo network: tempo payTo: '0x754BD2A6799e766B1E2b9f1Ae7fBdC0CeD96ef13' rail: tempo scheme: exact rails: - headers: challenge: - PAYMENT-REQUIRED credential: - PAYMENT-SIGNATURE - X-PAYMENT receipt: - PAYMENT-RESPONSE - X-PAYMENT-RESPONSE pricing: currency: USD max: '0.021500' min: '0.001650' minimumUsd: '0.001000' mode: dynamic quoteBasis: floor protocol: asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' network: eip155:8453 payTo: '0x754BD2A6799e766B1E2b9f1Ae7fBdC0CeD96ef13' scheme: exact rail: x402 settlement: onExecutionFailure: released onUnknownFinalization: indeterminate timing: after_execution - headers: challenge: - WWW-Authenticate credential: - Authorization receipt: - Payment-Receipt pricing: currency: USD max: '0.021500' min: '0.001650' minimumUsd: null mode: dynamic quoteBasis: funded_ceiling protocol: asset: '0x20c000000000000000000000b9537d11c60e8b50' currency: USD intent: charge method: tempo network: tempo payTo: '0x754BD2A6799e766B1E2b9f1Ae7fBdC0CeD96ef13' rail: tempo scheme: exact rail: mpp settlement: onExecutionFailure: charged_undelivered onVerificationError: indeterminate timing: before_execution /v1/run/ahrefs.keywords: post: description: 'Get the Ahrefs keyword-difficulty metrics for any search term: the difficulty score (0-100) and the number of referring domains a page needs to rank in the top 10 - as normalized JSON. **Price:** billed per result - \$1.65 per 1,000 requests base + \$19.80 per 1,000 results, capped at \$21.50 per 1,000 requests. **Routing:** one lane serves this API today, so a failed attempt has nowhere to fail over to. Payment outcome follows the selected rail''s settlement policy. **Catalog:** Ahrefs Keyword Difficulty pricing and uptime - live USD price, lane routing, and measured 30-day uptime. Every Ahrefs endpoint.' operationId: ahrefs_keywords parameters: - description: Optional. Comma-separated keys (dotted paths like `author.name` descend into nested objects) to keep on each result item. Keys are matched relative to each result item after the `data`/`items` envelope is unwrapped, not against the top-level response envelope, so use `jq` to reshape the whole envelope. Shrinks the response without changing cost. in: query name: fields required: false schema: type: string - description: Optional. Cap the number of result rows returned; a `_truncated` note reports how many were withheld so you can page via the API's own `limit`. Does not change cost. in: query name: max_items required: false schema: minimum: 0 type: integer - description: Optional. Return only a structural outline (top-level keys, item counts, and per-field byte sizes) instead of the full data. Does not change cost. in: query name: summary required: false schema: type: boolean - description: 'Optional. A jq expression applied to the result envelope; its output replaces `output` (multiple outputs collect into an array). Reshape freely, e.g. `jq=.data | {title, description, md: .markdown[:3500]}`. Runs sandboxed with a 250ms / 2MB budget; on failure the full result is returned with a `jqError`. Does not change cost.' in: query name: jq required: false schema: type: string - description: Optional. The most you are willing to pay for this one request, in US dollars (for example 0.05). Any route that would charge more than this is not used, so a request only ever runs on something you can afford. If nothing is available at or below your amount, the request is refused before it runs, nothing is charged, and the message tells you the cheapest price per request so you can raise it. Leave it out to accept the normal price. in: query name: max_cost_usd required: false schema: type: string - description: Optional wallet idempotency key, scoped to this customer for 24 hours. When the gateway honors the key, this synchronous in-process execution can continue after the caller disconnects, bounded by its execution deadline. A completed replayable result charges normally exactly once and can be replayed without another provider run or charge. A pending duplicate returns 409 idempotency_in_progress; reuse with different request semantics returns 409 idempotency_conflict. in: header name: Idempotency-Key required: false schema: maxLength: 255 minLength: 1 type: string requestBody: content: application/json: example: country: us keyword: seo tools schema: additionalProperties: false example: country: us keyword: seo tools properties: country: default: us description: Two-letter country code that scopes volume and difficulty (e.g. us, gb, de). type: string keyword: description: The search term to analyze (e.g. "seo tools"). type: string preferLatencyUnderMs: description: 'Optional; omit it and routing is unchanged, with the cheapest source serving. Prefer sources whose typical response time (median over the trailing 30 days, as published on this endpoint''s lane health) is under this many milliseconds; among those, the cheapest serves. This can raise your price: when the cheapest source misses the target, a faster and dearer one serves, and you are quoted and charged its price. If no source is that fast the request is still served, by whichever source offers the best speed for its price - it is never refused for being slow. Sources we have not timed are tried last. This is a preference, not a guarantee: the median describes past requests and is not a ceiling on this one, and it excludes any wait this request itself asks for. On a paginated walk it applies to the first page only: later pages stay with the source that page chose, at the price it was quoted.' minimum: 1 type: integer required: - keyword title: Ahrefs keyword metrics input type: object required: true responses: '200': content: application/json: schema: properties: costUsd: description: USD charged on the original run. On a replay this value is echoed for parity; the replay itself is free. type: number hint: description: 'Optional one-line nudge, absent when there is nothing to say. `large_result:` suggests the fields/max_items/summary/jq controls for a big response. `paging_unavailable:` means this result came from a source that cannot return a `nextCursor`, so it may be INCOMPLETE and cannot be continued - re-run with `requireCursor: true` to be served only by a source that can page, which may cost more per request.' type: string items: description: Number of result rows returned. For per-result SKUs the per-item cost is charged against this count; for input-priced SKUs the charge is per submitted input, independent of this count. type: integer jqError: description: Present only when a `jq` expression failed; `output` then carries the full unshaped result and this explains why the reshape did not apply. type: string output: anyOf: - additionalProperties: false properties: data: oneOf: - type: 'null' - additionalProperties: false properties: items: description: 'Keyword-difficulty records: the difficulty score and the referring-domain gap needed to rank in the top 10. Populated whenever the provider has data for the entity.' items: properties: country: description: Two-letter country code the metrics are scoped to. type: string difficulty: description: Ahrefs Keyword Difficulty, 0-100. type: integer keyword: description: Populated whenever the provider has data for the entity. type: string x-anyapi-must-populate: true referringDomainsToRank: description: Estimated number of referring domains a page needs to rank in the top 10 for this keyword. type: integer required: - keyword type: object type: array x-anyapi-must-populate: true required: - items type: object found: type: boolean required: - found - data title: Ahrefs keyword difficulty output type: object - type: 'null' description: Normalized output, or null when the replay payload was not retained. provider: description: Always "AnyAPI". type: string replayed: description: True when this response replays the durable result of an earlier run without billing or upstream execution. type: boolean resultId: description: Opaque handle to the full unshaped result, cached ~15 min. Re-shape it for free (fields/max_items/summary/jq) via GET /v1/results/{id}, no re-billing. Absent when the result was too large to cache. type: string required: - output - provider - costUsd - items - replayed type: object description: Normalized result. headers: Idempotency-Replayed: description: Present only when the request carried an Idempotency-Key this gateway honored. "false" means the key was claimed and the run executed freshly; "true" means it replayed a prior identical run and was NOT charged again. Absent means either no key was sent or this gateway does not honor keys, so a retry could be charged twice. schema: enum: - 'false' - 'true' type: string PAYMENT-RESPONSE: description: Inline x402 payment receipt. schema: type: string Payment-Receipt: description: Inline mpp payment receipt. schema: type: string X-PAYMENT-RESPONSE: description: Inline x402 payment receipt. schema: type: string '400': content: application/json: schema: $ref: '#/components/schemas/Error' description: Input did not match the schema, or the upstream rejected the request. '401': content: application/json: schema: $ref: '#/components/schemas/Error' description: Missing or invalid API key. '402': content: application/json: schema: oneOf: - $ref: '#/components/schemas/PaymentRequiredError' - $ref: '#/components/schemas/TrialCapReached' application/problem+json: schema: properties: challengeId: minLength: 1 type: string status: const: 402 type: integer required: - status - challengeId type: object description: Insufficient wallet balance or spend cap, or an inline-payment challenge. Agent trials receive a trial_cap_reached continuation with a live RFC 8628 device authorization. headers: PAYMENT-REQUIRED: description: Inline x402 payment challenge. schema: type: string WWW-Authenticate: description: Inline mpp payment challenge. schema: type: string '404': content: application/json: schema: $ref: '#/components/schemas/Error' description: Unknown SKU, or the upstream had no matching resource. '409': content: application/json: schema: $ref: '#/components/schemas/Error' description: 'Idempotency collision. Codes: idempotency_in_progress means retry after the Retry-After delay; idempotency_conflict means use a new key for different request semantics; idempotency_needs_review means stop retrying and contact AnyAPI support with X-Anyapi-Request-Id.' '422': content: application/json: schema: $ref: '#/components/schemas/Error' description: The request was well formed but this API cannot serve the requested target site; the body's `alternatives` array lists the AnyAPI APIs that can. '429': content: application/json: schema: $ref: '#/components/schemas/Error' description: The upstream was rate limited; inspect `payment` when present before deciding whether to retry. '500': content: application/json: schema: $ref: '#/components/schemas/Error' description: An internal error prevented completion. Inspect payment when present before retrying. '502': content: application/json: schema: $ref: '#/components/schemas/Error' description: Every provider failed with a server/transport error, or inline payment settlement could not be confirmed; inspect `payment` when present before retrying. security: - bearerAuth: [] - apiKeyAuth: [] - {} summary: Ahrefs Keyword Difficulty tags: - ahrefs x-mint: href: /api-reference/ahrefs/keywords x-payment-info: price: currency: USD max: '0.021500' min: '0.001650' mode: dynamic protocols: - x402: asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' network: eip155:8453 payTo: '0x754BD2A6799e766B1E2b9f1Ae7fBdC0CeD96ef13' scheme: exact - mpp: asset: '0x20c000000000000000000000b9537d11c60e8b50' currency: USD intent: charge method: tempo network: tempo payTo: '0x754BD2A6799e766B1E2b9f1Ae7fBdC0CeD96ef13' rail: tempo scheme: exact rails: - headers: challenge: - PAYMENT-REQUIRED credential: - PAYMENT-SIGNATURE - X-PAYMENT receipt: - PAYMENT-RESPONSE - X-PAYMENT-RESPONSE pricing: currency: USD max: '0.021500' min: '0.001650' minimumUsd: '0.001000' mode: dynamic quoteBasis: floor protocol: asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' network: eip155:8453 payTo: '0x754BD2A6799e766B1E2b9f1Ae7fBdC0CeD96ef13' scheme: exact rail: x402 settlement: onExecutionFailure: released onUnknownFinalization: indeterminate timing: after_execution - headers: challenge: - WWW-Authenticate credential: - Authorization receipt: - Payment-Receipt pricing: currency: USD max: '0.021500' min: '0.001650' minimumUsd: null mode: dynamic quoteBasis: funded_ceiling protocol: asset: '0x20c000000000000000000000b9537d11c60e8b50' currency: USD intent: charge method: tempo network: tempo payTo: '0x754BD2A6799e766B1E2b9f1Ae7fBdC0CeD96ef13' rail: tempo scheme: exact rail: mpp settlement: onExecutionFailure: charged_undelivered onVerificationError: indeterminate timing: before_execution /v1/run/ahrefs.overview: post: description: 'Get an SEO authority overview for any domain or URL: Domain Rating, total backlinks, and referring domains - as normalized JSON. **Price:** billed per result - \$1.65 per 1,000 requests base + \$19.80 per 1,000 results, capped at \$21.50 per 1,000 requests. **Routing:** one lane serves this API today, so a failed attempt has nowhere to fail over to. Payment outcome follows the selected rail''s settlement policy. **Catalog:** Ahrefs Domain Overview pricing and uptime - live USD price, lane routing, and measured 30-day uptime. Every Ahrefs endpoint.' operationId: ahrefs_overview parameters: - description: Optional. Comma-separated keys (dotted paths like `author.name` descend into nested objects) to keep on each result item. Keys are matched relative to each result item after the `data`/`items` envelope is unwrapped, not against the top-level response envelope, so use `jq` to reshape the whole envelope. Shrinks the response without changing cost. in: query name: fields required: false schema: type: string - description: Optional. Cap the number of result rows returned; a `_truncated` note reports how many were withheld so you can page via the API's own `limit`. Does not change cost. in: query name: max_items required: false schema: minimum: 0 type: integer - description: Optional. Return only a structural outline (top-level keys, item counts, and per-field byte sizes) instead of the full data. Does not change cost. in: query name: summary required: false schema: type: boolean - description: 'Optional. A jq expression applied to the result envelope; its output replaces `output` (multiple outputs collect into an array). Reshape freely, e.g. `jq=.data | {title, description, md: .markdown[:3500]}`. Runs sandboxed with a 250ms / 2MB budget; on failure the full result is returned with a `jqError`. Does not change cost.' in: query name: jq required: false schema: type: string - description: Optional. The most you are willing to pay for this one request, in US dollars (for example 0.05). Any route that would charge more than this is not used, so a request only ever runs on something you can afford. If nothing is available at or below your amount, the request is refused before it runs, nothing is charged, and the message tells you the cheapest price per request so you can raise it. Leave it out to accept the normal price. in: query name: max_cost_usd required: false schema: type: string - description: Optional wallet idempotency key, scoped to this customer for 24 hours. When the gateway honors the key, this synchronous in-process execution can continue after the caller disconnects, bounded by its execution deadline. A completed replayable result charges normally exactly once and can be replayed without another provider run or charge. A pending duplicate returns 409 idempotency_in_progress; reuse with different request semantics returns 409 idempotency_conflict. in: header name: Idempotency-Key required: false schema: maxLength: 255 minLength: 1 type: string requestBody: content: application/json: example: mode: subdomains url: ahrefs.com schema: additionalProperties: false example: mode: subdomains url: ahrefs.com properties: mode: default: subdomains description: 'Analysis scope: subdomains covers the whole domain, exact matches only the given URL.' enum: - exact - subdomains type: string preferLatencyUnderMs: description: 'Optional; omit it and routing is unchanged, with the cheapest source serving. Prefer sources whose typical response time (median over the trailing 30 days, as published on this endpoint''s lane health) is under this many milliseconds; among those, the cheapest serves. This can raise your price: when the cheapest source misses the target, a faster and dearer one serves, and you are quoted and charged its price. If no source is that fast the request is still served, by whichever source offers the best speed for its price - it is never refused for being slow. Sources we have not timed are tried last. This is a preference, not a guarantee: the median describes past requests and is not a ceiling on this one, and it excludes any wait this request itself asks for. On a paginated walk it applies to the first page only: later pages stay with the source that page chose, at the price it was quoted.' minimum: 1 type: integer url: description: The domain or page URL to analyze (e.g. ahrefs.com). type: string required: - url title: Ahrefs domain overview input type: object required: true responses: '200': content: application/json: schema: properties: costUsd: description: USD charged on the original run. On a replay this value is echoed for parity; the replay itself is free. type: number hint: description: 'Optional one-line nudge, absent when there is nothing to say. `large_result:` suggests the fields/max_items/summary/jq controls for a big response. `paging_unavailable:` means this result came from a source that cannot return a `nextCursor`, so it may be INCOMPLETE and cannot be continued - re-run with `requireCursor: true` to be served only by a source that can page, which may cost more per request.' type: string items: description: Number of result rows returned. For per-result SKUs the per-item cost is charged against this count; for input-priced SKUs the charge is per submitted input, independent of this count. type: integer jqError: description: Present only when a `jq` expression failed; `output` then carries the full unshaped result and this explains why the reshape did not apply. type: string output: anyOf: - additionalProperties: false properties: data: oneOf: - type: 'null' - additionalProperties: false properties: items: description: 'Domain authority records: the requested domain plus its Domain Rating, total backlinks, and referring-domain counts. Populated whenever the provider has data for the entity.' items: properties: backlinks: description: Total number of backlinks pointing to the domain. type: integer dofollowBacklinksPct: description: Percentage (0-100) of backlinks that are dofollow. type: integer dofollowReferringDomainsPct: description: Percentage (0-100) of referring domains that provide a dofollow link. type: integer domain: description: The domain or URL the metrics are scoped to. Populated whenever the provider has data for the entity. type: string x-anyapi-must-populate: true domainRating: description: Ahrefs Domain Rating, 0-100, measuring backlink-profile strength. type: number mode: description: 'Analysis scope used: subdomains (whole domain) or exact (the given URL only).' type: string referringDomains: description: Number of unique referring domains linking to the domain. type: integer required: - domain type: object type: array x-anyapi-must-populate: true required: - items type: object found: type: boolean required: - found - data title: Ahrefs domain overview output type: object - type: 'null' description: Normalized output, or null when the replay payload was not retained. provider: description: Always "AnyAPI". type: string replayed: description: True when this response replays the durable result of an earlier run without billing or upstream execution. type: boolean resultId: description: Opaque handle to the full unshaped result, cached ~15 min. Re-shape it for free (fields/max_items/summary/jq) via GET /v1/results/{id}, no re-billing. Absent when the result was too large to cache. type: string required: - output - provider - costUsd - items - replayed type: object description: Normalized result. headers: Idempotency-Replayed: description: Present only when the request carried an Idempotency-Key this gateway honored. "false" means the key was claimed and the run executed freshly; "true" means it replayed a prior identical run and was NOT charged again. Absent means either no key was sent or this gateway does not honor keys, so a retry could be charged twice. schema: enum: - 'false' - 'true' type: string PAYMENT-RESPONSE: description: Inline x402 payment receipt. schema: type: string Payment-Receipt: description: Inline mpp payment receipt. schema: type: string X-PAYMENT-RESPONSE: description: Inline x402 payment receipt. schema: type: string '400': content: application/json: schema: $ref: '#/components/schemas/Error' description: Input did not match the schema, or the upstream rejected the request. '401': content: application/json: schema: $ref: '#/components/schemas/Error' description: Missing or invalid API key. '402': content: application/json: schema: oneOf: - $ref: '#/components/schemas/PaymentRequiredError' - $ref: '#/components/schemas/TrialCapReached' application/problem+json: schema: properties: challengeId: minLength: 1 type: string status: const: 402 type: integer required: - status - challengeId type: object description: Insufficient wallet balance or spend cap, or an inline-payment challenge. Agent trials receive a trial_cap_reached continuation with a live RFC 8628 device authorization. headers: PAYMENT-REQUIRED: description: Inline x402 payment challenge. schema: type: string WWW-Authenticate: description: Inline mpp payment challenge. schema: type: string '404': content: application/json: schema: $ref: '#/components/schemas/Error' description: Unknown SKU, or the upstream had no matching resource. '409': content: application/json: schema: $ref: '#/components/schemas/Error' description: 'Idempotency collision. Codes: idempotency_in_progress means retry after the Retry-After delay; idempotency_conflict means use a new key for different request semantics; idempotency_needs_review means stop retrying and contact AnyAPI support with X-Anyapi-Request-Id.' '422': content: application/json: schema: $ref: '#/components/schemas/Error' description: The request was well formed but this API cannot serve the requested target site; the body's `alternatives` array lists the AnyAPI APIs that can. '429': content: application/json: schema: $ref: '#/components/schemas/Error' description: The upstream was rate limited; inspect `payment` when present before deciding whether to retry. '500': content: application/json: schema: $ref: '#/components/schemas/Error' description: An internal error prevented completion. Inspect payment when present before retrying. '502': content: application/json: schema: $ref: '#/components/schemas/Error' description: Every provider failed with a server/transport error, or inline payment settlement could not be confirmed; inspect `payment` when present before retrying. security: - bearerAuth: [] - apiKeyAuth: [] - {} summary: Ahrefs Domain Overview tags: - ahrefs x-mint: href: /api-reference/ahrefs/overview x-payment-info: price: currency: USD max: '0.021500' min: '0.001650' mode: dynamic protocols: - x402: asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' network: eip155:8453 payTo: '0x754BD2A6799e766B1E2b9f1Ae7fBdC0CeD96ef13' scheme: exact - mpp: asset: '0x20c000000000000000000000b9537d11c60e8b50' currency: USD intent: charge method: tempo network: tempo payTo: '0x754BD2A6799e766B1E2b9f1Ae7fBdC0CeD96ef13' rail: tempo scheme: exact rails: - headers: challenge: - PAYMENT-REQUIRED credential: - PAYMENT-SIGNATURE - X-PAYMENT receipt: - PAYMENT-RESPONSE - X-PAYMENT-RESPONSE pricing: currency: USD max: '0.021500' min: '0.001650' minimumUsd: '0.001000' mode: dynamic quoteBasis: floor protocol: asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913' network: eip155:8453 payTo: '0x754BD2A6799e766B1E2b9f1Ae7fBdC0CeD96ef13' scheme: exact rail: x402 settlement: onExecutionFailure: released onUnknownFinalization: indeterminate timing: after_execution - headers: challenge: - WWW-Authenticate credential: - Authorization receipt: - Payment-Receipt pricing: currency: USD max: '0.021500' min: '0.001650' minimumUsd: null mode: dynamic quoteBasis: funded_ceiling protocol: asset: '0x20c000000000000000000000b9537d11c60e8b50' currency: USD intent: charge method: tempo network: tempo payTo: '0x754BD2A6799e766B1E2b9f1Ae7fBdC0CeD96ef13' rail: tempo scheme: exact rail: mpp settlement: onExecutionFailure: charged_undelivered onVerificationError: indeterminate timing: before_execution components: schemas: AgentUpgrade: properties: authorizationServer: format: uri type: string clientId: type: string device: $ref: '#/components/schemas/DeviceUpgrade' scope: type: string required: - authorizationServer - scope type: object Payment: properties: costUsd: description: Known USD payment amount for this request. minimum: 0 type: number rail: minLength: 1 type: string settlementState: enum: - charged_undelivered - indeterminate type: string required: - rail - settlementState - costUsd type: object Error: properties: code: description: Stable machine-readable error code when the endpoint defines one. type: string error: description: Customer-safe error message. type: string payment: $ref: '#/components/schemas/Payment' requestId: description: This run's AnyAPI request id, the same value as the X-Anyapi-Request-Id response header. Quote it to support. Absent on endpoints that do not execute a run. format: uuid type: string required: - error type: object PaymentRequiredError: allOf: - $ref: '#/components/schemas/Error' - properties: error: not: const: trial_cap_reached type: object DeviceUpgrade: properties: deviceCode: type: string expiresIn: minimum: 0 type: integer grantType: type: string interval: minimum: 1 type: integer tokenEndpoint: format: uri type: string userCode: type: string verificationUri: format: uri type: string verificationUriComplete: format: uri type: string required: - verificationUriComplete - verificationUri - userCode - deviceCode - tokenEndpoint - grantType - interval - expiresIn type: object TrialCapReached: properties: error: const: trial_cap_reached type: string message: description: Human-relayable continuation instructions, including an executable token poll. type: string upgrade: $ref: '#/components/schemas/AgentUpgrade' required: - error - message - upgrade type: object securitySchemes: apiKeyAuth: description: Your AnyAPI key. in: header name: X-API-Key type: apiKey x-default: YOUR_ANYAPI_KEY bearerAuth: description: Your AnyAPI key as a Bearer token. scheme: bearer type: http x-default: YOUR_ANYAPI_KEY