> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blockops.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Base

> Endpoints and example requests for Base Mainnet and Base Sepolia.

Base is a secure, low-cost, builder-friendly Ethereum L2 built to bring the next billion users onchain.

### How to Connect to Base

You can connect to Base using Blockops private API endpoints. Secure your data, speed up your queries, and take control of your API usage with our RPC API endpoint and personalized API keys. [Sign up now](https://app.blockops.network) to get your own API key.

### Base Mainnet

To get your API key, create a project using a unique Identifier as the project name and select Base from the network options.

<Frame caption="Create a Base project">
  <img src="https://mintcdn.com/blockops-3855c227/OGmnNOc7FURsTCyJ/images/base-create.png?fit=max&auto=format&n=OGmnNOc7FURsTCyJ&q=85&s=fb2e41c61355d4d9c6bb926e93061aa1" alt="" width="2552" height="1426" data-path="images/base-create.png" />
</Frame>

Open the project to view your api key and rpc endpoints.

<Frame caption="view Base project">
  <img src="https://mintcdn.com/blockops-3855c227/OGmnNOc7FURsTCyJ/images/base-view.png?fit=max&auto=format&n=OGmnNOc7FURsTCyJ&q=85&s=15639bd0fd91a98690da9b2fcec65709" alt="" width="2552" height="1426" data-path="images/base-view.png" />
</Frame>

### Base Sepolia

To get your API key, create a project using a unique Identifier as the project name and select Base Sepolia from the network options.

<Frame caption="Create a Base Sepolia project">
  <img src="https://mintcdn.com/blockops-3855c227/OGmnNOc7FURsTCyJ/images/base-sepolia-create.png?fit=max&auto=format&n=OGmnNOc7FURsTCyJ&q=85&s=f030f88b2aeb9a631210ec1e9b2f9a7d" alt="" width="2552" height="1426" data-path="images/base-sepolia-create.png" />
</Frame>

Open the project to view your api key and rpc endpoints.

<Frame caption="view Base Sepolia project">
  <img src="https://mintcdn.com/blockops-3855c227/OGmnNOc7FURsTCyJ/images/base-sepolia-view.png?fit=max&auto=format&n=OGmnNOc7FURsTCyJ&q=85&s=d7200ce3d42b42fc657ff0439ce58755" alt="" width="2552" height="1426" data-path="images/base-sepolia-view.png" />
</Frame>

#### Send requests

<Note>
  All requests are `POST` requests.
</Note>

<Tabs>
  <Tab title="Https">
    For Base Mainnet

    ```bash theme={null}
    https://base.blockops.network/?api_key=************
    ```

    For Base Sepolia

    ```bash theme={null}
    https://base-sepolia-rpc.blockops.network?api_key=************
    ```
  </Tab>

  <Tab title="Websocket">
    For Base Mainnet

    ```bash theme={null}
    wss://base.blockops.network?api_key=************
    ```

    For Base Sepolia

    ```bash theme={null}
    wss://base-sepolia-ws.blockops.network?api_key=************
    ```
  </Tab>
</Tabs>

**Connect via Command Line**

You can connect to the network using websocket or HTTP with your API key in two ways:

* Adding the API key as a query string `?api_key=${APIKEY}`
* Or the request header `-H 'authorization: APIKEY ${APIKEY}'`

**Curl**

For example, the following CURL command can be used to get a block number.

### Base Mainnet

```bash theme={null}
curl -H "Content-Type: application/json" -H 'authorization: APIKEY xxxx'  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' https://base.blockops.network
```

### Base Sepolia

```bash theme={null}
curl -H "Content-Type: application/json" -H 'authorization: APIKEY xxxx'  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' https://base-sepolia-rpc.blockops.network
```

Here is the response you will receive back.

```bash theme={null}
{"jsonrpc":"2.0","id":1,"result":"0x10666b"}
```

**Wscat**

If you want to send data requests with WebSockets, you can use several libraries or wscat. You can install and use wscat as follows:

* Download wscat from [https://www.npmjs.com/package/wscat](https://www.npmjs.com/package/wscat)
* Install wscat by running the following command: `npm install -g wscat`

You can connect to the network with wscat using two options by adding the API key as a query string.

### Base Mainnet

```bash theme={null}
wscat -c 'wss://base.blockops.network?api_key=*********************'
```

Or the request header.

```bash theme={null}
wscat -c 'wss://base.blockops.network' --header 'authorization: APIKEY xxxx'
```

### Base Sepolia

```bash theme={null}
wscat -c 'wss://base-sepolia-rpc.blockops.network?api_key=*********************'
```

Or the request header.

```bash theme={null}
wscat -c 'wss://base-sepolia-ws.blockops.network' --header 'authorization: APIKEY xxxx'
```

After executing the command, the terminal will display a message indicating that the connection has been enabled successfully.

```bash theme={null}
Connected (press CTRL+C to quit)
>
```

Then, you can send the following request:

```
{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}
```

<Note>
  For more information on the Base network, please see the official [Base developer documentation](https://docs.base.org/).
</Note>

Login or set up an account [here](https://app.blockops.network) to get started!

#### ***Quick Links***

[Website](https://www.base.org/)

[Github](https://github.com/base-org)
