API reference
Specs & SDKs
OpenAPI 3.1 for the REST API and AsyncAPI 3.0 for the WebSocket: generate a typed client in your language.
Spec URLs
Both specs are free: no key, 0 tokens. They describe the live API, so generate from them whenever you want current types.
| Spec | Covers | URL |
|---|---|---|
| OpenAPI 3.1 | The REST endpoints | https://api.b337.ai/odds/v1/openapi.json |
| AsyncAPI 3.0 | The WebSocket and its frames | https://api.b337.ai/odds/v1/asyncapi.json |
Generate a REST client
Any OpenAPI generator works. Two one-liners:
npx @openapitools/openapi-generator-cli generate -i https://api.b337.ai/odds/v1/openapi.json -g typescript-fetch -o ./337oddsnpx @openapitools/openapi-generator-cli generate -i https://api.b337.ai/odds/v1/openapi.json -g python -o ./odds337Send your key as the X-API-Key header, as in Authentication.
WebSocket types
The AsyncAPI document declares every frame the server sends and every op it accepts. Feed it to @asyncapi/generator for typed models, or read it next to the WebSocket page.
npx @asyncapi/cli generate models typescript https://api.b337.ai/odds/v1/asyncapi.json -o ./337odds-ws