Skip to Content
API ReferenceCategories

Categories

GET /api/v1/categories

Returns all categories in display order.

Auth: None
Rate limit: v1: 60 req / 60 s per IP

Response

{ "data": [ { "slug": "estonian_politics", "name": "Estonian Politics" }, { "slug": "estonian_sports", "name": "Estonian Sports" } ] }
FieldTypeDescription
slugstringURL-safe identifier used in subsequent endpoints
namestringDisplay label

Example

curl https://juhus.ee/api/v1/categories

GET /api/v1/categories/:slug/events

Returns paginated events belonging to a category.

Auth: None
Rate limit: v1: 60 req / 60 s per IP

Path parameters

ParamTypeDescription
slugstringCategory slug from /categories

Query parameters

ParamTypeDefaultDescription
pageinteger1Page number (≥ 1)
limitinteger20Results per page (1–50)

Response

{ "data": [ { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "title": "2026 Estonian Parliamentary Election", "description": "Markets for the 2026 Riigikogu election.", "category": "estonian_politics", "startsAt": "2026-03-01T00:00:00.000Z", "endsAt": "2026-03-15T23:59:59.000Z", "createdAt": "2025-11-10T12:00:00.000Z", "thumbnailId": "d4e5f6a7-b8c9-0123-def0-234567890123", "thumbnailUrl": "https://cdn.juhus.ee/thumbnails/election-2026.webp" } ], "meta": { "total": 42, "page": 1, "limit": 20, "hasMore": true } }
FieldTypeDescription
idUUID stringEvent identifier
titlestringEvent title
descriptionstring | nullOptional description
categorystringCategory slug
startsAtISO 8601 | nullWhen the event starts
endsAtISO 8601 | nullWhen the event ends
createdAtISO 8601Creation timestamp
thumbnailIdUUID string | nullThumbnail image id; null if none set
thumbnailUrlstring | nullThumbnail image URL; null if none set

Errors

StatusBodyWhen
404{ "error": "Category not found" }Unknown slug

GET /api/v1/categories/:slug/markets

Returns paginated markets belonging to a category.

Auth: None
Rate limit: v1: 60 req / 60 s per IP

Path parameters

ParamTypeDescription
slugstringCategory slug

Query parameters

ParamTypeDefaultDescription
status"open" | "closed""open""open" returns markets with status open; "closed" returns closed and resolved
pageinteger1Page number
limitinteger20Results per page (1–50)

Response

{ "data": [ { "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "title": "Will Reform Party win the most seats?", "description": "Resolves YES if Reform Party gets the most Riigikogu seats.", "category": "estonian_politics", "status": "open", "eventId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "lastTradePrice": 58, "yesVolume": 124500, "noVolume": 87300, "closeTime": "2026-03-01T20:00:00.000Z", "createdAt": "2025-11-15T09:00:00.000Z", "resolvedOutcome": null, "thumbnailId": "c3d4e5f6-a7b8-9012-cdef-123456789012", "thumbnailUrl": "https://cdn.juhus.ee/thumbnails/reform-2026.webp" } ], "meta": { "total": 17, "page": 1, "limit": 20, "hasMore": false } }
FieldTypeDescription
idUUID stringMarket identifier
titlestringMarket title
descriptionstringMarket description
categorystringCategory slug
statusstringopen | paused | closed | resolved
eventIdUUID string | nullParent event, or null for standalone markets
lastTradePriceinteger | nullMost recent trade price (1–99)
yesVolumeintegerTotal YES-side volume in EUR-cents
noVolumeintegerTotal NO-side volume in EUR-cents
closeTimeISO 8601 | nullScheduled trading close time
createdAtISO 8601Creation timestamp
resolvedOutcome"yes" | "no" | "custom" | nullResolution result; null while unresolved
thumbnailIdUUID string | nullThumbnail image id; null if none set
thumbnailUrlstring | nullThumbnail image URL; null if none set

Errors

StatusBodyWhen
404{ "error": "Category not found" }Unknown slug