# Canto API

<table><thead><tr><th width="218">Network</th><th>Endpoint</th></tr></thead><tbody><tr><td>Canto Mainnet</td><td><a href="https://rpc.ansybl.io/canto/mainnet/">https://rpc.ansybl.io/canto/mainnet</a>/&#x3C;endpoint></td></tr><tr><td>Canto Testnet</td><td><a href="https://rpc.ansybl.io/canto/mainnet/">https://rpc.ansybl.io/canto/testnet</a>/&#x3C;endpoint></td></tr></tbody></table>

## EVM RPC

[https://rpc.ansybl.io/canto/mainnet/evm\_rpc/](https://rpc.ansybl.io/canto/testnet/evm_rpc/)

#### Example: get latest block

{% code overflow="wrap" fullWidth="false" %}

```bash
curl 'https://rpc.ansybl.io/canto/mainnet/evm_rpc/?X-API-KEY=<YOUR_API_KEY>' --data '{"jsonrpc":"2.0","method":"eth_getBlockByNumber","params":["latest", false],"id":1}' --header 'Content-Type: application/json'
```

{% endcode %}

{% hint style="info" %}
You can alternatively pass your api key as a header. \
\
Example:

<pre class="language-bash" data-overflow="wrap" data-full-width="false"><code class="lang-bash"><strong>curl https://rpc.ansybl.io/canto/mainnet/evm_rpc/ --header "X-API-KEY: &#x3C;YOUR_API_KEY>" --data '{"jsonrpc": "2.0","method": "eth_getBlockByNumber","params": ["latest", false],"id": 1}' --header 'Content-Type: application/json'
</strong></code></pre>

{% endhint %}

## Cosmos REST (1317)

[https://rpc.ansybl.io/canto/mainnet/api/](https://canto.ansybl.io/mainnet/api/)

#### Example: get latest block

{% code overflow="wrap" fullWidth="false" %}

```bash
curl 'https://rpc.ansybl.io/canto/mainnet/api/cosmos/base/tendermint/v1beta1/blocks/latest?X-API-KEY=<YOUR_API_KEY>' --header 'Content-Type: application/json'
```

{% endcode %}

View full endpoint docs <https://v1.cosmos.network/rpc/v0.45.1>

## Tendermint RPC (26657)

[https://rpc.ansybl.io/canto/mainnet/rpc/](https://canto.ansybl.io/mainnet/rpc/)

#### Example: get latest block

{% code overflow="wrap" fullWidth="false" %}

```bash
curl 'https://rpc.ansybl.io/canto/mainnet/rpc/block?X-API-KEY=<YOUR_API_KEY>' --header 'Content-Type: application/json'
```

{% endcode %}

View full endpoint docs <https://docs.tendermint.com/v0.34/rpc/>&#x20;


---

# 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.ansybl.io/canto/canto-api.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.
