> ## Documentation Index
> Fetch the complete documentation index at: https://syntalic.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Direct HTTP

> Call the API from any backend with an x402 client wrapper.

> [!TIP]
>
> Building with Claude or Cursor? The [MCP server](https://syntalic.com/docs/integrate/mcp.md) handles the wallet, payment routing and tool registration for you. This page is for backends, custom agents and raw HTTP clients.

## 1. See the price

Send a valid unpaid request to a published paid URL. The answer is a `402 Payment Required` listing the available payment options:

```bash theme={null}
curl -i "https://api.syntalic.com/v1/measures/offers?subject=airpods+pro"
```

* `payment-required` header and the JSON body (`accepts[]`): the [x402](https://syntalic.com/docs/payments/x402.md) options, one per chain (Solana and Base), each with the amount and the address to pay.
* `www-authenticate: Payment` header: the [MPP/Tempo](https://syntalic.com/docs/payments/mpp.md) challenge.

Pick one. The server tells them apart by the headers on your retry, so there is no separate URL.

A request that can't succeed (a bad parameter, or a retailer or brand the catalog doesn't carry) is usually refused with a `400` or `404` before the 402, so nothing is charged. Some of these checks run only on the unpaid request, so always send it first rather than attaching payment up front. See [errors and retries](https://syntalic.com/docs/payments/overview.md#errors-and-retries).

## 2. Pay and retry in code

Use a client that handles the 402 for you. For x402, `@x402/fetch` with an EVM key (Base):

```bash theme={null}
npm install @x402/fetch@2.9.0 @x402/evm@2.9.0 viem
```

```ts theme={null}
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);

const client = new x402Client().register("eip155:8453", new ExactEvmScheme(account));
const paidFetch = wrapFetchWithPayment(fetch, client);

const res = await paidFetch(
  "https://api.syntalic.com/v1/measures/offers?subject=airpods+pro"
);
if (!res.ok) throw new Error(`Syntalic request failed: ${res.status}`);
const data = await res.json();
```

`paidFetch` reads the 402, signs a USDC authorization and retries with it. For Solana, or for both chains in one client, see [x402](https://syntalic.com/docs/payments/x402.md). For Tempo, see [MPP / Tempo](https://syntalic.com/docs/payments/mpp.md).

## 3. Read the answer

An offers answer carries the best-ranked offer and other compared offers. Illustrative, abridged response (not a live quote):

```json theme={null}
{
  "query": "airpods pro",
  "country": "us",
  "currency": "USD",
  "retailers_compared": 4,
  "best_price": {
    "retailer": "amazon",
    "price": 189.0,
    "in_stock": true,
    "url": "https://www.amazon.com/...",
    "match_type": "entity",
    "last_read_at": "2026-11-15T11:14:22Z",
    "current": true,
    "fresh": true
  },
  "other_prices": [
    { "retailer": "walmart", "price": 199.0 }
  ]
}
```

An offers answer is the `/v1/shopper/best-price` answer, unchanged; every field is described under that endpoint in the **API Reference** tab. Start with `match_type`: `entity` is a verified match, `self_text` is the resolved listing itself, and `title` is a text match that may be a variant. Use `strict=true` for entity-only comparisons. Inspect `current`, `fresh`, `in_stock`, `price_suspect` and `coverage.reason` before calling an offer buyable; these are observations, not live stock guarantees. A single compared retailer is not a cross-retailer comparison. See [Coverage](https://syntalic.com/docs/reference/coverage.md).

## Next steps

> [card] [Measures](https://syntalic.com/docs/reference/measures.md)
>
> The priced paths, by question.

> [card] [Coverage](https://syntalic.com/docs/reference/coverage.md)
>
> Which retailers, which countries, and how fresh.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.