Prediction Oracle API Design: Probabilities, Evidence and Answer Types
Design typed responses that distinguish an observed fact, a future estimate and a final outcome without pretending certainty.
FOUNDATIONS / TOPIC GUIDE
An interface for querying observations, forecasts and asset evidence—with the context every answer needs.
An oracle API gives applications a way to request or receive an answer. In this guide, an oracle is a queryable source of information: a data observation, a forecast, an attestation or a resolved result. A blockchain oracle adds a path for consuming such information onchain.
A successful response says that the interface returned something. It does not automatically establish that the information is current, appropriate for the requested action or supported by sufficient evidence. The client still needs an acceptance policy.
A useful conceptual envelope identifies the answer type, subject, schema version, status and relevant times. An observation adds units and measurement quality. A forecast adds a defined event and horizon. An attestation adds an explicit claim and evidence scope.
These are illustrative design choices, not a published interoperability standard. The local fixtures below use fictional values and identifiers. OracleAPI.com is an educational static website, not a hosted data provider, account service or API-key issuer.
A missing observation should not silently become zero. An unresolved event should not become false. A forecast outside the supported question class should produce an explicit unsupported state rather than a confident guess.
Separate observation time from delivery time and preserve versioned question definitions. A response can be syntactically valid while referring to the wrong asset or an unacceptable period. Validate those conditions before using the answer in a calculation or state change.
Document stable identifiers, supported scales, timestamp semantics, freshness rules and nonanswer states. Keep explanations separate from machine-readable status. Provide controlled fixtures for both accepted and rejected examples.
Explore Prediction Oracle API for estimates and resolutions, Price Data Oracle for measurements, or Real World Asset Oracle for asset evidence.
Each file below is a fictional, local JSON fixture. Select a response type, copy its structure, or open its downloadable example. Values do not represent live prices, forecasts or asset statements.
CONCEPTUAL RESPONSE / STATIC EXAMPLE
{
"schema_version": "1.0",
"example_only": true,
"answer_type": "observation",
"subject_id": "demo:asset-usd",
"status": "illustrative",
"observed_at": "2026-09-08T12:00:00Z",
"value": {
"integer": "125000",
"exponent": -3,
"unit": "USD"
},
"source_id": "demo:publisher"
}CONCEPTUAL RESPONSE / STATIC EXAMPLE
{
"schema_version": "1.0",
"example_only": true,
"answer_type": "forecast",
"question_id": "demo:publication-by-deadline",
"status": "illustrative",
"issued_at": "2026-09-08T12:00:00Z",
"horizon": "2026-09-30T23:59:59Z",
"probability": 0.64,
"method_version": "demo-v1"
}CONCEPTUAL RESPONSE / STATIC EXAMPLE
{
"schema_version": "1.0",
"example_only": true,
"answer_type": "attestation",
"subject_id": "demo:warehouse-batch",
"status": "illustrative",
"effective_at": "2026-09-08T12:00:00Z",
"claim": "A fictional inventory observation",
"scope": "Quantity only; no rights or solvency claim",
"report_id": "demo:report-001"
}Illustrative data, not a live API. These local examples show response structure. No external data is fetched.