Lightning invoice decoder API: BOLT11 amount, expiry and hash

$0.01 per call · failed calls are never charged · no account or subscription: pay per call with a card key or USDC

Decode a BOLT11 Lightning Network invoice without paying it: network, amount in sats and BTC, description, payment hash, creation time, expiry time and whether it has already expired. Use to check what an invoice asks for before an agent pays it.

When to use it

Run it free (25 free calls) Buy credits by card (from $1) Example result (JSON)

Try it with your own inputs

BOLT11 invoice string starting with ln (lnbc... for mainnet)

Uses one of your 25 free calls. Nothing is charged, and a call that fails is not counted.

Inputs

NameTypeDescription
invoice (required)stringBOLT11 invoice string starting with ln (lnbc... for mainnet)

Request

Over HTTP, with a card key from /credits:

curl -H "Authorization: Bearer adt_…" "https://tools.funwords.eu/ln-invoice?invoice=lnbc2500u1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpu9qrsgquk0rl77nj30yxdy8j9vdx85fkpmdla2087ne0xh8nhedh8w27kyke0lp53ut353s06fv3qfegext0eh0ymjpf39tuven09sam30g4vgpfna3rh"

Or one of your 25 free calls, no key:

curl "https://tools.funwords.eu/ln-invoice?invoice=lnbc2500u1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpu9qrsgquk0rl77nj30yxdy8j9vdx85fkpmdla2087ne0xh8nhedh8w27kyke0lp53ut353s06fv3qfegext0eh0ymjpf39tuven09sam30g4vgpfna3rh&trial=1"

Without a key, the same URL answers 402 Payment Required with x402 and MPP terms, so an agent with a wallet pays per call in USDC (Base, Polygon, Arbitrum or Solana over x402; Base or Tempo over MPP) and retries.

Example result

{
  "network": "bitcoin",
  "amountSats": 250000,
  "amountBtc": 0.0025,
  "description": "1 cup coffee",
  "paymentHash": "0001020304050607080900010203040506070809000102030405060708090102",
  "createdAt": "2017-06-01T10:57:38.000Z",
  "expiresAt": "2017-06-01T10:58:38.000Z",
  "expired": true,
  "expirySeconds": 60
}

From an AI agent (MCP)

Add the MCP server to Claude, Cursor or any MCP client. This tool is ln_invoice, and the first 25 successful calls are free:

https://tools.funwords.eu/mcp

Questions

Does it pay the invoice?

No. It decodes the BOLT11 string only.

How do I pay?

Each successful call costs $0.01; failed calls are not charged. The first 25 calls are free. Then pay with card credits (from $1; the key goes in an Authorization header or, for clients that can only fetch a URL, as api_key= in the URL) or per call in USDC over x402 or MPP. No account is needed.

Related tools