# Oracles API

The Blocknative Gas Oracles API provides metadata on supported chains, including their chain ID, label, architecture, RPC url, block explorer url and oracle addresses keyed by version. This allows developers to dynamically identify which networks have live supported gas estimation oracles.

## Authentication <a href="#api-endpoint" id="api-endpoint"></a>

A valid Blocknative API key is OPTIONAL in the `Authorization` Header of every request. Request an API key [here](https://www.blocknative.com/request-api-key).

A free API key is recommended for more generous rate limits and future features.

## API Endpoint

<mark style="color:blue;">`GET`</mark> `https://api.blocknative.com/oracles`

Returns a list of supported gas oracles per chain along with their chain ID, label, architecture (e.g., `evm`), RPC url, block explorer url and oracle addresses keyed by version (e.g. `"2":"0x1c51B22954af03FE11183aaDF43F6415907a9287"`). This allows users to identify networks that have supported oracles where Blocknative provides onchain gas price estimation. The list and available fields are subject to change as new chains or parameters are added or updated.

## Rate Limits <a href="#rate-limits" id="rate-limits"></a>

Each endpoint is limited to provide updated results once per second for paid tier API keys, or every 5 seconds for free tier API keys. Polling faster than these rates may deliver stale data.

## **Example Request**

```bash
curl -H 'Authorization: optional-apikey-here'
     'https://api.blocknative.com/oracle'
```

## **Headers**

| Name          | Type   | Description                                                |
| ------------- | ------ | ---------------------------------------------------------- |
| Authorization | String | <p>OPTIONAL</p><p>if used, must contain a valid apikey</p> |

## **Response Codes**

| Code  | Description                                     |
| ----- | ----------------------------------------------- |
| `200` | Success                                         |
| `401` | API key invalid or not provided                 |
| `429` | Rate limit exceeded. Refer to headers for retry |

### **Example Response**

```json
[
    {
        "chainId": 42161,
        "label": "Arbitrum One",
        "name": "arbitrum",
        "network": "mainnet",
        "addressByVersion": {
            "2": "0x1c51B22954af03FE11183aaDF43F6415907a9287"
        },
        "rpcUrl": "https://arbitrum.llamarpc.com",
        "blockExplorerUrl": "https://arbiscan.io/",
        "arch": "evm",
        "icon": "https://bnc-assets.com/evm/42161/assets/icon.svg",
        "testnet": false
    },
    {
        "chainId": 11155111,
        "label": "Ethereum Sepolia",
        "name": "ethereum-sepolia",
        "network": "mainnet",
        "addressByVersion": {
            "2": "0xCc936bE977BeDb5140C5584d8B6043C9068622A6",
            "1": "0xE4859432d9Af6D40C2D923e3F13D66057F4AEcA0"
        },
        "rpcUrl": "https://endpoints.omniatech.io/v1/eth/sepolia/public",
        "blockExplorerUrl": "https://sepolia.etherscan.io",
        "arch": "evm",
        "icon": "https://bnc-assets.com/evm/11155111/assets/icon.svg",
        "testnet": true
    },
    {
        "chainId": 10,
        "label": "Optimism",
        "name": "optimism",
        "network": "mainnet",
        "addressByVersion": {
            "2": "0x152bB09cE15f1149dBE46EB9E4D4e1B572513453"
        },
        "rpcUrl": "https://optimism.llamarpc.com",
        "blockExplorerUrl": "https://optimistic.etherscan.io/",
        "arch": "evm",
        "icon": "https://bnc-assets.com/evm/10/assets/icon.svg",
        "testnet": false
    },
    ...
]
```

### **Response Fields**

| Field              | Type                    | Description                                                                                                                                                                                                                                 |
| ------------------ | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `arch`             | String                  | The blockchain architecture (e.g., `"evm"`).                                                                                                                                                                                                |
| `chainId`          | Integer                 | The unique identifier for the blockchain (e.g., `1` for Ethereum).                                                                                                                                                                          |
| `label`            | String                  | The human-readable name of the blockchain (e.g., `"Polygon zkEVM"`).                                                                                                                                                                        |
| `icon`             | String                  | URL to the blockchain's icon.                                                                                                                                                                                                               |
| `system`           | String                  | The human-readable name of the ecosystem, (e.g.  `"ethereum"` or `"bitcoin"`)                                                                                                                                                               |
| `network`          | String                  | Internal name of the blockchain (e.g. `"main"` or `"sepolia"`). See [chain table](https://docs.blocknative.com/gas-platform#gas-platform-currently-supports-the-following-networks).                                                        |
| `addressByVersion` | Object\<String, String> | An objects with the inner keys representing the contract version of the oracle and the value of given key being the gas oracle address (e.g. `<oracleVersion> : <contractAddress>` \|\| `"2": "0x152bB09cE15f1149dBE46EB9E4D4e1B572513453"` |
| `rpcUrl`           | String                  | A public RPC Url for the given chain (e.g. `"https://optimism.llamarpc.com"`)                                                                                                                                                               |
| `blockExplorerUrl` | String                  | A public Block Explorer Url for the given chain (e.g. `"https://optimistic.etherscan.io/"`)                                                                                                                                                 |

## **Notes**

* The list of supported blockchains and available features may change as new networks are integrated.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.blocknative.com/gas-prediction/gas-platform-2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
