neroswap

Neroswap Public API

Free, CORS-enabled JSON for the same orderbook + history data that powers the site. No auth, no signup. ETag & cache headers honored — please be polite.

  • Base URL: https://neroswap.com
  • Rate limit: 60 requests / minute / IP (token bucket). 429 with Retry-After on overflow.
  • Caching: Strong ETag on every response — send If-None-Match and we'll return 304 when unchanged.
  • CORS: Access-Control-Allow-Origin: * for all v1 endpoints.

GET/api/v1/best

Best bid/ask per source plus consolidated mid + spread for a pair.

Parameters
NameRequiredDescriptionExample
pairyesPair slug, e.g. XMR-BTC. Base-Quote.XMR-BTC
Cache
public, max-age=30, stale-while-revalidate=60
Example
curl 'https://neroswap.com/api/v1/best?pair=XMR-BTC'
Response
{
  "pair": { "base": "XMR", "quote": "BTC", "slug": "XMR-BTC" },
  "consolidated": {
    "bestBid": 0.00524,
    "bestAsk": 0.00531,
    "midPrice": 0.005275,
    "spreadPct": 1.33
  },
  "bySource": [
    { "source": "basicswap", "bestBid": 0.00524, "bestAsk": 0.00533, ... },
    { "source": "eigenwallet", "bestBid": null, "bestAsk": 0.00531, ... },
    { "source": "haveno", "bestBid": 0.00522, "bestAsk": 0.00540, ... }
  ],
  "sources": { "basicswap": "ok", "eigenwallet": "ok", "haveno": "ok" },
  "fetchedAt": "2025-..."
}

GET/api/v1/depth

Full normalized order book + cumulative depth ladder for a pair.

Parameters
NameRequiredDescriptionExample
pairyesPair slug.XMR-BTC
limitnoMax bids / asks to return on each side (0 for all). Default 100.50
Cache
public, max-age=30, stale-while-revalidate=60
Example
curl 'https://neroswap.com/api/v1/depth?pair=XMR-BTC&limit=50'
Response
{
  "pair": { "base": "XMR", "quote": "BTC", "slug": "XMR-BTC" },
  "consolidated": { "bestBid": 0.00524, "bestAsk": 0.00531, "midPrice": 0.005275, "spreadPct": 1.33 },
  "bids": [ { "side": "bid", "price": 0.00524, "baseAmount": 1.5, "source": "basicswap" }, ... ],
  "asks": [ { "side": "ask", "price": 0.00531, "baseAmount": 0.8, "source": "haveno" }, ... ],
  "bidDepth": [ { "price": 0.00524, "cumBase": 1.5, "source": "basicswap" }, ... ],
  "askDepth": [ ... ],
  "counts": { "bids": 27, "asks": 31 },
  "sources": { ... },
  "fetchedAt": "2025-..."
}

GET/api/v1/quote

Effective price for a market order. Walks the consolidated book and the best single source.

Parameters
NameRequiredDescriptionExample
pairyesPair slug.XMR-BTC
sideyesbuy (walks asks) or sell (walks bids).buy
amountyesOrder size > 0.10
denomnobase (default) or quote — units for amount.base
Cache
public, max-age=30, stale-while-revalidate=60
Example
curl 'https://neroswap.com/api/v1/quote?pair=XMR-BTC&side=buy&amount=10'
Response
{
  "pair": { "base": "XMR", "quote": "BTC", "slug": "XMR-BTC" },
  "side": "buy", "amount": 10, "denom": "base",
  "bestSingleSource": { "source": "haveno", "filledBase": 10, "filledQuote": 0.0531, "avgPrice": 0.00531, ... },
  "crossSource": { "filledBase": 10, "filledQuote": 0.0529, "avgPrice": 0.00529, "fills": [ ... ] },
  "sources": { ... },
  "fetchedAt": "2025-..."
}

GET/api/v1/status

Current health of every upstream data source plus a summary level (ok / warn / bad).

Cache
public, max-age=30, stale-while-revalidate=60
Example
curl 'https://neroswap.com/api/v1/status'
Response
{
  "level": "ok",
  "down": 0,
  "stale": 0,
  "sources": [
    { "source": "basicswap", "ok": true, "stale": false, "fetchedAt": "...", "offerCount": 124 },
    { "source": "haveno", "ok": true, "stale": false, "fetchedAt": "...", "offerCount": 38 },
    { "source": "eigenwallet", "ok": true, "stale": false, "fetchedAt": "...", "offerCount": 7 }
  ],
  "checkedAt": "2025-..."
}

GET/api/v1/history

OHLC candles for a (source, pair) at a given resolution. Backed by the harvester sqlite store.

Parameters
NameRequiredDescriptionExample
sourceyesbasicswap | haveno | eigenwallet | kraken | altquick | nonlogs | cexswapbasicswap
pairyesPair slug.XMR-BTC
resno5m | 15m | 1h | 4h | 1d (default 1h)1h
hoursnoLookback window in hours, 1..8760 (default 168).168
fieldnobest | worst | last (default last) — which observed price column to bucket.last
Cache
public, max-age=60, stale-while-revalidate=120
Example
curl 'https://neroswap.com/api/v1/history?source=basicswap&pair=XMR-BTC&res=1h&hours=168'
Response
{
  "source": "basicswap", "pair": "XMR-BTC",
  "res": "1h", "hours": 168, "field": "last", "bucketSeconds": 3600,
  "count": 168,
  "candles": [ { "time": 1731000000, "open": 0.00524, "high": 0.00531, "low": 0.00521, "close": 0.00528 }, ... ]
}

GET/api/v1/history/pairs

Discover which (source, pair) combinations have at least one stored candle.

Cache
public, max-age=300, stale-while-revalidate=600
Example
curl 'https://neroswap.com/api/v1/history/pairs'
Response
{
  "sources": ["basicswap", "haveno", ...],
  "bySource": { "basicswap": ["XMR-BTC", ...], ... },
  "total": 47
}
Issues? Drop them on GitHub. API contract is best-effort, not versioned beyond v1 for now — breaking changes will bump to v2.