curl --request GET \
--url https://external-api.kalshi.com/trade-api/v2/markets/tradesimport requests
url = "https://external-api.kalshi.com/trade-api/v2/markets/trades"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://external-api.kalshi.com/trade-api/v2/markets/trades', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://external-api.kalshi.com/trade-api/v2/markets/trades",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://external-api.kalshi.com/trade-api/v2/markets/trades"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://external-api.kalshi.com/trade-api/v2/markets/trades")
.asString();require 'uri'
require 'net/http'
url = URI("https://external-api.kalshi.com/trade-api/v2/markets/trades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"trades": [
{
"trade_id": "<string>",
"ticker": "<string>",
"count_fp": "10.00",
"yes_price_dollars": "0.5600",
"no_price_dollars": "0.5600",
"taker_outcome_side": "yes",
"taker_book_side": "bid",
"created_time": "2023-11-07T05:31:56Z",
"is_block_trade": true,
"taker_side": "yes"
}
],
"cursor": "<string>"
}Get Trades
Endpoint for getting all trades for all markets. A trade represents a completed transaction between two users on a specific market. Each trade includes the market ticker, price, quantity, and timestamp information. Block trades are included in the response by default and identified by the is_block_trade field; use the is_block_trade query parameter to filter by block / non-block. This endpoint returns a paginated response. Use the ‘limit’ parameter to control page size (1-1000, defaults to 100). The response includes a ‘cursor’ field - pass this value in the ‘cursor’ parameter of your next request to get the next page. An empty cursor indicates no more pages are available.
A ticker that does not match any market returns 200 with an empty trades list, not 404. A cursor that cannot be decoded is ignored and the first page is returned, so pass the cursor exactly as it was returned. min_ts and max_ts must be in seconds; millisecond values are rejected with 400 bad_request.
curl --request GET \
--url https://external-api.kalshi.com/trade-api/v2/markets/tradesimport requests
url = "https://external-api.kalshi.com/trade-api/v2/markets/trades"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://external-api.kalshi.com/trade-api/v2/markets/trades', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://external-api.kalshi.com/trade-api/v2/markets/trades",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://external-api.kalshi.com/trade-api/v2/markets/trades"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://external-api.kalshi.com/trade-api/v2/markets/trades")
.asString();require 'uri'
require 'net/http'
url = URI("https://external-api.kalshi.com/trade-api/v2/markets/trades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"trades": [
{
"trade_id": "<string>",
"ticker": "<string>",
"count_fp": "10.00",
"yes_price_dollars": "0.5600",
"no_price_dollars": "0.5600",
"taker_outcome_side": "yes",
"taker_book_side": "bid",
"created_time": "2023-11-07T05:31:56Z",
"is_block_trade": true,
"taker_side": "yes"
}
],
"cursor": "<string>"
}