L

Locus x402 Services · Mapbox Directions

by Locus x402 Services

POSTBase

$0.005

per call · USD Coin on Base

Locus public pay-per-use API

Endpoint

POST https://mapbox.x402.paywithlocus.com/mapbox/directions

1

Calls / 30d

1

Unique payers / 30d

Aug 30

Last called

exact

Payment scheme

Call this service

TypeScript · @x402/fetch
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const account = privateKeyToAccount(process.env.PRIVATE_KEY);
const fetchWithPay = wrapFetchWithPayment(fetch, account);

const res = await fetchWithPay("https://mapbox.x402.paywithlocus.com/mapbox/directions", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "coordinates": "-73.99,40.73;-77.03,38.90",
    "profile": "mapbox/driving"
  }),
});
const data = await res.json();
cURL
curl -X POST \
  "https://mapbox.x402.paywithlocus.com/mapbox/directions" \
  -H "Content-Type: application/json" \
  -d '{"coordinates":"-73.99,40.73;-77.03,38.90","profile":"mapbox/driving"}' \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "data": {},
  "payment": {
    "authorizedMaxUsdc": "0.001000",
    "scheme": "exact",
    "settledUsdc": "0.001000"
  },
  "request": {
    "id": "00000000-0000-4000-8000-000000000000",
    "statusUrl": "/requests/00000000-0000-4000-8000-000000000000"
  },
  "success": true
}

Payment details

Pay to0x3c5cbe28eca3b96023c45d3f877da834f1c7d5fa
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase
Schemesexact

Is this your API?

Pin it to the top of Other and the homepage with a featured placement.

Get featured →

More from Locus x402 Services & similar services