raresats.net API
Market data View as Markdown

Birthday sats

What was mined on a day: per row counts for the site's birthday page, and the mint-day table behind every date filter.

Counts per day #

GET/api/birthday/counts

Per row, how many tracked sats were mined on a UTC day (date), or on that month-day of every year (md, optionally only years), that the index locates. Cacheable 30 s; a cold day can take a few seconds.

Query parameters #

ParameterTypeRequiredDescription
datestringnoA day, YYYY-MM-DD. One of date and md is required.
mdstringnoA month-day, MM-DD: that day of every year.
yearsstringnoWith md: only these years, comma-separated.

Example request #

cURL
curl 'https://raresats.net/api/birthday/counts?date=2009-01-09'
JavaScript
const response = await fetch('https://raresats.net/api/birthday/counts?date=2009-01-09');
const data = await response.json();
Python
import requests

data = requests.get("https://raresats.net/api/birthday/counts", params={"date": "2009-01-09"}).json()

Response 200 #

FieldTypeDescription
filterobjectThe filter as the server understood it.
filter.yearsarray of integerThe years asked for (ascending), [] for none.
filter.monthstring | nullThe month asked for (YYYY-MM), null for none.
filter.datestring | nullThe day asked for.
filter.mdstring | nullThe month-day asked for.
filter.blocksobject | nullThe blocks asked for: {from, to}, heights inclusive (one block: from = to), null for none.
filter.blocks.frominteger
filter.blocks.tointeger
filter.luckobject | nullThe luck asked for: {min, max} (max null for a minimum alone), null for none.
filter.luck.mininteger
filter.luck.maxinteger | null
filter.substring | nullThe sub-category asked for.
filter.subsbooleanWhether sub-category items are included (absent on events and counts).
filter.ledbooleanWhether sales led by another row are included (led=1; sales only).
daysarray of objectEach day counted (one for date; that day of every year for md).
days[].datestringThe day, YYYY-MM-DD.
days[].fromintegerIts first block.
days[].tointegerIts last block.
days[].rowsmap of integerTracked sats mined that day the index locates, per row (rows with none absent).
rowsmap of integerThe days' counts summed per row.
msintegerServer time spent, ms.
Response
{
  "filter": {"years": [], "date": "2009-01-09", "md": null, "luck": null, "sub": null},
  "days": [
    {
      "date": "2009-01-09",
      "from": 470,
      "to": 559,
      "rows": {"vintage_alpha": 3, "vintage_omega": 1}
    }
  ],
  "rows": {"vintage_alpha": 3, "vintage_omega": 1},
  "ms": 749
}

Errors #

{error} (a message, no code):

StatusWhen
400Neither date nor md, or a malformed one.
503Mint dates are still being read (retry: true), or the index is unavailable.

The mint-day table #

GET/api/days

Which UTC day mined each block, compactly: what the site uses to date sats in the browser. A sat's mint day is the day of its block. Cacheable 30 s.

Example request #

cURL
curl 'https://raresats.net/api/days'
JavaScript
const response = await fetch('https://raresats.net/api/days');
const data = await response.json();
Python
import requests

data = requests.get("https://raresats.net/api/days").json()

Response 200 #

FieldTypeDescription
readybooleanWhether the table is read (date filters answer 503 until then).
versionintegerFormat version.
genesisstring | nullThe genesis block hash.
first_dayintegerThe first UTC day (days since 1970) of the table.
heightintegerThe last height covered.
hashstring | nullIts hash.
startsarray of integerEach day's first height, as deltas: starts[0] is the first day's, then each the difference from the day before.
exceptionsarray of integerBlocks whose time is out of order, as flat pairs [height, day, …]: the day each belongs to.
tailarray of integerRecent, not yet final headers as flat pairs [height, time, …].
build_msinteger | nullHow long the last build took.

Errors #

None of its own.

Decoding it: day first_day + i (UTC days since 1970) starts at height starts[0] + … + starts[i]; a block listed in exceptions belongs to the day given there instead (its timestamp is out of order).