Quickstart

Go from zero to first paid call in under 5 minutes.

Step 1 — Try the free demo

No payment needed:

curl https://api.cybersecurity-japan.com/demo/snapshot

Step 2 — Make a paid call (Base mainnet, 0.05 USDC)

You need a wallet with USDC on Base. There is no testnet endpoint; use the free demo above to test your parsing.

Install the x402 v2 client:

npm install @x402/fetch @x402/evm viem

Create snapshot.mjs:

import { wrapFetchWithPaymentFromConfig } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);

const fetchWithPayment = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(account) }],
});

const res = await fetchWithPayment(
  "https://api.cybersecurity-japan.com/v1/snapshot",
  {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ url: "https://example.com" }),
  }
);

console.log(await res.json());
PRIVATE_KEY=0x... node snapshot.mjs

The response carries a PAYMENT-RESPONSE header with the settlement transaction. An error response (4xx/5xx) is not settled.

Full API reference →