Crossbar API Endpoints

This page documents the HTTP and WebSocket endpoints exposed by Crossbar.

Base URL examples:

  • Public: https://crossbar.switchboard.xyz

  • Local: http://localhost:8080

For machine-readable schema and live testing:

  • Swagger UI: GET /docs

  • OpenAPI JSON: GET /api-docs/openapi.json

Core Endpoints

Method
Path
Purpose

GET

/health

Health check

GET

/version

Service version info

GET

/test

Basic test endpoint

GET

/protos/job_schemas.proto

Oracle job protobuf schema

POST

/store

Store v1 feed definition

GET

/fetch/{hash}

Fetch v1 feed definition

POST

/v2/store

Store v2 feed definition

GET

/v2/fetch/{feed_id}

Fetch v2 feed definition

GET

/v2/update/{feedHashes}

Build v2 multi-feed update payload

ANY

/rpc/{network}

RPC passthrough/proxy endpoint

GET

/debug/cid/{hash}

CID conversion/debug

GET

/debug/bnb

Binance debug endpoint

Simulation Endpoints

Generic

Method
Path
Purpose

POST

/simulate

Simulate jobs from request body

POST

/simulate/jobs

Alias for /simulate

GET

/simulate/{feedHashes}

Simulate comma-separated feed hashes

Chain-specific

Method
Path
Purpose

POST

/simulate/solana

Simulate Solana feeds

GET

/simulate/solana/{network}/{feedpubkeys}

Simulate Solana feed pubkeys

POST

/simulate/eclipse

Simulate Eclipse feeds

GET

/simulate/eclipse/{network}/{feedpubkeys}

Simulate Eclipse feed pubkeys

POST

/simulate/evm

Simulate EVM aggregators

GET

/simulate/evm/{network}/{aggregator_ids}

Simulate EVM aggregator IDs

POST

/simulate/aptos

Simulate Aptos feeds

GET

/simulate/aptos/{network}/{feedhashes}

Simulate Aptos feed hashes

POST

/simulate/sui

Simulate Sui feeds

POST

/simulate/sui/feeds

Alias for Sui simulation

GET

/simulate/sui/{network}/{feedids}

Simulate Sui feed IDs

POST

/simulate/iota

Simulate Iota feeds

GET

/simulate/iota/{network}/{feedids}

Simulate Iota feed IDs

V2 simulation

Method
Path
Purpose

POST

/v2/simulate

Simulate v2 feed input payload

GET

/v2/simulate/{feedHashes}

Simulate v2 feed hashes

POST

/v2/simulate/proto

Simulate base64-encoded OracleFeed proto

Backward-compatible API prefix

Crossbar also exposes simulation routes under /api/simulate for compatibility. Example: POST /api/simulate, GET /api/simulate/{feedHashes}.

Update Endpoints

Method
Path
Purpose

GET

/updates/solana/{network}/{feedPubkeys}

Solana update instructions and oracle responses

GET

/updates/eclipse/{network}/{feedPubkeys}

Eclipse update instructions and oracle responses

GET

/updates/evm/{chainId}/{aggregatorIds}

EVM encoded updates

GET

/updates/evm/fetch_update_data/{chain_id}/{feed_ids}

EVM update-data variant

GET

/updates/aptos/{network}/{aggregatorAddresses}

Aptos aggregator updates

GET

/updates/sui/{network}/{aggregatorAddresses}

Sui aggregator updates

GET

/updates/iota/{network}/{aggregatorAddresses}

Iota aggregator updates

Gateway Endpoints

Method
Path
Purpose

GET

`/gateways?network=mainnet

devnet

POST

/gateways/fetch_signatures

Fetch signatures (single feed/job request)

POST

/gateways/fetch_signatures_consensus

Fetch consensus signatures

Oracle and Guardian Endpoints

Method
Path
Purpose

GET

/oracles

List Solana oracles

GET

/oracles/sui

List Sui oracles

GET

/oracles/aptos

List Aptos oracles

POST

/oracles/fetch_signatures

Fetch oracle signatures

GET

/guardians

List guardians

Randomness Endpoints

Method
Path
Purpose

POST

/randomness/evm

Fetch EVM randomness result payload

Stream (Surge) Endpoints

Method
Path
Purpose

GET

/stream/ws

WebSocket stream endpoint

GET

/stream/surge_feeds

List available Surge feeds

POST

/stream/request_session

Create Surge stream session token

GET

/stream/socket_metrics

Stream/socket metrics

GET

/stream/debug_binance

Binance stream debug info

Legacy Surge endpoints are also exposed when Surge is enabled:

Method
Path
Purpose

GET

/v1/surge/stream

Legacy Surge WebSocket endpoint

POST

/v1/surge/session

Legacy Surge session endpoint

Flamegraph Endpoints

Method
Path
Purpose

GET

/flamegraph

Flamegraph status/info

POST

/flamegraph/start

Start profiling

POST

/flamegraph/stop

Stop profiling

GET

/flamegraph/ui

Flamegraph UI

Detailed Request/Response Reference

Use this section for implementation-level request and response shapes. The tables above remain the quick index.

Simulation

POST /simulate/jobs

Purpose: simulate raw OracleJob[] directly (without fetching feed definitions from IPFS).

Request body:

Response (200):

Notes:

  • jobs also accepts base64-encoded protobuf entries.

  • variableOverrides is optional.

  • network defaults to mainnet when omitted.

POST /simulate/solana

Purpose: simulate one or more Solana feed pubkeys by loading on-chain feed state, resolving feed hash, loading jobs from IPFS, and running jobs.

Request body:

Response (200): array of per-feed simulation results.

Notes:

  • network accepts values such as mainnet-beta, devnet, testnet.

  • mainnet is normalized to mainnet-beta.

GET /simulate/{feedHashes}

Purpose: simulate one or more feed hashes directly from IPFS definitions.

Path:

  • feedHashes: comma-separated feed hashes

Query:

  • includeReceipts (bool, optional)

Response (200): array

POST /v2/simulate

Purpose: simulate v2 feed hashes with optional network and variable overrides.

Request body:

Response (200):

Updates

GET /updates/solana/{network}/{feedPubkeys}

Purpose: generate Solana pull update instructions and oracle response metadata.

Path:

  • network: mainnet, mainnet-beta, devnet, testnet

  • feedPubkeys: comma-separated feed pubkeys

Query:

  • numSignatures (u32, optional)

  • payer (string, required)

Response (200): array of update objects

pullIxns object schema:

  • keys: account metas for the instruction.

  • keys[].pubkey: 32-byte pubkey encoded as lowercase hex (64 chars, no 0x).

  • keys[].isSigner: signer flag for that account.

  • keys[].isWritable: writable flag for that account.

  • programId: 32-byte program ID encoded as lowercase hex (64 chars, no 0x).

  • data: instruction data bytes encoded as lowercase hex.

Required accounts behavior (important):

  • There is no separate requiredAccounts field for this endpoint.

  • The canonical account list is pullIxns[i].keys.

  • Account order is significant and must be preserved exactly.

  • isSigner and isWritable flags are part of the instruction contract and must be preserved exactly.

  • Do not reorder, sort, dedupe, or recompute account metas when reconstructing the instruction.

  • lookupTables are provided separately for address lookup table usage in versioned transactions; they do not replace keys.

Non-JS deserialization flow:

  1. Decode hex fields to bytes.

  2. Convert programId and each keys[].pubkey from 32-byte arrays into native pubkey types.

  3. Build account metas from isSigner + isWritable in the same order as returned.

  4. Use decoded data bytes as instruction payload.

Example (Rust):

GET /updates/eclipse/{network}/{feedPubkeys}

Response schema is the same as /updates/solana/{network}/{feedPubkeys}:

  • success: bool

  • pullIxns: array of instruction objects (keys, programId, data)

  • responses: array of oracle responses

  • lookupTables: array of address lookup table pubkeys (base58)

GET /updates/evm/{chainId}/{aggregatorIds}

Purpose: fetch EVM-compatible encoded updates and supporting oracle response data.

Path:

  • chainId: EVM chain ID (example 1, 42161, 1116)

  • aggregatorIds: comma-separated feed IDs

Query:

  • numSignatures (u32, optional)

  • gateway (string, optional)

Response (200): object

EVM response schema:

  • results: array of oracle response objects (includes normalized result and additional gateway-returned fields).

  • failures: array of errors for feeds/oracles that failed during fetch/update building.

  • encoded: array of 0x-prefixed ABI-encoded update payloads.

GET /updates/aptos/{network}/{aggregatorAddresses}

Response (200):

Aptos response schema:

  • responses: per-aggregator update objects returned by Aptos SDK.

  • failures: top-level route errors.

  • encoded: flattened list of encoded Aptos update payloads.

GET /updates/sui/{network}/{aggregatorAddresses}

Response (200):

Sui response schema:

  • responses: per-aggregator update objects returned by Sui SDK (fetchUpdateInfo output).

  • failures: top-level route errors.

GET /updates/iota/{network}/{aggregatorAddresses}

Response (200) matches the Sui endpoint shape:

Gateways

GET /gateways

Purpose: discover active gateway URLs from cached oracle state.

Query:

  • network: mainnet (default), devnet, or testnet

Response (200):

POST /gateways/fetch_signatures

Purpose: fetch signatures for a single feed/jobs request. Supports both legacy and new request shapes.

Legacy body (feed-hash based):

New body (jobs-based):

Response (200): gateway signature response object (signatures + timestamp + variance).

POST /gateways/fetch_signatures_consensus

Purpose: fetch consensus signatures using feed request objects.

Request body:

Response (200):

Stream (Surge)

GET /stream/surge_feeds

Purpose: list currently available Surge feed symbols.

Query:

  • symbol (optional)

  • exchange (optional)

Response (200): feed list object from Surge core. Response (503): no feeds available.

POST /stream/request_session

Purpose: validate API key and create session token + WebSocket URL.

Auth input:

  • Header x-api-key: <key> preferred

  • Also supports Authorization: Bearer <key>

  • Also supports query param api_key=<key>

Request body:

Response (200):

Error responses:

  • 400 missing API key

  • 401 invalid API key

GET /stream/ws

Purpose: WebSocket stream endpoint for Surge updates. For full handshake, auth headers, subscribe payload, and ping/pong flow, see Surge Gateway Protocol.

Minimal curl examples

Simulate Solana feed:

Fetch EVM updates:

Discover gateways:

Notes

  • Some stream and gateway flows require signature/auth headers. See Surge Gateway Protocol.

  • Endpoint behavior can vary by network and environment configuration.

  • Public Crossbar is rate limited by IP. Production systems should self-host.

  • For complete machine schema and current field contracts, use GET /api-docs/openapi.json.

Last updated