Build on BRAINROT

The Community Public Interface (CPI) is a public, read-only API over BRAINROT's on- and off-chain data, plus the AI Court's judges and lawyers. Grab an API key and build leaderboards, dashboards, bots, quizzes — whatever you like.

Authentication

Every /v1 request needs an API key, sent as a bearer token or the X-API-Key header. Keys are issued from your dashboard. Character images under /img are public and need no key.

curl https://cpi.brainrot.works/v1/stats \
  -H "Authorization: Bearer cpi_live_your_key_here"

Conventions

  • All responses are JSON. Single resource is { "data": { … } }; a collection is { "data": [ … ], "paging": { … } }.
  • Errors are { "error": { "code", "message" } } with a matching HTTP status.
  • Paginate lists with ?limit= (1–100) and ?offset=.
  • Responses are edge-cached (court data ~1h, collection data a few minutes). Expect slight lag.
  • Per-key rate limits apply — watch the RateLimit-Remaining header.
  • CORS is open and GET-only, so browser calls work.

Endpoints

GET/v1/stats
GET/v1/leaderboard
GET/v1/tokens
GET/v1/tokens/:id
GET/v1/tokens/:id/metadata
GET/v1/judges
GET/v1/judges/:id
GET/v1/lawyers
GET/v1/lawyers/:id
GET/v1/market
GET/v1/sales
GET/v1/sales/top
GET/v1/sales/token/:id
GET/v1/listings
GET/v1/tokens/:id/listing
GET/v1/holders
GET/v1/holders/:wallet
GET/v1/tokens/:id/owner
GET/v1/traits
GET/v1/traits/tokens
GET/img/:file

Data schema

Stats

GET /v1/stats

One object summarising the whole collection.

FieldTypeDescription
walletsintegerDistinct wallets holding brainpoints
total_brainpointsintegerSum of all brainpoints
total_actionsintegerTotal recorded off-chain actions

Leaderboard

GET /v1/leaderboard

Brainpoints ranking, high to low. Query: ?limit (1–100).

FieldTypeDescription
rankinteger1-based rank
wallet_addressstringPublic on-chain address
balanceintegerBrainpoints held

Token

GET /v1/tokens · /v1/tokens/:id

Per-token off-chain activity. Query: ?limit, ?offset.

FieldTypeDescription
idintegerToken id
action_countintegerRecorded actions involving this token
last_action_attimestampISO 8601, nullable

Token metadata

GET /v1/tokens/:id/metadata

A token’s collection metadata — traits and image — by token number, from the BRAINROT metadata API (edge-cached).

FieldTypeDescription
idintegerToken number
namestringe.g. BRAINROT #31
descriptionstringCollection description
image_urlstringPublic webp URL, usable in an <img> tag
attributesarray{ trait_type, value } — Archetype, Base, Rarity Tier, Type, Expression, Hat, …

Holder

GET /v1/holders · /v1/holders/:wallet · /v1/tokens/:id/owner

On-chain ownership, refreshed ~6h from Alchemy. /holders ranks wallets by amount held — add ?trait_type=&trait_value= to rank by a trait (e.g. who holds the most Sharks). /holders/:wallet lists a wallet’s token ids; /tokens/:id/owner gives a token’s current owner.

FieldTypeDescription
rankintegerLeaderboard position
walletstringHolder address
tokensintegerCount held (or count of the trait, when filtered)
token_idsinteger[]Held token numbers (on /holders/:wallet)
ownerstringCurrent owner (on /tokens/:id/owner)
as_oftimestampWhen ownership was last refreshed

Trait

GET /v1/traits · /v1/traits/tokens

/traits is the rarity catalog (each trait type → its values + counts + rarity %); add ?type to narrow. /traits/tokens lists the token ids that have a given ?type & ?value.

FieldTypeDescription
trait_typestringe.g. Base, Archetype, Rarity Tier, Hat
valuestringe.g. Shark
countintegerHow many tokens have this value
pctnumberRarity: count / total_tokens (0–1)
token_idsinteger[]Tokens with the trait (on /traits/tokens)

Market

GET /v1/market

Latest collection snapshot, refreshed every ~5 min from OpenSea. Floor price, rolling volumes, sale counts, listed/unlisted, owners.

FieldTypeDescription
floor.price_ethnumberCurrent floor price
floor.symbolstringCurrency (ETH)
volume_ethobjecttotal, day, week, month (ETH)
salesobjecttotal, day, week (counts)
listingsobjectlisted, unlisted, total_supply, listed_pct, cheapest_eth
num_ownersintegerDistinct owners
captured_attimestampISO 8601 snapshot time

Listing

GET /v1/listings · /v1/tokens/:id/listing

Active OpenSea listings, refreshed ~5 min. /listings is cheapest-first; /tokens/:id/listing tells you if a specific token is listed and at what price.

FieldTypeDescription
token_idintegerListed token
price_ethnumberAsking price
currencystringETH | WETH | …
order_hashstringOpenSea order hash
listedbooleanOn /tokens/:id/listing

Sale

GET /v1/sales · /v1/sales/top · /v1/sales/token/:id

Secondary sales, newest first. /sales paginates (?limit, ?offset); /sales/top ranks by price (?window=1d|7d|30d|all); /sales/token/:id is one token’s history. Feed covers the recent history OpenSea exposes; all-time totals live in /v1/market.

FieldTypeDescription
token_idintegerToken sold
price_ethnumberPrice in ETH/WETH terms
price_weistringRaw amount (no precision loss)
currencystringETH | WETH | …
buyerstringBuyer address
sellerstringSeller address
tx_hashstringTransaction hash
marketplacestringSource marketplace
sold_attimestampISO 8601 sale time
order_hashstringOpenSea order hash

Judge

GET /v1/judges · /v1/judges/:id

The 20 AI Court judges. Their biases are eight scoring weights (floats ~0–1 summing to ~1) describing what each judge rewards. Query: ?limit, ?offset.

FieldTypeDescription
idstringe.g. J01–J20
namestringPersonal name
archetypestringe.g. The Dril-Pilled Crank
descriptorstringOne-line bio
native_erastringInternet era they come from
brainrot_literacystringHow fluent they are in brainrot
weightsobjectTHE BIASES — scroll_stop, replicability, quotability, cursedness, cuteness, iconicity, discourse_fuel, lore_density (each a float ~0–1)
dispositionstringTemperament
voice_registerstringHow they speak
verdict_stylestringHow they write rulings
fixationsstringWhat they latch onto
meme_dislikesstringWhat they reject
signature_phrasesstring[]Catchphrases
preferred_lore_tagsstring[]Lore tags they favour
image_urlstringPublic portrait URL

Lawyer

GET /v1/lawyers · /v1/lawyers/:id

The 40 AI Court lawyers — 20 mirror pairs, each an advocate and an adversary. Their statistics are five 1–10 combat stats. Query: ?role=advocate|adversary, ?pair=P01, ?limit, ?offset.

FieldTypeDescription
idstringe.g. L01A (advocate) / L01D (adversary)
namestringPersonal name
archetypestringCharacter archetype
rolestringadvocate | adversary
pair_idstringMirror pair, e.g. P01
partner_idstringThe opposing lawyer in the pair
native_erastringInternet era they come from
brainrot_literacystringHow fluent they are in brainrot
statsobjectTHE STATISTICS — formal_authority, brainrot_fluency, rhetorical_pressure, composure, personal_history_weight (integers 1–10)
dispositionstringTemperament
voice_registerstringHow they speak
philosophical_positionstringTheir worldview on memes
argumentation_stylestringHow they argue
meme_dislikesstringWhat they reject
meme_lovesstringWhat they champion
fixationsstringWhat they latch onto
failure_modestringHow they crack under pressure
signature_phrasesstring[]Catchphrases
image_urlstringPublic portrait URL

Lawyers come in 20 mirror pairs (P01–P20): each pair is one advocate (id ending A) versus one adversary (id ending D). Use ?pair=P03 to fetch both sides.

Examples

# Top 10 brainpoints holders
curl "https://cpi.brainrot.works/v1/leaderboard?limit=10" -H "Authorization: Bearer cpi_live_xxx"

# One judge and their biases
curl https://cpi.brainrot.works/v1/judges/J01 -H "Authorization: Bearer cpi_live_xxx"

# Both lawyers in mirror pair P03
curl "https://cpi.brainrot.works/v1/lawyers?pair=P03" -H "Authorization: Bearer cpi_live_xxx"

# A portrait (public — no key)
https://cpi.brainrot.works/img/J01.png

Ideas — what to build

Buildable today

Brainpoints leaderboard
Top holders, holder counts, rank movement.
Collection pulse
Live totals and activity counters from /v1/stats.
Most-active tokens
Rank tokens by action_count.
Judge bias explorer
Radar charts of each judge’s 8 weights — who rewards cursedness vs cuteness vs lore.
Verdict predictor
Score a token’s vibe against each judge’s weights to guess their ruling.
Lawyer tier lists
Rank all 40 lawyers by composure, pressure, etc.; compare advocate vs adversary in a pair.
Character galleries
Profile cards and galleries built on image_url.
Token explorer
Look up any token’s image + traits by number (/v1/tokens/:id/metadata) — rarity tools, trait filters, collage makers.
Holder leaderboards
Rank wallets by amount held (/v1/holders), whale-watch, or show a wallet’s full portfolio with images + traits.
Rarity & trait tools
Rarity catalog (/v1/traits), trait filters/galleries (/v1/traits/tokens), and “who owns the most of trait X” (/v1/holders?trait_type=&trait_value=).
Bots & quizzes
“Which judge are you,” a Discord bot (!judge J05), or an LLM persona arguing in a lawyer’s voice.
Market dashboards
Live floor + volume + listed/unlisted ratio (/v1/market), a recent-sales ticker (/v1/sales), a biggest-sales hall of fame (/v1/sales/top), and a live listings board (/v1/listings).
Sales bots
Poll /v1/sales and post each new sale to Discord/Telegram/X; flip alerts when a token resells.

On the roadmap (as more data lands)

Holder P&L and cost-basis
Combine /v1/sales history with per-wallet holdings.
Composite rarity score
Weight each token’s traits by rarity into a single score/rank.
Cross-cuts
Rarity × judge-bias scoring, archetype-weighted boards, “rarest wallet”.

For AI agents

A machine-readable version of this reference lives at /llms.txt. It is the source of truth for the schema: stable JSON, paginate with limit/offset, respect RateLimit-Remaining, treat everything as read-only.