Get Trades
curl --request GET \
--url https://external-api.kalshi.com/trade-api/v2/margin/tradesimport requests
url = "https://external-api.kalshi.com/trade-api/v2/margin/trades"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://external-api.kalshi.com/trade-api/v2/margin/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/margin/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/margin/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/margin/trades")
.asString();require 'uri'
require 'net/http'
url = URI("https://external-api.kalshi.com/trade-api/v2/margin/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": "10.00",
"price": "<string>",
"created_time": "2023-11-07T05:31:56Z",
"taker_side": "bid"
}
],
"cursor": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>"
}market
Get Trades
Endpoint for retrieving public margin trades for a given market ticker. Returns a paginated response. Use the cursor value from the previous response to get the next page.
GET
/
margin
/
trades
Get Trades
curl --request GET \
--url https://external-api.kalshi.com/trade-api/v2/margin/tradesimport requests
url = "https://external-api.kalshi.com/trade-api/v2/margin/trades"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://external-api.kalshi.com/trade-api/v2/margin/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/margin/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/margin/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/margin/trades")
.asString();require 'uri'
require 'net/http'
url = URI("https://external-api.kalshi.com/trade-api/v2/margin/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": "10.00",
"price": "<string>",
"created_time": "2023-11-07T05:31:56Z",
"taker_side": "bid"
}
],
"cursor": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>"
}{
"code": "<string>",
"message": "<string>",
"details": "<string>"
}Query Parameters
Market ticker to retrieve trades for
Number of results per page
Required range:
1 <= x <= 1000Pagination cursor from a previous response
Filter trades after this Unix timestamp
Filter trades before this Unix timestamp