POSTvalidateaddress

Bitcoin Mainnethttps://bitcoin-mainnet.nodit.io/

Validates the given Bitcoin address and returns the information derived from it. Only the isvalid field is returned when the address is invalid.

Request Body
idintegerrequired
jsonrpcstringrequired
methodstringrequired
paramsoneOf[]required

It contains following parameter:

  1. address: The Bitcoin address to validate, as a string. (required)
params[0]string

The Bitcoin address to validate.

Responses
isvalidboolean

Whether the address is valid.

addressstring

The Bitcoin address that was validated. Returned only when the address is valid.

scriptPubKeystring

The hex-encoded output script generated by the address. Returned only when the address is valid.

isscriptboolean

Whether the key is a script. Returned only when the address is valid.

iswitnessboolean

Whether the address is a witness address. Returned only when the address is valid.

witness_versioninteger

The version number of the witness program. Returned only for witness addresses.

witness_programstring

The hex value of the witness program. Returned only for witness addresses.

errorstring

The reason the address is invalid. Returned only when an error occurred.

error_locationsinteger[]

Indices of likely error locations in the address string. Returned only when the locations can be identified, such as for Bech32 errors.

X-API-KEY
RequestCU10
cURL
curl -X POST "https://bitcoin-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "validateaddress",
  "params": [
    "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh"
  ]
}'
Response
Example · 200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "isvalid": true,
    "address": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
    "scriptPubKey": "00143123f9ba48c9a80f4e7f7ea6a7d5028a9c0018a2",
    "isscript": false,
    "iswitness": true,
    "witness_version": 0,
    "witness_program": "3123f9ba48c9a80f4e7f7ea6a7d5028a9c0018a2"
  }
}