> 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/rest-api/public-endpoints/search-events.md).

# Search Events

`POST`

### Overview

Search and browse available prediction markets.

### Authentication

No authentication required.

### Request

* Method: `POST`
* Path: `/api/events/search`

#### Query Parameters

| Parameter | Type    | Required | Default | Description     |
| --------- | ------- | -------- | ------- | --------------- |
| page      | integer | No       | 0       | Zero-based page |
| size      | integer | No       | 20      | Items per page  |

#### Request body

| Field | Type      | Required | Description                                                                                      |
| ----- | --------- | -------- | ------------------------------------------------------------------------------------------------ |
| sb    | string    | No       | Sort by — `VOLUME_24H`, `TOTAL_VOLUME`, `LIQUIDITY`, `NEWEST`, `OLDEST`, `ENDING_SOON`, `CHANCE` |
| sd    | string    | No       | Sort direction — `ASC` or `DESC`                                                                 |
| l     | string    | No       | Language — `en`, `de`, `es`, `pt`, `zh`, `ja`, `ko`, `id`                                        |
| ss    | string    | No       | Search string                                                                                    |
| c     | string\[] | No       | Category slugs to filter                                                                         |
| t     | string\[] | No       | Tag names to filter                                                                              |
| ft    | boolean   | No       | Featured events only                                                                             |

#### Example request

```json
{
  "sb": "VOLUME_24H",
  "sd": "DESC",
  "l": "en",
  "ss": "bitcoin"
}
```

### Response `200 OK`

```json
{
  "content": [
    {
      "id": "54ccea1a-16fd-469c-8018-84b375243e8a",
      "title": "Will BTC reach $100k by end of 2026?",
      "outcomes": [
        {
          "marketId": "b21f6fd8-b9d1-4b9f-bb79-ef141e3dcb76",
          "yesId": "e7c4fed5-e7f4-4ec4-9b55-0bb41b83d813",
          "noId": "c7b372ab-de41-4cea-b51a-12807ac63029"
        }
      ]
    }
  ],
  "totalElements": 500,
  "totalPages": 25
}
```

| Field               | Type    | Description                  |
| ------------------- | ------- | ---------------------------- |
| content             | array   | Array of events              |
| content\[].id       | string  | Event ID                     |
| content\[].title    | string  | Event title                  |
| content\[].outcomes | array   | List of outcomes and markets |
| totalElements       | integer | Total number of events       |
| totalPages          | integer | Total number of pages        |

### Error variants

Common public endpoint errors:

| Code | Description                         |
| ---- | ----------------------------------- |
| 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"
}
```

### Python example

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

```python
import requests

response = requests.post(
    "https://event-service.outpoll.com/api/events/search",
    params={"page": 0, "size": 20},
    json={
        "sb": "VOLUME_24H",
        "sd": "DESC",
        "l": "en",
        "ss": "bitcoin",
    },
    timeout=10,
)
response.raise_for_status()

data = response.json()

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

{% endcode %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.outpoll.com/api/rest-api/public-endpoints/search-events.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
