Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 50 additions & 8 deletions docs/router/search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,30 @@ Authorization: Bearer pmxt_live_...

## Events shape

```bash
curl "https://api.pmxt.dev/v0/events?query=election&limit=2" \
-H "Authorization: Bearer pmxt_live_..."
```
<Tabs>
<Tab title="Python">
```python
import pmxt

router = pmxt.Router(pmxt_api_key="pmxt_live_...")

# GET /v0/events?query=election&limit=2
# Also supported: offset, and status="closed" to include closed rows.
events = router.fetch_events(query="election", limit=2)
```
</Tab>
<Tab title="TypeScript">
```typescript
import pmxt from "pmxtjs";

const router = new pmxt.Router({ pmxtApiKey: "pmxt_live_..." });

// GET /v0/events?query=election&limit=2
// Also supported: offset, and status: "closed" to include closed rows.
const events = await router.fetchEvents({ query: "election", limit: 2 });
```
</Tab>
</Tabs>

```json
{
Expand Down Expand Up @@ -69,10 +89,32 @@ Exactly the same shape as [`UnifiedEvent`](/concepts/unified-schema#unifiedevent

## Markets shape

```bash
curl "https://api.pmxt.dev/v0/markets?query=election&limit=3" \
-H "Authorization: Bearer pmxt_live_..."
```
<Tabs>
<Tab title="Python">
```python
import pmxt

router = pmxt.Router(pmxt_api_key="pmxt_live_...")

# GET /v0/markets?query=election&limit=3
# Also supported: offset, category, exchange; use status="closed"
# to include closed rows.
markets = router.fetch_markets(query="election", limit=3)
```
</Tab>
<Tab title="TypeScript">
```typescript
import pmxt from "pmxtjs";

const router = new pmxt.Router({ pmxtApiKey: "pmxt_live_..." });

// GET /v0/markets?query=election&limit=3
// Also supported: offset, category, exchange; use status: "closed"
// to include closed rows.
const markets = await router.fetchMarkets({ query: "election", limit: 3 });
```
</Tab>
</Tabs>

```json
{
Expand Down