# Public API Overview

Use public endpoints for read-only market data.

### Base URL

```http
https://api.outpoll.com
```

Use HTTPS for every request.

### Authentication

No authentication required.

### Common errors

| Code | Description                         |
| ---- | ----------------------------------- |
| 200  | OK — Request succeeded              |
| 400  | Bad Request — Invalid parameters    |
| 404  | Not Found — Resource does not exist |
| 500  | Internal Server Error               |

**Error response**

```json
{
  "status": 400,
  "error": "Bad Request",
  "message": "Invalid parameters"
}
```

### Available endpoints

* [Get Available Coins](/api/rest-api/public-endpoints/get-available-coins.md) — supported assets and coin metadata
* [Search Events](/api/rest-api/public-endpoints/search-events.md) — market discovery with filters and pagination
* [Get Categories](/api/rest-api/public-endpoints/get-categories.md) — category tree for events
* [Get Popular Tags](/api/rest-api/public-endpoints/get-popular-tags.md) — trending tags for discovery

### Python quickstart

Install the HTTP client first.

```bash
pip install requests
```

Use a shared session and always set a timeout.

{% code title="public\_api.py" %}

```python
import requests

BASE_URL = "https://api.outpoll.com"
TIMEOUT = 10

session = requests.Session()


def get_json(method: str, path: str, **kwargs):
    response = session.request(
        method=method,
        url=f"{BASE_URL}{path}",
        timeout=TIMEOUT,
        **kwargs,
    )
    response.raise_for_status()
    return response.json()
```

{% endcode %}

### Python examples

#### Get available coins

Use this endpoint to fetch supported assets.

`GET /api/coins`

{% code title="get\_coins.py" %}

```python
coins = get_json("GET", "/api/coins")

for coin in coins:
    print(f"{coin['sn']}: {coin['n']} | rate={coin['ur']}")
```

{% endcode %}

#### Search events

Use this endpoint to browse markets.

`POST /api/events/search`

{% code title="search\_events.py" %}

```python
payload = {
    "sb": "VOLUME_24H",
    "sd": "DESC",
    "l": "en",
    "ss": "bitcoin",
}

params = {
    "page": 0,
    "size": 20,
}

data = get_json(
    "POST",
    "/api/events/search",
    params=params,
    json=payload,
)

for event in data["content"]:
    print(f"{event['i']} | {event['ti']}")
```

{% endcode %}

#### Get categories

Use this endpoint to build filters or navigation.

`GET /api/categories`

{% code title="get\_categories.py" %}

```python
categories = get_json("GET", "/api/categories")

for category in categories:
    print(f"{category['n']} ({category['s']})")
```

{% endcode %}

#### Get popular tags

Use this endpoint to surface trending topics.

`GET /api/tags/popular`

{% code title="get\_popular\_tags.py" %}

```python
tags = get_json(
    "GET",
    "/api/tags/popular",
    params={"limit": 10},
)

for tag in tags:
    print(f"#{tag['r']} {tag['n']}")
```

{% endcode %}

### Pagination

Paginated endpoints accept these query parameters:

* `page` — zero-based page number
* `size` — number of items per page

Typical paginated responses include:

* `content` — current page items
* `totalElements` — total matching items
* `totalPages` — total page count

#### Python example: iterate through pages

{% code title="paginate\_events.py" %}

```python
page = 0

while True:
    data = get_json(
        "POST",
        "/api/events/search",
        params={"page": page, "size": 50},
        json={"sb": "NEWEST", "sd": "DESC", "l": "en"},
    )

    for event in data["content"]:
        print(event["ti"])

    page += 1
    if page >= data["totalPages"]:
        break
```

{% endcode %}

### Next pages

Use the detailed endpoint pages when you need full request and response schemas:

* [Get Available Coins](/api/rest-api/public-endpoints/get-available-coins.md)
* [Search Events](/api/rest-api/public-endpoints/search-events.md)
* [Get Categories](/api/rest-api/public-endpoints/get-categories.md)
* [Get Popular Tags](/api/rest-api/public-endpoints/get-popular-tags.md)


---

# 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.outpoll.com/api/rest-api/public-endpoints/public-api-overview.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.
