# Shadow RPC

Every shadow fork comes with its own Shadow RPC and a standard set of JSON-RPC endpoints. Shadow RPCs look and feel like a normal RPC, but contains additional shadow data that's custom to your shadow fork.&#x20;

Each Shadow RPC is versioned, which allows you to safely deploy changes to your shadow fork and test them without disrupting previously running jobs.

```bash
https://rpc.shadow.xyz/ethereum/mainnet/v1/<fork_id>/<version>
```

Since your Shadow RPC behaves like a normal RPC, you can use it as a drop-in replacement in your own infrastructure (e.g. include shadow events in your custom indexer, or add shadow events to your self-hosted subgraph).

## API keys

Every request to your Shadow RPC must include the API key in the header of the request. See the [API keys](https://docs.shadow.xyz/getting-data/api-keys) page for more details.

```bash
curl https://rpc.shadow.xyz/ethereum/mainnet/v1/<fork_id>/<version> \
  -X POST \
  -H "Content-Type: application/json" \
  -H "X-SHADOW-API-KEY: <API_KEY>" \
  --data '{
    "method": "eth_getLogs",
    "params": [{
      "fromBlock": "safe",
      "toBlock": "latest",
      "address": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
      "topics": []
    }],
    "id": 1,
    "jsonrpc": "2.0"
  }'
```

## Supported endpoints

{% hint style="info" %}
Free trial accounts are currently rate limited to 60 RPC requests per minute.
{% endhint %}

Shadow RPCs currently support the following endpoints:

1. `eth_chainId`
2. `net_version`
3. `web3_clientVersion`
4. `eth_blockNumber`
5. `eth_getBlockByHash`
6. `eth_getBlockByNumber`
7. `eth_getTransactionByHash`
8. `eth_getTransactionReceipt`
9. `eth_getBlockReceipts`
10. `eth_getLogs`
11. `eth_getTransactionByBlockNumberAndIndex`
12. `eth_getTransactionByBlockHashAndIndex`
13. `eth_getBlockTransactionCountByHash`
14. `eth_getBlockTransactionCountByNumber`
15. `eth_call` (*does not currently support state override set params)*

We're working getting to 100% parity for all JSON-RPC endpoints. Don't see one you need? Let us know in our [Telegram chat](https://t.me/shadow_devs).

## RPC frontfills

{% hint style="info" %}
RPC frontfills are included on free trials and paid [Shadow Fork plans](https://www.shadow.xyz/pricing).
{% endhint %}

As soon as you deploy a shadow contract, your shadow fork RPC will start frontfilling new data within seconds. This means that you can request any data that is generated for new blocks that occur after the point of your shadow contract deployment.

## RPC backfills

{% hint style="info" %}
RPC backfills are includes on paid [Pro Shadow Fork plans](https://www.shadow.xyz/pricing).
{% endhint %}

You can also tell Shadow to backfill your shadow fork RPC, which will trigger a background job that populates historical data going back to the genesis block. Once the RPC backfill job is completed, you'll be able to request any historical data for past blocks on your shadow fork.

<figure><img src="https://4112099338-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS7wZ4G2hJbxyJhrQE8Kz%2Fuploads%2F3CnNarvIl6iAcAErHpQm%2Fimage.png?alt=media&#x26;token=9fd3822a-adca-44ed-8463-34114811855e" alt=""><figcaption></figcaption></figure>
