---
title: "Market trades"
method: GET
path: "/timeseries/market-trades"
tags: ["Timeseries"]
---

# Market trades

`GET /timeseries/market-trades`

## Request

- Base URL: `https://api.coinmetrics.io/v4`
- URL: `https://api.coinmetrics.io/v4/timeseries/market-trades`
- Auth: API key in query parameter `api_key`
- TypeScript: <https://skmtc.dev/coinmetrics/apis/coin-metrics-api-v4/docs/timeseries/market-trades/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns trades for specified markets.<br/> Results are ordered by tuple `(market, time, coin_metrics_id)`.<br/> To fetch the next page of results use `next_page_url` JSON response field.

## Query parameters

- `markets` string[], required
- `start_time` string
- `end_time` string
- `start_inclusive` boolean
- `end_inclusive` boolean
- `timezone` string
- `page_size` integer
- `paging_from` 'start' | 'end', PagingFrom
- `limit_per_market` integer
- `pretty` boolean
- `format` 'json' | 'json_stream' | 'csv'
- `next_page_token` string
- `min_confirmations` integer

## Response `200`

Time series of market trades.

- MarketTradesResponse
  - `data` MarketTrade[], required: Time series of market trades.
    - `market` string, required: Unique name of the market.
    - `time` string, required: The time in ISO 8601 date-time format. Always with nanoseconds precision.
    - `coin_metrics_id` string, required: ID of a trade (unique per exchange market). We are using exchange reported value if exchange reports a unique numeric trade id. If exchange reports trade id as a string we convert to numeric using Bijective mapping from exchange reported trade id's string. If exchange doesn't report unique ID we transform it using exchange reported data to form a unique value per market.
    - `amount` string, required: The amount of the base asset traded.
    - `price` string, required: The price of the base asset quoted in the quote asset that the trade was executed at.
    - `side` string: The market order side. "buy" means that an ask was removed from the book by an incoming buy order, "sell" means that a bid was removed from the book by an incoming sell order.
    - `block_hash` string: Swap block hash. Available for DeFi markets only.
    - `block_height` string: Swap block height. Available for DeFi markets only.
    - `txid` string: Swap transaction ID. Available for DeFi markets only.
    - `initiator` string: Swap transaction initiator. Available for DeFi markets only.
    - `sender` string: Swap caller. Available for DeFi markets only.
    - `beneficiary` string: Swap output receiver. Available for DeFi markets only.
    - `database_time` string, required: A time when we saved the data in the database. The time is in ISO 8601 date-time format. Always with nanoseconds precision.
    - `mark_price` string: The price representing the futures' or option's price calculated by the exchange for risk management purposes.
    - `index_price` string: The price index is an aggregate price derived from the major exchanges to be representative of the underlying asset's market consensus price.
    - `iv_trade` string: Implied volatility calculated from the trade price.
    - `liquidation` string: Indicates whether the maker side, taker side, or both sides of the trade is under liquidation.
  - `next_page_token` string: Token of the next page results for a given request.
  - `next_page_url` string: URL of the next page results for a given request.

## Other responses

- `400`: Market not found.
- `401`: Requested resource requires authorization.
- `403`: Requested resource is not available with supplied credentials.
- `414`: Provided URI is too long. It must not be greater than 10000 symbols.

---

[API](https://skmtc.dev/coinmetrics/apis/coin-metrics-api-v4.md) - [All operations](https://skmtc.dev/coinmetrics/apis/coin-metrics-api-v4/llms.txt) - [OpenAPI document](https://skmtc.dev/coinmetrics/apis/coin-metrics-api-v4/revisions/774268c0a4fe?raw)
