W

Weight Converter API · Convert Weight

by Weight Converter API

GETBase

$0.0025

per call · USD Coin on Base

Convert a weight/mass value between units (kg, g, lb, oz, stone, tonne, and more).

Endpoint

GET https://weight402endpoint.vercel.app/api/convert-weight

108

Calls / 30d

60

Unique payers / 30d

Sep 9

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://weight402endpoint.vercel.app/api/convert-weight", {
  method: "GET",
});
const data = await res.json();
cURL
curl -X GET \
  "https://weight402endpoint.vercel.app/api/convert-weight" \
  -H "X-PAYMENT: <signed x402 payment>"

Example response

{
  "formula": "10 kg = 22.0462 lb",
  "from": "kg",
  "result": 22.0462,
  "to": "lb",
  "value": 10
}

Payment details

Pay to0xa3068cfae6217ae906958250072bdf51b7f910c3
AssetUSD Coin · 0x833589fcd6edb6e08f4c7c32d4f71b54bda02913
NetworksBase
Schemesexact

Is this your API?

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

Get featured →

More from Weight Converter API & similar services