Regarding the future of VPX — Read our announcement →
vancouverpx
← Back to Markets

API Documentation

REST API reference for the Vancouver Prediction Exchange

GET

Get Recent Trades

Retrieve the most recent trades for a market, ordered by execution time (newest first). Returns up to 50 trades.

Endpoint

GET /api/v1/market/trades?marketId={uuid}

Query Parameters

ParameterTypeRequiredDescription
marketIdUUIDYesThe ID of the market

Response

Returns an array of trade objects (status 200).

[
  {
    "id": "clxyz...",
    "marketId": "clxyz...",
    "buyOrderId": "clxyz...",
    "sellOrderId": "clxyz...",
    "quantity": 10,
    "price": 65,
    "executedAt": "2026-03-17T14:30:00.000Z"
  }
]

Example

import requests

API_KEY = "your_api_key"
BASE_URL = "https://www.vancouverpx.ca/api/v1"

def get_recent_trades(market_id: str) -> list:
    response = requests.get(
        f"{BASE_URL}/market/trades",
        params={"marketId": market_id},
        headers={"Authorization": f"Bearer {API_KEY}"},
    )
    response.raise_for_status()
    return response.json()

trades = get_recent_trades("your-market-uuid")
for trade in trades[:5]:
    print(f"Price: {trade['price']}¢, Qty: {trade['quantity']}")
Get Recent Trades | VPX API Docs