GET
/
api
/
trade
/
price-history
curl --request GET \
  --url https://api.data.adj.news/api/trade/price-history \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "timestamp": 123,
      "datetime": "<string>",
      "price": 123,
      "volume": 123,
      "open": 123,
      "high": 123,
      "low": 123,
      "close": 123
    }
  ],
  "meta": {
    "market_id": "<string>",
    "interval": "<string>",
    "start_time": 123,
    "end_time": 123,
    "count": 123,
    "side": "buy",
    "platform": "<string>"
  }
}

Get Price History for a Market

This endpoint retrieves aggregated price history data for a specific market, with support for different time intervals, filtering, and OHLC (Open, High, Low, Close) data.

Query Parameters

  • market_id (required): Filter trades by market ID
  • interval (optional): Time interval for data aggregation (“1m”, “5m”, “15m”, “30m”, “1h”, “2h”, “4h”, “6h”, “12h”, “1d”, “3d”, “1w”, “1M”). Default: “1h”
  • start_time (optional): Include data after this timestamp (can be UNIX timestamp or ISO date string)
  • end_time (optional): Include data before this timestamp (can be UNIX timestamp or ISO date string)
  • side (optional): Filter by trade side (“buy”, “sell”, “yes”, “no”)
  • platform (optional): Filter by platform

Response Format

{
  "data": [
    {
      "timestamp": 1648166400,
      "datetime": "2022-03-25T00:00:00Z",
      "price": 0.65,
      "volume": 1250.75,
      "open": 0.63,
      "high": 0.68,
      "low": 0.62,
      "close": 0.65
    },
    // More price data points...
  ],
  "meta": {
    "market_id": "polymarket_will-trump-win-2024-election",
    "interval": "1h",
    "start_time": 1648080000,
    "end_time": 1648252800,
    "count": 24,
    "side": "yes",
    "platform": "polymarket"
  }
}

Use Cases

  1. Price Charts: Create candlestick or line charts showing price movements
  2. Technical Analysis: Perform technical analysis on the price data
  3. Volume Analysis: Track trading volume over time
  4. Market Trends: Identify trends in market prices
  5. Volatility Analysis: Calculate and visualize market volatility

Example Queries

# Get hourly price history for a specific market
curl "https://api.data.adj.news/api/trade/price-history?market_id=polymarket_will-trump-win-2024-election"

# Get 5-minute price data for the last week
curl "https://api.data.adj.news/api/trade/price-history?market_id=polymarket_will-trump-win-2024-election&interval=5m&start_time=2025-04-23"

# Get daily price data for a specific date range
curl "https://api.data.adj.news/api/trade/price-history?market_id=polymarket_will-trump-win-2024-election&interval=1d&start_time=2025-01-01&end_time=2025-03-31"

# Get price history for 'yes' trades only
curl "https://api.data.adj.news/api/trade/price-history?market_id=polymarket_will-trump-win-2024-election&side=yes"

Notes

  • The response includes OHLC (Open, High, Low, Close) data for technical analysis
  • Each data point includes aggregated volume for the time period
  • The timestamp field is a UNIX timestamp (seconds since epoch) for easy charting
  • The datetime field provides a human-readable ISO 8601 date string
  • Time intervals can range from 1 minute to 1 month
  • Missing intervals (periods with no trades) may be omitted from the results

Authorizations

Authorization
string
header
required

Enter your API key as the bearer token

Query Parameters

market_id
string
required

The unique identifier for the market

interval
enum<string>
default:1h

Time interval for data aggregation

Available options:
1m,
5m,
15m,
30m,
1h,
2h,
4h,
6h,
12h,
1d,
3d,
1w,
1M
start_time

Start timestamp (UNIX or ISO date string)

end_time

End timestamp (UNIX or ISO date string)

side
enum<string>

Filter by trade side

Available options:
buy,
sell,
yes,
no
platform
string

Filter by platform

Response

200
application/json
Price history data for the specified market

The response is of type object.