Overview
The VPX REST API allows you to programmatically interact with the Vancouver Prediction Exchange. You can retrieve market data, place and cancel orders, and view recent trades. New to the API? Start by building a trading bot.
Base URL
https://www.vancouverpx.ca/api/v1Authentication
All endpoints require an API key passed via the Authorization header using the Bearer scheme. You can generate an API key from your Developer Settings page.
Authorization: Bearer your_api_key_hereEndpoints
GET
/api/v1/marketsList all marketsGET/api/v1/marketGet market detailsGET/api/v1/market/order-bookGet the order book for a marketGET/api/v1/market/tradesGet recent trades for a marketPOST/api/v1/orderPlace a new limit orderGET/api/v1/positionsGet your current positionsPOST/api/v1/cancel-orderCancel a single orderPOST/api/v1/cancel-everythingCancel all open ordersUse with AI agents (MCP)
Every endpoint is also a tool on the VPX MCP server, so coding agents like Claude Code can read markets and trade with your API key:
claude mcp add --transport http vpx https://www.vancouverpx.ca/api/mcp --header "Authorization: Bearer YOUR_API_KEY"
Error Handling
All errors return a JSON object with an error field describing what went wrong. Validation errors also include a details field with specific field-level errors.
{
"error": "Insufficient funds"
}| Status | Meaning |
|---|---|
| 200 | Success |
| 201 | Created (order placed, market returned) |
| 400 | Bad request (validation error, insufficient funds, market not open) |
| 401 | Unauthorized (missing, invalid, or revoked API key) |
| 404 | Not found |
| 500 | Internal server error |