> For the complete documentation index, see [llms.txt](https://docs.outpoll.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.outpoll.com/api/prediction-api/rest-api/public-endpoints/public-api-overview.md).

# Public API Overview

Base URL, endpoint summary, pagination, and Python examples for public REST endpoints

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](https://docs.outpoll.com/api/prediction-api/rest-api/public-endpoints/get-available-coins.md) — supported assets and coin metadata
* [Search Events](https://docs.outpoll.com/api/prediction-api/rest-api/public-endpoints/search-events.md) — market discovery with filters and pagination
* [Get Categories](https://docs.outpoll.com/api/prediction-api/rest-api/public-endpoints/get-categories.md) — category tree for events
* [Get Popular Tags](https://docs.outpoll.com/api/prediction-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](https://docs.outpoll.com/api/prediction-api/rest-api/public-endpoints/get-available-coins.md)
* [Search Events](https://docs.outpoll.com/api/prediction-api/rest-api/public-endpoints/search-events.md)
* [Get Categories](https://docs.outpoll.com/api/prediction-api/rest-api/public-endpoints/get-categories.md)
* [Get Popular Tags](https://docs.outpoll.com/api/prediction-api/rest-api/public-endpoints/get-popular-tags.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.outpoll.com/api/prediction-api/rest-api/public-endpoints/public-api-overview.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
