MinersWorldCoin API documentation
Reference for the REST endpoints, Esplora-compatible routes, and Socket.IO events exposed by this Python server.
REST base URL: https://api.minersworld.org. The root page is the interactive API explorer; its request cards remain unchanged.
Machine-readable contract: OpenAPI 3.1 YAML. Existing paths remain available; the main REST routes also have versioned aliases under /api/v1, where JSON responses use a standard envelope and JSON errors use HTTP error statuses. The /api/v1/esplora aliases preserve Esplora response formats.
Response and amount conventions
Most REST methods return an object containing result, error, and id (normally api-server). Node errors are returned in error. A few endpoints intentionally return plain text, arrays, or a different JSON shape; these are called out below.
In the main API, monetary amounts are integer satoshis: 1 MWC = 100,000,000 satoshis. Keep amounts as integers when building transactions. The /price endpoint is a CoinPaprika response in market units, not satoshis. The /supply/plain endpoint returns whole MWC as plain text.
The explorer adds a circulating-supply equivalent in MWC alongside the raw satoshi supply. The API's JSON response remains unchanged.
Constructing, signing, and broadcasting transactions
This server does not create transactions or sign them. It provides UTXO lookup, transaction decoding, and a node relay for already-signed raw transaction hex. Private keys stay in the wallet or signing client.
- Call
GET /unspent/{address}to retrieve spendable outputs. Each output identifies its source withtxidandindex(the vout) and includes the lockingscriptand value in satoshis. Use an amount filter only if useful;amountis integer satoshis. - Select inputs whose total covers the recipient amount and fee. Construct outputs for the recipient and, if needed, a change address you control. The difference between input total and output total is the transaction fee. Recheck inputs immediately before signing because another spend can invalidate them.
- Build and sign with a wallet library configured for MWC's address and transaction rules. Each input must spend the referenced output and be signed by the key that controls it. Use the wallet's supported scripts and signature-hash behavior; this API cannot sign for you.
- Call
GET /decode/{raw-hex}on the signed transaction and inspect inputs, outputs, amounts, and change before broadcasting. Decoding only parses the transaction; it does not promise mempool acceptance. - POST the signed hex to
/broadcastas URL-encoded form fieldraw, or as JSON{"raw":"…"}. The Python handler passes it to the node'ssendrawtransactionRPC. On success, the node returns a transaction ID. A returned ID means accepted by that node, not confirmed in a block. - Track the transaction with
/transaction/{txid}and the address with/mempool/{address}. After it is mined, transaction details include block metadata and confirmations.
The legacy /fee route remains hard-coded to feerate: 1000000 and blocks: 30. That value is 1,000,000 satoshis (0.01 MWC), not a per-byte quote from current mempool conditions. Use /fee-estimates for the node's current smart-fee estimates in sat/vB; estimate availability depends on node history.
The companion MWC API and wallet project documents these network parameters for wallet configuration: public-key address prefix 20, script address prefix 10, WIF prefix 123, extended public/private key versions 0488B21E/0488ADE4, and Bech32 HRP mwc. Bitcoin mainnet defaults will derive incompatible addresses.
curl "https://api.minersworld.org/unspent/98AUvgXPjAdKHj3FqwAPJNpd8XergXBL59"
curl -X POST "https://api.minersworld.org/broadcast" \
--data-urlencode "raw=SIGNED_RAW_TRANSACTION_HEX"
For an Esplora-style relay, POST /esplora/tx instead expects the raw hex directly as a plain-text request body and returns the txid as plain text.
Main REST endpoints
| Method / path | Inputs | Result |
|---|---|---|
GET /info | None | Node blockchain info, with calculated supply, reward, and network hash rate added. |
GET /price | None | CoinPaprika MWC ticker JSON. Not wrapped in the standard response envelope; upstream failures return HTTP 500. |
GET /height/{height} | Block height; optional ?offset=0 | Block data. Returns at most 10 transaction IDs starting at offset. |
GET /hash/{height} | Block height | Block hash at the given height. |
GET /range/{height}?offset={count} | Ending height; count defaults to 30 and is capped at 100 | Block summaries, newest first. Values below 1 are treated as 1. |
GET /block/{hash} | Block hash; optional ?offset=0 | Block data with at most 10 transaction IDs from offset. |
GET /header/{hash} | Block hash | Block header fields; txcount replaces node field nTx. |
GET /transaction/{txid} | Transaction ID | Transaction details, raw hex, inputs, outputs, values in satoshis, and block metadata when confirmed. Unconfirmed height is -1. |
GET /balance/{address} | Address | Node address balance and received totals in satoshis. |
GET /unspent/{address}?amount={sats} | Address; integer satoshi minimum filter defaulting to 0 | UTXOs with txid, output index, locking script, value in satoshis, and height. |
GET /history/{address}?offset={n} | Address; offset defaults to 0 | Up to 10 transaction IDs, newest first, and full txcount. |
GET /mempool/{address} | Address | Unconfirmed transactions involving the address and their count. |
GET /mempool | None | Node mempool statistics and transaction IDs. |
GET /fee | None | Legacy fixed recommendation: 1,000,000 satoshis and blocks: 30. |
GET /supply | None | Calculated height, halvings, and supply in satoshis. |
GET /supply/plain | None | Whole-MWC supply as plain text. |
GET /peers | None | Peer IP, software version, and ping time. Shape is {result, error}, without id. |
GET /decode/{raw} | Raw transaction hex in the path | Node-decoded transaction. Long raw hex can exceed URL limits; parsing does not imply acceptance. |
POST /broadcast | URL-encoded form field raw or JSON object with a raw string | Node JSON-RPC result from sendrawtransaction. Missing raw hex returns HTTP 400. |
GET /stats | None | Server uptime, REST/Socket.IO counters, active connections, subscribers, and watched-address counts. |
Esplora-compatible routes
All routes below are prefixed with /esplora. The server uses block_page and tx_page settings (currently 10 and 25).
| Method / path | Result |
|---|---|
GET /block/{hash} | Esplora block summary; unknown block returns 404. |
GET /blocks, GET /blocks/{height} | Recent block summaries up to the selected height (tip when omitted). |
GET /block/{hash}/status | Returns in_best_chain: true when block lookup succeeds, plus height and next block hash. The handler does not independently verify chain membership. |
GET /block/{hash}/txs/{start} | Page of transaction details; start must be divisible by configured tx_page (25). |
GET /block-height/{height} | Plain-text block hash. |
GET /blocks/tip/height | Plain-text current tip height. |
GET /blocks/tip/hash | Plain-text current tip hash. |
GET /tx/{txid} | Esplora-format transaction with status, vin/vout, value, and fee. |
GET /tx/{txid}/status, /tx/{txid}/hex | Transaction confirmation state or raw hex as plain text. |
GET /tx/{txid}/outspends | Spent flag for each output; spent entries include spending tx/input and block status. |
GET /tx/{txid}/outspend/{vout} | Spend status for one output index. |
GET /address/{address} | Address chain/mempool statistics. Output counts are currently placeholders (zero). |
GET /address/{address}/utxo | Address UTXOs in Esplora format with funding status. |
GET /address/{address}/txs | First page of address transactions. |
GET /address/{address}/txs/chain/{last_txid} | Next page after the specified transaction cursor. |
GET /address/{address}/txs/mempool | Unconfirmed transactions affecting the address. |
GET /mempool/recent | Recent mempool summaries: txid, fee, weight (field named vsize), and output value. |
GET /mempool/txids | All transaction IDs currently in the node mempool. |
POST /tx | Plain-text body containing signed raw transaction hex; returns plain-text txid, or HTTP 400 with node error. |
Socket.IO events
Connect a Socket.IO client to the API origin using the default /socket.io path. Request handlers return their result through the event acknowledgement. Arguments are positional: send a string, number, or array as appropriate rather than an object with named fields. Connection and disconnection lifecycle events are handled automatically by the server.
| Event | Argument(s) | Behavior |
|---|---|---|
general.info, general.fee | None | Same result as REST /info and /fee. |
address.unspent | Address string; optional amount integer | Address UTXOs. |
address.balance, address.history, address.mempool, address.mempool.raw | Address string | Address data; .raw returns transaction IDs only. |
address.check | Array of address strings | Addresses with history. |
transaction.info | Transaction ID string | Transaction details. |
transaction.batch | Array of transaction ID strings | Envelope containing a result for each transaction. |
transaction.broadcast | Signed raw transaction hex string | Relays through node sendrawtransaction. |
subscribe.blocks, unsubscribe.blocks | None | Manage block subscription; updates arrive as block.update with height and hash. |
subscribe.address, unsubscribe.address | Address string | Manage address subscription; updates arrive as address.update. Height/hash are null for mempool activity. |
The explorer page intentionally remains the live endpoint runner; this documentation page explains the behavior without replacing or renaming its endpoint cards.