04 / Guide · Developers

Oracle API

Price

0.001 SOL / call

01

Buy an API key

POST/api/keys

Send SOL to the treasury (0.001 SOL per call), then redeem the payment. Sign the message “Pinpoint oracle API key for payment <signature>” with the paying wallet so nobody else can redeem it.

Request

POST /api/keys
content-type: application/json

{
  "signature": "<payment transaction>",
  "owner": "<paying wallet>",
  "proof": "<base64 ed25519 signature>"
}

Response

201 Created

{
  "apiKey": "sig_…",
  "credits": 10
}

02

Read a crowd forecast

GET/api/v1/forecast/{round | latest}

The stake-weighted median of a settled round’s revealed guesses, its interquartile range, and a confidence score: the share of stake within ±0.1% of the median. One call costs one credit.

Request

GET /api/v1/forecast/latest
x-api-key: sig_…

Response

200 OK

{
  "round": 5983021,
  "settledPrice": 142.388,
  "forecast": {
    "median": 142.371,
    "p25": 142.210,
    "p75": 142.505,
    "confidence": 0.62,
    "revealedGuesses": 184
  },
  "creditsLeft": 9
}

Errors

401Missing or unknown API key
402Out of credits
404Round has no players
409Payment already redeemed