curl --request GET \
--url https://api.polymarket.us/v1/portfolio/activities \
--header 'X-PM-Access-Key: <api-key>' \
--header 'X-PM-Signature: <api-key>' \
--header 'X-PM-Timestamp: <api-key>'import requests
url = "https://api.polymarket.us/v1/portfolio/activities"
headers = {
"X-PM-Access-Key": "<api-key>",
"X-PM-Timestamp": "<api-key>",
"X-PM-Signature": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'X-PM-Access-Key': '<api-key>',
'X-PM-Timestamp': '<api-key>',
'X-PM-Signature': '<api-key>'
}
};
fetch('https://api.polymarket.us/v1/portfolio/activities', 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://api.polymarket.us/v1/portfolio/activities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-PM-Access-Key: <api-key>",
"X-PM-Signature: <api-key>",
"X-PM-Timestamp: <api-key>"
],
]);
$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://api.polymarket.us/v1/portfolio/activities"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-PM-Access-Key", "<api-key>")
req.Header.Add("X-PM-Timestamp", "<api-key>")
req.Header.Add("X-PM-Signature", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.polymarket.us/v1/portfolio/activities")
.header("X-PM-Access-Key", "<api-key>")
.header("X-PM-Timestamp", "<api-key>")
.header("X-PM-Signature", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polymarket.us/v1/portfolio/activities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-PM-Access-Key"] = '<api-key>'
request["X-PM-Timestamp"] = '<api-key>'
request["X-PM-Signature"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"activities": [
{
"trade": {
"id": "<string>",
"marketSlug": "<string>",
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z",
"price": {
"value": "123.45",
"currency": "<string>"
},
"qty": "<string>",
"isAggressor": true,
"costBasis": {
"value": "123.45",
"currency": "<string>"
},
"realizedPnl": {
"value": "123.45",
"currency": "<string>"
},
"qtyDecimal": "<string>"
},
"positionResolution": {
"marketSlug": "<string>",
"beforePosition": {
"netPosition": "<string>",
"qtyBought": "<string>",
"qtySold": "<string>",
"cost": {
"value": "123.45",
"currency": "<string>"
},
"realized": {
"value": "123.45",
"currency": "<string>"
},
"bodPosition": "<string>",
"expired": true,
"updateTime": "2023-11-07T05:31:56Z",
"marketMetadata": {
"slug": "<string>",
"icon": "<string>",
"title": "<string>",
"outcome": "<string>",
"eventSlug": "<string>"
},
"cashValue": {
"value": "123.45",
"currency": "<string>"
},
"qtyAvailable": "<string>",
"netPositionDecimal": "<string>",
"qtyBoughtDecimal": "<string>",
"qtySoldDecimal": "<string>",
"bodPositionDecimal": "<string>",
"qtyAvailableDecimal": "<string>"
},
"afterPosition": {
"netPosition": "<string>",
"qtyBought": "<string>",
"qtySold": "<string>",
"cost": {
"value": "123.45",
"currency": "<string>"
},
"realized": {
"value": "123.45",
"currency": "<string>"
},
"bodPosition": "<string>",
"expired": true,
"updateTime": "2023-11-07T05:31:56Z",
"marketMetadata": {
"slug": "<string>",
"icon": "<string>",
"title": "<string>",
"outcome": "<string>",
"eventSlug": "<string>"
},
"cashValue": {
"value": "123.45",
"currency": "<string>"
},
"qtyAvailable": "<string>",
"netPositionDecimal": "<string>",
"qtyBoughtDecimal": "<string>",
"qtySoldDecimal": "<string>",
"bodPositionDecimal": "<string>",
"qtyAvailableDecimal": "<string>"
},
"updateTime": "2023-11-07T05:31:56Z",
"tradeId": "<string>"
},
"accountBalanceChange": {
"transactionId": "<string>",
"amount": {
"value": "123.45",
"currency": "<string>"
},
"updateTime": "2023-11-07T05:31:56Z",
"createTime": "2023-11-07T05:31:56Z"
}
}
],
"nextCursor": "<string>",
"eof": true
}Get Activities
Get activities for a user including trades, position resolutions, and account balance changes
curl --request GET \
--url https://api.polymarket.us/v1/portfolio/activities \
--header 'X-PM-Access-Key: <api-key>' \
--header 'X-PM-Signature: <api-key>' \
--header 'X-PM-Timestamp: <api-key>'import requests
url = "https://api.polymarket.us/v1/portfolio/activities"
headers = {
"X-PM-Access-Key": "<api-key>",
"X-PM-Timestamp": "<api-key>",
"X-PM-Signature": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'X-PM-Access-Key': '<api-key>',
'X-PM-Timestamp': '<api-key>',
'X-PM-Signature': '<api-key>'
}
};
fetch('https://api.polymarket.us/v1/portfolio/activities', 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://api.polymarket.us/v1/portfolio/activities",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-PM-Access-Key: <api-key>",
"X-PM-Signature: <api-key>",
"X-PM-Timestamp: <api-key>"
],
]);
$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://api.polymarket.us/v1/portfolio/activities"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-PM-Access-Key", "<api-key>")
req.Header.Add("X-PM-Timestamp", "<api-key>")
req.Header.Add("X-PM-Signature", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.polymarket.us/v1/portfolio/activities")
.header("X-PM-Access-Key", "<api-key>")
.header("X-PM-Timestamp", "<api-key>")
.header("X-PM-Signature", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polymarket.us/v1/portfolio/activities")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-PM-Access-Key"] = '<api-key>'
request["X-PM-Timestamp"] = '<api-key>'
request["X-PM-Signature"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"activities": [
{
"trade": {
"id": "<string>",
"marketSlug": "<string>",
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z",
"price": {
"value": "123.45",
"currency": "<string>"
},
"qty": "<string>",
"isAggressor": true,
"costBasis": {
"value": "123.45",
"currency": "<string>"
},
"realizedPnl": {
"value": "123.45",
"currency": "<string>"
},
"qtyDecimal": "<string>"
},
"positionResolution": {
"marketSlug": "<string>",
"beforePosition": {
"netPosition": "<string>",
"qtyBought": "<string>",
"qtySold": "<string>",
"cost": {
"value": "123.45",
"currency": "<string>"
},
"realized": {
"value": "123.45",
"currency": "<string>"
},
"bodPosition": "<string>",
"expired": true,
"updateTime": "2023-11-07T05:31:56Z",
"marketMetadata": {
"slug": "<string>",
"icon": "<string>",
"title": "<string>",
"outcome": "<string>",
"eventSlug": "<string>"
},
"cashValue": {
"value": "123.45",
"currency": "<string>"
},
"qtyAvailable": "<string>",
"netPositionDecimal": "<string>",
"qtyBoughtDecimal": "<string>",
"qtySoldDecimal": "<string>",
"bodPositionDecimal": "<string>",
"qtyAvailableDecimal": "<string>"
},
"afterPosition": {
"netPosition": "<string>",
"qtyBought": "<string>",
"qtySold": "<string>",
"cost": {
"value": "123.45",
"currency": "<string>"
},
"realized": {
"value": "123.45",
"currency": "<string>"
},
"bodPosition": "<string>",
"expired": true,
"updateTime": "2023-11-07T05:31:56Z",
"marketMetadata": {
"slug": "<string>",
"icon": "<string>",
"title": "<string>",
"outcome": "<string>",
"eventSlug": "<string>"
},
"cashValue": {
"value": "123.45",
"currency": "<string>"
},
"qtyAvailable": "<string>",
"netPositionDecimal": "<string>",
"qtyBoughtDecimal": "<string>",
"qtySoldDecimal": "<string>",
"bodPositionDecimal": "<string>",
"qtyAvailableDecimal": "<string>"
},
"updateTime": "2023-11-07T05:31:56Z",
"tradeId": "<string>"
},
"accountBalanceChange": {
"transactionId": "<string>",
"amount": {
"value": "123.45",
"currency": "<string>"
},
"updateTime": "2023-11-07T05:31:56Z",
"createTime": "2023-11-07T05:31:56Z"
}
}
],
"nextCursor": "<string>",
"eof": true
}Authorizations
Your API key ID (UUID). Generate at polymarket.us/developer.
Unix timestamp in milliseconds. Must be within 30 seconds of server time.
Base64-encoded Ed25519 signature of timestamp + method + path. See Authentication for details.
Query Parameters
Maximum number of activities to return per page. Use with cursor for pagination. Default: 100. Example: 50
Pagination cursor from a previous response's nextCursor field. Use to fetch the next page of results. Omit for the first request
Filter activities by a specific market slug. Returns only activities (trades, resolutions) related to that market. Example: will-team-a-win
Filter by activity types. When specified, only returns activities of the selected types. TRADE (order executions), POSITION_RESOLUTION (market settlements), ACCOUNT_DEPOSIT/WITHDRAWAL (fund transfers)
ACTIVITY_TYPE_TRADE, ACTIVITY_TYPE_POSITION_RESOLUTION, ACTIVITY_TYPE_ACCOUNT_DEPOSIT, ACTIVITY_TYPE_ACCOUNT_ADVANCED_DEPOSIT, ACTIVITY_TYPE_ACCOUNT_WITHDRAWAL, ACTIVITY_TYPE_REFERRAL_BONUS, ACTIVITY_TYPE_TRANSFER, ACTIVITY_TYPE_TAKER_FEE_REBATE, ACTIVITY_TYPE_LIQUIDITY_PROGRAM Sort order for activities by timestamp. DESCENDING returns newest first (default), ASCENDING returns oldest first
SORT_ORDER_DESCENDING, SORT_ORDER_ASCENDING