# REST API

Real-Time and historical Data API for Stork signed data.

## Authentication

All REST requests must include an `Authorization` header with the value set as `Basic <token>` . For example if your token is `gmork123`:

```bash
curl -X GET 'https://rest.jp.stork-oracle.network/v1/prices/assets' -H "Authorization: Basic gmork123"
```

## Rate Limits

There is currently a universal rate limit of 5 requests/sec.

{% hint style="info" %}
Need a higher rate limit? Reach out to Stork. <sales@stork.network> or [Twitter DMs](https://x.com/storkoracle) open.
{% endhint %}

## Note

This tool is meant to illustrate the structure of REST api responses, but unfortunately due to third party limitations, some loss of precision on large numbers may be experienced in the browser. If you wish to test the verifiability of Stork prices from the REST api, we recommend using CURL to view the raw response.

## List Available Assets

> Get the list of available asset IDs.

```json
{"openapi":"3.0.3","info":{"title":"Stork Oracle API","version":"1.0"},"tags":[{"name":"Prices","description":"Stork for Real Time prices and assets"}],"servers":[{"url":"https://rest.jp.stork-oracle.network"},{"url":"https://rest.dev.stork-oracle.network"}],"security":[{"token_auth":[]}],"components":{"securitySchemes":{"token_auth":{"description":"Enter your token in the format of \"Basic your-token\"","type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"AssetID":{"type":"string","description":"A unique identifier for an asset."}}},"paths":{"/v1/prices/assets":{"get":{"tags":["Prices"],"summary":"List Available Assets","description":"Get the list of available asset IDs.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AssetID"}}}}}}},"404":{"description":"Not Found"}}}}}}
```

## Get Latest Prices

> Get latest real-time prices for specified assets.

```json
{"openapi":"3.0.3","info":{"title":"Stork Oracle API","version":"1.0"},"tags":[{"name":"Prices","description":"Stork for Real Time prices and assets"}],"servers":[{"url":"https://rest.jp.stork-oracle.network"},{"url":"https://rest.dev.stork-oracle.network"}],"security":[{"token_auth":[]}],"components":{"securitySchemes":{"token_auth":{"description":"Enter your token in the format of \"Basic your-token\"","type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"AggregatedSignedPrice":{"type":"object","properties":{"timestamp":{"$ref":"#/components/schemas/Timestamp"},"asset_id":{"$ref":"#/components/schemas/AssetID"},"signature_type":{"$ref":"#/components/schemas/SignatureType"},"trigger":{"type":"string"},"price":{"$ref":"#/components/schemas/QuantizedPrice"},"stork_signed_price":{"$ref":"#/components/schemas/StorkSignedPrice"},"signed_prices":{"type":"array","items":{"$ref":"#/components/schemas/PublisherSignedPrice"}}},"description":"Represents an aggregated signed price with multiple sources."},"Timestamp":{"type":"integer","format":"int64","description":"The UNIX nanosecond timestamp for the signature."},"AssetID":{"type":"string","description":"A unique identifier for an asset."},"SignatureType":{"type":"string","description":"The type of signature in use.","enum":["evm","stark"]},"QuantizedPrice":{"type":"string","description":"A price value multiplied by 10^18 represented as a string."},"StorkSignedPrice":{"type":"object","properties":{"public_key":{"type":"string"},"encoded_asset_id":{"$ref":"#/components/schemas/EncodedAssetID"},"price":{"$ref":"#/components/schemas/QuantizedPrice"},"timestamped_signature":{"$ref":"#/components/schemas/TimestampedSignature"},"publisher_merkle_root":{"type":"string","description":"Root hash for the Merkle tree of publishers."},"calculation_alg":{"$ref":"#/components/schemas/StorkCalculationAlg"}},"description":"A signed price from an aggregator."},"EncodedAssetID":{"type":"string","description":"A base64-encoded asset identifier."},"TimestampedSignature":{"type":"object","properties":{"signature":{"oneOf":[{"$ref":"#/components/schemas/EvmSignature"},{"$ref":"#/components/schemas/StarkSignature"}]},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"msg_hash":{"type":"string","description":"A hash of the signed message."}},"description":"A signature with a timestamp and message hash."},"EvmSignature":{"type":"object","properties":{"r":{"type":"string","description":"r value of ECDSA secp256k1 signature."},"s":{"type":"string","description":"s value of ECDSA secp256k1 signature."},"v":{"type":"string","description":"v value of ECDSA secp256k1 signature."}},"description":"Represents an EVM compliant ECDSA secp256k1 signature with `r`, `s`, and `v` values."},"StarkSignature":{"type":"object","properties":{"r":{"type":"string"},"s":{"type":"string"}},"description":"Represents a Stark signature with `r` and `s` values."},"StorkCalculationAlg":{"type":"object","properties":{"type":{"type":"string","description":"The type of calculation algorithm.","enum":["median","average","weighted average"]},"version":{"type":"string","description":"Version of the calculation algorithm."},"checksum":{"type":"string","description":"Checksum for validation."}},"description":"Contains metadata about a calculation algorithm."},"PublisherSignedPrice":{"type":"object","properties":{"publisher_key":{"$ref":"#/components/schemas/PublisherKey"},"external_asset_id":{"$ref":"#/components/schemas/AssetID"},"signature_type":{"$ref":"#/components/schemas/SignatureType"},"price":{"$ref":"#/components/schemas/QuantizedPrice"},"timestamped_signature":{"$ref":"#/components/schemas/TimestampedSignature"},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["publisher_key","external_asset_id","signature_type","price","timestamped_signature"],"description":"Contains signed price data from a publisher."},"PublisherKey":{"type":"string","description":"The key identifying the publisher."},"Metadata":{"type":"object","additionalProperties":true,"description":"A key-value map for additional metadata.","nullable":true},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/v1/prices/latest":{"get":{"tags":["Prices"],"summary":"Get Latest Prices","description":"Get latest real-time prices for specified assets.","parameters":[{"name":"assets","in":"query","description":"Comma-separated list of asset symbols (e.g. BTCUSD,ETHUSD)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/AggregatedSignedPrice"}}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get Recent Prices

> Get signed prices for specified assets at a specific timestamp within the last 10 minutes.

```json
{"openapi":"3.0.3","info":{"title":"Stork Oracle API","version":"1.0"},"tags":[{"name":"Prices","description":"Stork for Real Time prices and assets"}],"servers":[{"url":"https://rest.jp.stork-oracle.network"},{"url":"https://rest.dev.stork-oracle.network"}],"security":[{"token_auth":[]}],"components":{"securitySchemes":{"token_auth":{"description":"Enter your token in the format of \"Basic your-token\"","type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"AggregatedSignedPrice":{"type":"object","properties":{"timestamp":{"$ref":"#/components/schemas/Timestamp"},"asset_id":{"$ref":"#/components/schemas/AssetID"},"signature_type":{"$ref":"#/components/schemas/SignatureType"},"trigger":{"type":"string"},"price":{"$ref":"#/components/schemas/QuantizedPrice"},"stork_signed_price":{"$ref":"#/components/schemas/StorkSignedPrice"},"signed_prices":{"type":"array","items":{"$ref":"#/components/schemas/PublisherSignedPrice"}}},"description":"Represents an aggregated signed price with multiple sources."},"Timestamp":{"type":"integer","format":"int64","description":"The UNIX nanosecond timestamp for the signature."},"AssetID":{"type":"string","description":"A unique identifier for an asset."},"SignatureType":{"type":"string","description":"The type of signature in use.","enum":["evm","stark"]},"QuantizedPrice":{"type":"string","description":"A price value multiplied by 10^18 represented as a string."},"StorkSignedPrice":{"type":"object","properties":{"public_key":{"type":"string"},"encoded_asset_id":{"$ref":"#/components/schemas/EncodedAssetID"},"price":{"$ref":"#/components/schemas/QuantizedPrice"},"timestamped_signature":{"$ref":"#/components/schemas/TimestampedSignature"},"publisher_merkle_root":{"type":"string","description":"Root hash for the Merkle tree of publishers."},"calculation_alg":{"$ref":"#/components/schemas/StorkCalculationAlg"}},"description":"A signed price from an aggregator."},"EncodedAssetID":{"type":"string","description":"A base64-encoded asset identifier."},"TimestampedSignature":{"type":"object","properties":{"signature":{"oneOf":[{"$ref":"#/components/schemas/EvmSignature"},{"$ref":"#/components/schemas/StarkSignature"}]},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"msg_hash":{"type":"string","description":"A hash of the signed message."}},"description":"A signature with a timestamp and message hash."},"EvmSignature":{"type":"object","properties":{"r":{"type":"string","description":"r value of ECDSA secp256k1 signature."},"s":{"type":"string","description":"s value of ECDSA secp256k1 signature."},"v":{"type":"string","description":"v value of ECDSA secp256k1 signature."}},"description":"Represents an EVM compliant ECDSA secp256k1 signature with `r`, `s`, and `v` values."},"StarkSignature":{"type":"object","properties":{"r":{"type":"string"},"s":{"type":"string"}},"description":"Represents a Stark signature with `r` and `s` values."},"StorkCalculationAlg":{"type":"object","properties":{"type":{"type":"string","description":"The type of calculation algorithm.","enum":["median","average","weighted average"]},"version":{"type":"string","description":"Version of the calculation algorithm."},"checksum":{"type":"string","description":"Checksum for validation."}},"description":"Contains metadata about a calculation algorithm."},"PublisherSignedPrice":{"type":"object","properties":{"publisher_key":{"$ref":"#/components/schemas/PublisherKey"},"external_asset_id":{"$ref":"#/components/schemas/AssetID"},"signature_type":{"$ref":"#/components/schemas/SignatureType"},"price":{"$ref":"#/components/schemas/QuantizedPrice"},"timestamped_signature":{"$ref":"#/components/schemas/TimestampedSignature"},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["publisher_key","external_asset_id","signature_type","price","timestamped_signature"],"description":"Contains signed price data from a publisher."},"PublisherKey":{"type":"string","description":"The key identifying the publisher."},"Metadata":{"type":"object","additionalProperties":true,"description":"A key-value map for additional metadata.","nullable":true},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/v1/prices/recent":{"get":{"tags":["Prices"],"summary":"Get Recent Prices","description":"Get signed prices for specified assets at a specific timestamp within the last 10 minutes.","parameters":[{"name":"timestamp","in":"query","description":"Unix timestamp in seconds","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"assets","in":"query","description":"Comma-separated list of asset symbols (e.g. BTCUSD,ETHUSD)","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/AggregatedSignedPrice"}}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```

## Get Historical Price Metrics

> Get OHLC price data for a specific asset within a time range.

```json
{"openapi":"3.0.3","info":{"title":"Stork Oracle API","version":"1.0"},"tags":[{"name":"Trading View","description":"Historical price metrics"}],"servers":[{"url":"https://rest.jp.stork-oracle.network"},{"url":"https://rest.dev.stork-oracle.network"}],"security":[{"token_auth":[]}],"components":{"securitySchemes":{"token_auth":{"description":"Enter your token in the format of \"Basic your-token\"","type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"AssetID":{"type":"string","description":"A unique identifier for an asset."},"TradingViewHistoryResponse":{"type":"object","properties":{"t":{"type":"array","items":{"type":"integer","description":"Unix timestamp in seconds"}},"o":{"type":"array","items":{"type":"number","format":"double","description":"Open price"}},"h":{"type":"array","items":{"type":"number","format":"double","description":"High price"}},"l":{"type":"array","items":{"type":"number","format":"double","description":"Low price"}},"c":{"type":"array","items":{"type":"number","format":"double","description":"Close price"}}},"description":"OHLC price data with timestamps"}}},"paths":{"/v1/tradingview/history":{"get":{"tags":["Trading View"],"summary":"Get Historical Price Metrics","description":"Get OHLC price data for a specific asset within a time range.","parameters":[{"name":"from","in":"query","description":"Start timestamp (Unix seconds)","required":true,"schema":{"type":"integer"}},{"name":"to","in":"query","description":"Start timestamp (Unix seconds)","required":true,"schema":{"type":"integer"}},{"name":"resolution","in":"query","description":"Time resolution in minutes, or 1 day, 1 week, or 1 month.","required":true,"schema":{"type":"string","enum":["1","2","5","15","30","60","120","240","360","720","D","1D","W","1W","M","1M"]}},{"name":"symbol","in":"query","description":"Asset ID","required":true,"schema":{"$ref":"#/components/schemas/AssetID"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/TradingViewHistoryResponse"}}}}}}}}}}}
```

## List EVM chain Deployments

> Get the list of EVM chain deployments and their details.

```json
{"openapi":"3.0.3","info":{"title":"Stork Oracle API","version":"1.0"},"tags":[],"servers":[{"url":"https://rest.jp.stork-oracle.network"},{"url":"https://rest.dev.stork-oracle.network"}],"paths":{"/v1/deployments/evm":{"get":{"tags":["Deployments"],"summary":"List EVM chain Deployments","description":"Get the list of EVM chain deployments and their details.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Deployment"}}}}}}}}}}},"components":{"schemas":{"Deployment":{"type":"object","properties":{"chain_id":{"type":"integer","description":"The chain ID of the deployment."},"network":{"type":"string","description":"The network of the deployment."},"environment":{"type":"string","description":"The environment of the deployment."},"proxy_address":{"type":"string","description":"The proxy address of the deployment."},"block_explorer_url":{"type":"string","description":"The block explorer URL of the deployment."}},"description":"Represents an EVM chain deployment."}}}}
```

## \[Alpha] List assets being pushed on-chain by Stork

> \[Alpha] List assets and their configuration details being pushed on-chain by Stork Labs by chain and environment.

```json
{"openapi":"3.0.3","info":{"title":"Stork Oracle API","version":"1.0"},"tags":[],"servers":[{"url":"https://rest.jp.stork-oracle.network"},{"url":"https://rest.dev.stork-oracle.network"}],"security":[{"token_auth":[]}],"components":{"securitySchemes":{"token_auth":{"description":"Enter your token in the format of \"Basic your-token\"","type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"PushedAsset":{"type":"object","properties":{"delta":{"type":"number","description":"The delta change percentage to trigger a price update."},"staleness":{"type":"integer","description":"The maximum staleness in seconds to trigger a price update."}},"description":"Represents an asset being pushed on-chain by Stork."}}},"paths":{"/v0/deployments/stork_pushed_assets":{"get":{"tags":["Deployments"],"summary":"[Alpha] List assets being pushed on-chain by Stork","description":"[Alpha] List assets and their configuration details being pushed on-chain by Stork Labs by chain and environment.","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/PushedAsset"}}}}}}}}}}}}}}
```

## Get Market State Change Info

> Get the current market status, next market status, and the time of the next status change for a given asset.\
> Returns three signed values keyed by synthetic asset IDs:\
> \- \`{asset\_id}\_CURRENT\_STATUS\` — current market status code\
> \- \`{asset\_id}\_NEXT\_STATUS\` — next market status code\
> \- \`{asset\_id}\_CHANGE\_TIME\` — Unix timestamp (seconds) of the next status change\
> \
> \*\*Status codes:\*\*\
> \| Code | Meaning |\
> \|------|---------|\
> \| 0 | Closed |\
> \| 1 | Regular Hours |\
> \| 2 | Extended Hours |\
> \| 3 | After Hours |\
> \
> Supported asset classes: US equities (e.g. \`AAPL\_24\_5\`, \`TSLA\_24\_5\`), forex pairs (e.g. \`EURUSD\`, \`USDJPY\`), and metals (\`XAUUSD\`, \`XAGUSD\`).

```json
{"openapi":"3.0.3","info":{"title":"Stork Oracle API","version":"1.0"},"tags":[{"name":"Market Status","description":"Market open/close status and schedule information for equities, forex, and metals"}],"servers":[{"url":"https://rest.jp.stork-oracle.network"},{"url":"https://rest.dev.stork-oracle.network"}],"security":[{"token_auth":[]}],"components":{"securitySchemes":{"token_auth":{"description":"Enter your token in the format of \"Basic your-token\"","type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"AssetID":{"type":"string","description":"A unique identifier for an asset."},"AggregatedSignedPrice":{"type":"object","properties":{"timestamp":{"$ref":"#/components/schemas/Timestamp"},"asset_id":{"$ref":"#/components/schemas/AssetID"},"signature_type":{"$ref":"#/components/schemas/SignatureType"},"trigger":{"type":"string"},"price":{"$ref":"#/components/schemas/QuantizedPrice"},"stork_signed_price":{"$ref":"#/components/schemas/StorkSignedPrice"},"signed_prices":{"type":"array","items":{"$ref":"#/components/schemas/PublisherSignedPrice"}}},"description":"Represents an aggregated signed price with multiple sources."},"Timestamp":{"type":"integer","format":"int64","description":"The UNIX nanosecond timestamp for the signature."},"SignatureType":{"type":"string","description":"The type of signature in use.","enum":["evm","stark"]},"QuantizedPrice":{"type":"string","description":"A price value multiplied by 10^18 represented as a string."},"StorkSignedPrice":{"type":"object","properties":{"public_key":{"type":"string"},"encoded_asset_id":{"$ref":"#/components/schemas/EncodedAssetID"},"price":{"$ref":"#/components/schemas/QuantizedPrice"},"timestamped_signature":{"$ref":"#/components/schemas/TimestampedSignature"},"publisher_merkle_root":{"type":"string","description":"Root hash for the Merkle tree of publishers."},"calculation_alg":{"$ref":"#/components/schemas/StorkCalculationAlg"}},"description":"A signed price from an aggregator."},"EncodedAssetID":{"type":"string","description":"A base64-encoded asset identifier."},"TimestampedSignature":{"type":"object","properties":{"signature":{"oneOf":[{"$ref":"#/components/schemas/EvmSignature"},{"$ref":"#/components/schemas/StarkSignature"}]},"timestamp":{"$ref":"#/components/schemas/Timestamp"},"msg_hash":{"type":"string","description":"A hash of the signed message."}},"description":"A signature with a timestamp and message hash."},"EvmSignature":{"type":"object","properties":{"r":{"type":"string","description":"r value of ECDSA secp256k1 signature."},"s":{"type":"string","description":"s value of ECDSA secp256k1 signature."},"v":{"type":"string","description":"v value of ECDSA secp256k1 signature."}},"description":"Represents an EVM compliant ECDSA secp256k1 signature with `r`, `s`, and `v` values."},"StarkSignature":{"type":"object","properties":{"r":{"type":"string"},"s":{"type":"string"}},"description":"Represents a Stark signature with `r` and `s` values."},"StorkCalculationAlg":{"type":"object","properties":{"type":{"type":"string","description":"The type of calculation algorithm.","enum":["median","average","weighted average"]},"version":{"type":"string","description":"Version of the calculation algorithm."},"checksum":{"type":"string","description":"Checksum for validation."}},"description":"Contains metadata about a calculation algorithm."},"PublisherSignedPrice":{"type":"object","properties":{"publisher_key":{"$ref":"#/components/schemas/PublisherKey"},"external_asset_id":{"$ref":"#/components/schemas/AssetID"},"signature_type":{"$ref":"#/components/schemas/SignatureType"},"price":{"$ref":"#/components/schemas/QuantizedPrice"},"timestamped_signature":{"$ref":"#/components/schemas/TimestampedSignature"},"metadata":{"$ref":"#/components/schemas/Metadata"}},"required":["publisher_key","external_asset_id","signature_type","price","timestamped_signature"],"description":"Contains signed price data from a publisher."},"PublisherKey":{"type":"string","description":"The key identifying the publisher."},"Metadata":{"type":"object","additionalProperties":true,"description":"A key-value map for additional metadata.","nullable":true},"ErrorResponse":{"type":"object","properties":{"error":{"type":"string"}}}}},"paths":{"/v1/market_status":{"get":{"tags":["Market Status"],"summary":"Get Market State Change Info","description":"Get the current market status, next market status, and the time of the next status change for a given asset.\nReturns three signed values keyed by synthetic asset IDs:\n- `{asset_id}_CURRENT_STATUS` — current market status code\n- `{asset_id}_NEXT_STATUS` — next market status code\n- `{asset_id}_CHANGE_TIME` — Unix timestamp (seconds) of the next status change\n\n**Status codes:**\n| Code | Meaning |\n|------|---------|\n| 0 | Closed |\n| 1 | Regular Hours |\n| 2 | Extended Hours |\n| 3 | After Hours |\n\nSupported asset classes: US equities (e.g. `AAPL_24_5`, `TSLA_24_5`), forex pairs (e.g. `EURUSD`, `USDJPY`), and metals (`XAUUSD`, `XAGUSD`).","parameters":[{"name":"asset_id","in":"query","description":"The asset ID to get market status for (e.g. AAPL_24_5, EURUSD, XAUUSD)","required":true,"schema":{"$ref":"#/components/schemas/AssetID"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","description":"A map of synthetic asset IDs to their signed price values representing market status info.","additionalProperties":{"$ref":"#/components/schemas/AggregatedSignedPrice"}}}}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}}}
```
