x402 · Base mainnet · USDC
Weight Converter API
A pay-per-call HTTP API that converts weight and mass between units. Requests are protected by the x402 protocol: unpaid calls receive an HTTP 402 challenge, and settlement runs through the Coinbase CDP facilitator with Base Builder Code attribution.
Endpoint
GET /api/convert-weight?value=10&from=kg&to=lbPriced at $0.001 USDC per call. Pay with any compliant x402 client to receive the converted result as JSON.
Supported units
- mgmilligram
- ggram
- kgkilogram
- tmetric ton (tonne)
- ozounce
- lbpound
- ststone
- ton_usUS ton (short ton)
- ton_ukUK ton (long ton)
- ctcarat
- grgrain
Example response
{
"value": 10,
"from": "kg",
"to": "lb",
"result": 22.0462262185
}