Skip to main content
Get started with a reliable Bitcoin RPC endpoint to use the tools below. Chainstack Bitcoin nodes serve the Bitcoin Core JSON-RPC API over HTTPS. Send requests with curl or any HTTP client. The same calls work on Mainnet, Testnet (testnet3), Signet Testnet, and Testnet4.

JSON-RPC API

To get basic network information from your Bitcoin node HTTPS endpoint, call getblockchaininfo:
where YOUR_CHAINSTACK_ENDPOINT is your node HTTPS endpoint protected either with the key or password. See node access details. To call methods from Postman, use the Bitcoin RPC methods Postman collection. bitcoin-cli connects over plain HTTP only, so it cannot call a Chainstack HTTPS endpoint. Use curl or an HTTP client library.

Python

Install requests:
On Mainnet, the main.py example prints Chain: main, the block height, and a fee rate for confirmation within 6 blocks. For a password-protected endpoint, put the credentials in the URL, as in https://USERNAME:PASSWORD@HOSTNAME, and requests sends them as HTTP basic authentication.
python-bitcoinlib 0.12.2 rejects HTTPS URLs in bitcoin.rpc.Proxy with Unsupported URL scheme 'https', so send JSON-RPC to a Chainstack endpoint with an HTTP client such as requests.

JavaScript

Install bitcoinjs-lib with its key-pair dependencies. The example needs Node.js 20 or later, which ecpair requires, and uses the built-in fetch.
The index.mjs example picks the bitcoinjs-lib network from chain, generates a new native SegWit address for it, and checks the address with validateaddress. On Mainnet, it prints Chain: main, a bc1q address, and Valid on main: true. The built-in fetch rejects a URL that includes credentials, with TypeError: Request cannot be constructed from a URL that includes credentials. For a password-protected endpoint, send the credentials in an Authorization header instead:

Testnet, Signet Testnet, and Testnet4

Testnet (testnet3), Signet Testnet, and Testnet4 endpoints take the same JSON-RPC calls as Bitcoin Mainnet, so the Python and JavaScript examples run on them unchanged. Before your application sends transactions, check that chain in getblockchaininfo is test, signet, or testnet4, because testnet addresses look the same on every testnet. For network parameters and how the testnets differ, see Bitcoin testnets.
  • bitcoinjs-lib has no separate Signet Testnet or Testnet4 network. networks.testnet produces tb1 addresses that are valid on all three testnets, which is the network the index.mjs example selects for any chain other than main.
  • On Testnet4, estimatesmartfee often has no estimate for short targets, so the main.py example falls back to the node’s minimum mempool fee. See Fee estimation on Testnet4.
Last modified on October 5, 2026