HTTP API
Every reader serves the same routes. The XMR20 project runs one at https://api.xmr20.org/xmr721/, and you can run your own.
#Basics
https://api.xmr20.org/xmr721 the public reader
http://127.0.0.1:18951 your own reader- JSON everywhere. Errors are
{"error": "plain text"}with a 4xx or 5xx status. - Amounts are strings of atomic units: 1 XMR = 1,000,000,000,000.
heightin an answer is the last block the reader has processed.- Lists page with
fromandlimit, orbeforeandnextfor activity.
curl https://api.xmr20.org/xmr721/info#The ledger
| Route | Answer |
|---|---|
GET /info | The ledger's settings: network, domain, fee address, start block and hash, owner-list hash, mint, opening, burn and spend blocks, relay limits and fees, and the trading rules |
GET /stats | Height, Mordinals, claimed, for sale, sales, volume, fees, records, refused, counts by kind, burns, and the latest checkpoint |
GET /checkpoint | The checkpoint at the current block |
GET /checkpoints | Every checkpoint the reader has written |
GET /owners?from=&limit= | The owner list in pieces: for each Mordinal, its registration and owner transactions and the owner output's key, view tag and transaction public keys |
GET /claimed | Every claimed Mordinal number |
A wallet downloads the whole owner list and looks for its own coins itself, so the reader never learns which unclaimed Mordinals a wallet holds.
#Mordinals
| Route | Answer |
|---|---|
GET /mordinal/<number or registration txid> | One Mordinal: claimed, owner, counter, listing, registration and owner transactions, size and hash; its full history from the 2023 inscription on; records waiting for a block. This is the public “is it claimed?” answer |
GET /gallery?filter=all|claimed|unclaimed|listed&from=&limit= | Cards: number, claimed, owner, size, listing |
GET /address/<address> | What one address owns, what it is buying, and its waiting records |
GET /content/<number> | The inscribed picture, if it is an allowed picture type and matches the owner list's hash. Headers x-mordinal-sha256, x-mordinal-sensitive |
GET /text/<number> | The inscription as plain text, when it is a short plain text |
GET /names and /groups | Display names and collection groups of Mordinals |
curl https://api.xmr20.org/xmr721/mordinal/2177#Minted NFTs and collections
| Route | Answer |
|---|---|
GET /nfts?from=&limit=&collection= | Minted NFTs, newest first: id, collection, edition, creator, name, type, size, SHA-256, owner, burned, counter, listing |
GET /nft/<id> | One NFT with its mint record, its collection's record and its history |
GET /nft/<id>/content | Its bytes, when they are a picture or plain text |
GET /nft-collections | Collections made on the ledger |
GET /nft-collection/<id> | One collection with its record and its minted NFTs |
GET /collections, /collections/<key> | The GENESIS collection of earlier XMR20 NFTs |
#The market
| Route | Answer |
|---|---|
GET /listings | Open listings that have not run out |
GET /lot/<listing id> | One listing: seller, price, last block, status (open, sold, cancelled), the list record, the reservation and buyer |
GET /activity?kind=&number=&address=&before=&limit= | Events, newest first; pass next as before for the next page |
GET /sales?… | The same, sales only |
GET /tx/<txid> | A Monero transaction cut to the parts the rules read. A buyer's wallet uses it to make payment proofs |
Every event has height, pos, txid, id, time, kind, number and confirmations, and by kind:
| Kind | Also |
|---|---|
claim | to, proof (burn, spent coin, one-time key, payment proof and message) |
move | from, to |
list | lot, seller, price, until |
cancel | lot, seller |
reserve | lot, buyer, payBy |
sale | lot, seller, buyer, price, fee, payments |
collection, mint, burn | the collection, NFT and owner fields |
#Records and the relay
| Route | Answer |
|---|---|
POST /records {"record": "<hex>"} | Hands a signed record to the relay. Needs content-type: application/json. Returns the job: id, state, op, number, txid, error, note |
GET /status/<record id> | Where a record is: unpaid (a relay fee has not arrived), queued, held, built, sent, waiting (a claim waiting for its fee), done, refused, stuck, unknown |
GET /entry/<txid> | What became of the record, burn or fee payment a transaction carried |
GET /pending | Records waiting for a block |
GET /records?from=&limit= | Every accepted record in order, as hex |
GET /log?from=&limit= | The full log: records, burns and fee payments, accepted and refused, with block and place |
GET /burns?from=&limit= | Burn claims and fee payments in ledger order |
GET /waiting | Claims that wait for their fee, burns and claims by a spent coin, with kind, due, paid and missing |
curl -X POST https://api.xmr20.org/xmr721/records \
-H 'content-type: application/json' \
-d '{"record":"4d4431fe02…"}'Posting the same record again returns the same job. A 400 means the rules refuse it now; 429 means a limit was reached; 503 means the relay cannot work right now.
The relay's limits: three waiting records per signing address, one per Mordinal, a total and a daily cap, and a request rate per network address. Claims, moves, listings, reservations and purchases are carried free. Collections and mints cost the fee in GET /info under relay.fees.
#XMR20 tokens
| Route | Answer |
|---|---|
GET /xmr20/open?from=&limit= | Open tokens, newest first: id, deploy fields, creator, label, block |
GET /xmr20/open/<id or first 16 characters> | One open token with its deploy record and text |
GET /xmr20/tokens | Tokens deployed by the launchpad's inscriber |
GET /xmr20/token/<id> | One of them |
GET /xmr20/deploys/<Solana mint> | The deploy of a launchpad token by its mint |
GET /xmr20/earlier, /xmr20/earlier/<txid, mint or number> | Tokens of the first XMR20 format |
POST /xmr20/open/deploy-text, /xmr20/open/deploys, /xmr20/open/mints | Deploy and mint open tokens through the relay |
GET /xmr20/open-mint/<id> | What became of a mint the relay was asked to carry |
Balances of tokens are kept by the token ledger in the XMR20 wallet engine, not by this reader. See XMR20 tokens.
The full reference, with every field, is reader/README.md.