# API Reference

{% hint style="info" %}
Once you have an API Key, you can try out various endpoints in the [interactive playground](https://totoml.app/playground).
{% endhint %}

##

## Base URL

Below is the base URL for requests

{% code title="Base URL" %}

```
https://toto.oz.xyz/api/
```

{% endcode %}

## Full Request URL

An example full request URL will look like this

{% code title="Full Request URL" %}

```
https://toto.oz.xyz/api/metadata/get_past_usernames
```

{% endcode %}

## Example Request

This is what an example request will look like. Note that all current endpoints are **POST** requests

{% tabs %}
{% tab title="Python" %}

```python
API_KEY = <API KEY>
base_url = 'https://toto.oz.xyz/api'
namespace = 'metadata'
endpoint = 'get_past_usernames'

username = 'oz_dao'

r = requests.post(
    url=f'{base_url}/{namespace}/{endpoint}',
    headers={
        'accept': 'application/json',
        'x-api-key': API_KEY,
        'Content-Type': 'application/json',
    },
    json={
        'user': username,
        'how': 'username',
        'page': 1,
    }
)

data = r.json()
```

{% endtab %}
{% endtabs %}
