THE INDEPENDENT ORACLE FIELD GUIDEBLOCKCHAIN / PREDICTIONS / REAL WORLD ASSETSTHE KNOWLEDGE LAYER

FOUNDATIONS / TOPIC GUIDE

Oracle API

An interface for querying observations, forecasts and asset evidence—with the context every answer needs.

An API is an interface, not a truth guarantee

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.

Define an answer envelope

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.

Keep errors and domain states distinct

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.

Design for the consumer

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.

Example responses

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"
}

Illustrative data, not a live API. These local examples show response structure. No external data is fetched.