# API

Venus Protocol API provides three groups of endpoints

**Market Data -** Endpoints relating to lending markets

**Activity -** Endpoints relating to user interactions with markets

**Governance -** Endpoints providing information about proposals and voter activity

## Base URL

The API is available without authentication for testnet and mainnet.

mainnet: [https://api.venus.io](https://api.venus.io/api/governance/venus)\
testnet: [https://testnetapi.venus.io](https://testnetapi.venus.io/api/transactions/)

## Versioning

Endpoints are versioned using the `accept-version` header. The values for this header can be `stable` or `next`. By default the `stable` version is returned. When a `next` version is available, a `Warning - 299` header will be added to the `stable` version with a message of breaking changes. To receive this new version the `accept-version` header can be set to `next`.

When the latest `next` version is made stable and the previous stable version is deprecated, both values for `accept-version` will return the latest version. Using the `next` header at this point will add a `Warning - 299` header alerting the client to remove `accept-version: next` to avoid receiving unexpected changes in the future.

#### Versioning Choreography

These steps describe the process of upgrading endpoints to new versions as they are released

1. A `next` version is made available, accessible with the `accept-version: next` header. A `Warning - 299` header is added to the stable version with details about breaking changes.
2. Clients will be given adequate time to upgrade to use the next version.
3. The previous stable version will be deprecated, the next version becomes stable and using the `accept-version: next` header will add a warning to remove the header or use the stable version.
4. Clients remove the `accept-version: next` header to avoid receiving unexpected changes.
5. The endpoint is now ready to release another version.

### Pool Endpoints

{% openapi src="/files/NeHm3NSWDcZ66uG7Ad3x" path="/pools" method="get" %}
[swagger.json](https://1811016925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSfxZmzf9N5T5Npv859XY%2Fuploads%2Fgit-blob-dbb2c7ace483764d85edc0ab191f48205eec2a8b%2Fswagger.json?alt=media)
{% endopenapi %}

### Market Endpoints

{% openapi src="/files/NeHm3NSWDcZ66uG7Ad3x" path="/markets" method="get" %}
[swagger.json](https://1811016925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSfxZmzf9N5T5Npv859XY%2Fuploads%2Fgit-blob-dbb2c7ace483764d85edc0ab191f48205eec2a8b%2Fswagger.json?alt=media)
{% endopenapi %}

{% openapi src="/files/NeHm3NSWDcZ66uG7Ad3x" path="/markets/history" method="get" %}
[swagger.json](https://1811016925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSfxZmzf9N5T5Npv859XY%2Fuploads%2Fgit-blob-dbb2c7ace483764d85edc0ab191f48205eec2a8b%2Fswagger.json?alt=media)
{% endopenapi %}

{% openapi src="/files/NeHm3NSWDcZ66uG7Ad3x" path="/markets/tvl" method="get" %}
[swagger.json](https://1811016925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSfxZmzf9N5T5Npv859XY%2Fuploads%2Fgit-blob-dbb2c7ace483764d85edc0ab191f48205eec2a8b%2Fswagger.json?alt=media)
{% endopenapi %}

### Governance Endpoints

{% openapi src="/files/NeHm3NSWDcZ66uG7Ad3x" path="/governance/proposals/{proposalId}/voteSummary" method="get" %}
[swagger.json](https://1811016925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSfxZmzf9N5T5Npv859XY%2Fuploads%2Fgit-blob-dbb2c7ace483764d85edc0ab191f48205eec2a8b%2Fswagger.json?alt=media)
{% endopenapi %}

{% openapi src="/files/NeHm3NSWDcZ66uG7Ad3x" path="/governance/voters/{address}/summary" method="get" %}
[swagger.json](https://1811016925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSfxZmzf9N5T5Npv859XY%2Fuploads%2Fgit-blob-dbb2c7ace483764d85edc0ab191f48205eec2a8b%2Fswagger.json?alt=media)
{% endopenapi %}

{% openapi src="/files/NeHm3NSWDcZ66uG7Ad3x" path="/governance/voters/{address}/history" method="get" %}
[swagger.json](https://1811016925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSfxZmzf9N5T5Npv859XY%2Fuploads%2Fgit-blob-dbb2c7ace483764d85edc0ab191f48205eec2a8b%2Fswagger.json?alt=media)
{% endopenapi %}

{% openapi src="/files/NeHm3NSWDcZ66uG7Ad3x" path="/governance/voters" method="get" %}
[swagger.json](https://1811016925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSfxZmzf9N5T5Npv859XY%2Fuploads%2Fgit-blob-dbb2c7ace483764d85edc0ab191f48205eec2a8b%2Fswagger.json?alt=media)
{% endopenapi %}

{% openapi src="/files/NeHm3NSWDcZ66uG7Ad3x" path="/governance/proposals" method="get" %}
[swagger.json](https://1811016925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSfxZmzf9N5T5Npv859XY%2Fuploads%2Fgit-blob-dbb2c7ace483764d85edc0ab191f48205eec2a8b%2Fswagger.json?alt=media)
{% endopenapi %}

{% openapi src="/files/NeHm3NSWDcZ66uG7Ad3x" path="/governance/proposals/votes" method="get" %}
[swagger.json](https://1811016925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSfxZmzf9N5T5Npv859XY%2Fuploads%2Fgit-blob-dbb2c7ace483764d85edc0ab191f48205eec2a8b%2Fswagger.json?alt=media)
{% endopenapi %}

{% openapi src="/files/NeHm3NSWDcZ66uG7Ad3x" path="/governance/proposals/{proposalId}" method="get" %}
[swagger.json](https://1811016925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FSfxZmzf9N5T5Npv859XY%2Fuploads%2Fgit-blob-dbb2c7ace483764d85edc0ab191f48205eec2a8b%2Fswagger.json?alt=media)
{% endopenapi %}


---

# 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-v4.venus.io/services/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.
