Get Trades
curl --request GET \
--url https://api-v2.swaps.xyz/api/workflows/polymarket/getTrades \
--header 'x-api-key: <api-key>'import requests
url = "https://api-v2.swaps.xyz/api/workflows/polymarket/getTrades"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api-v2.swaps.xyz/api/workflows/polymarket/getTrades', 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-v2.swaps.xyz/api/workflows/polymarket/getTrades",
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-api-key: <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-v2.swaps.xyz/api/workflows/polymarket/getTrades"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<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-v2.swaps.xyz/api/workflows/polymarket/getTrades")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.swaps.xyz/api/workflows/polymarket/getTrades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"proxyWallet": "<string>",
"side": "BUY",
"asset": "<string>",
"conditionId": "<string>",
"size": 123,
"price": 123,
"timestamp": 123,
"title": "<string>",
"slug": "<string>",
"icon": "<string>",
"eventSlug": "<string>",
"outcome": "<string>",
"outcomeIndex": 123,
"name": "<string>",
"pseudonym": "<string>",
"bio": "<string>",
"profileImage": "<string>",
"profileImageOptimized": "<string>",
"transactionHash": "<string>"
}
]{
"error": "<string>",
"code": 123,
"details": {}
}{
"error": "<string>",
"code": 123,
"details": {}
}{
"error": "<string>",
"code": 123,
"details": {}
}User Positions & Activity
Get Trades
Retrieve trade history for a specific user.
GET
/
api
/
workflows
/
polymarket
/
getTrades
Get Trades
curl --request GET \
--url https://api-v2.swaps.xyz/api/workflows/polymarket/getTrades \
--header 'x-api-key: <api-key>'import requests
url = "https://api-v2.swaps.xyz/api/workflows/polymarket/getTrades"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api-v2.swaps.xyz/api/workflows/polymarket/getTrades', 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-v2.swaps.xyz/api/workflows/polymarket/getTrades",
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-api-key: <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-v2.swaps.xyz/api/workflows/polymarket/getTrades"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<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-v2.swaps.xyz/api/workflows/polymarket/getTrades")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-v2.swaps.xyz/api/workflows/polymarket/getTrades")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"proxyWallet": "<string>",
"side": "BUY",
"asset": "<string>",
"conditionId": "<string>",
"size": 123,
"price": 123,
"timestamp": 123,
"title": "<string>",
"slug": "<string>",
"icon": "<string>",
"eventSlug": "<string>",
"outcome": "<string>",
"outcomeIndex": 123,
"name": "<string>",
"pseudonym": "<string>",
"bio": "<string>",
"profileImage": "<string>",
"profileImageOptimized": "<string>",
"transactionHash": "<string>"
}
]{
"error": "<string>",
"code": 123,
"details": {}
}{
"error": "<string>",
"code": 123,
"details": {}
}{
"error": "<string>",
"code": 123,
"details": {}
}Authorizations
API key for authentication. Contact Swaps.xyz to obtain an API key.
Query Parameters
User EVM EOA address EVM address (0x prefix + 40 hex characters)
Pattern:
^0x[a-fA-F0-9]{40}$Example:
"0x1234567890123456789012345678901234567890"
Polymarket proxy wallet address EVM address (0x prefix + 40 hex characters)
Pattern:
^0x[a-fA-F0-9]{40}$Example:
"0x1234567890123456789012345678901234567890"
Response
Array of trades
User Profile Address (0x-prefixed, 40 hex chars)
Pattern:
^0x[a-fA-F0-9]{40}$Order side
Available options:
BUY, SELL Asset token ID
Condition ID (0x-prefixed 64-hex string)
Pattern:
^0x[a-fA-F0-9]{64}$Trade size
Trade price
Unix timestamp
Market title
Market slug
Market icon URL
Event slug
Outcome name
Outcome index
User name
User pseudonym
User bio
User profile image URL
Optimized profile image URL
Transaction hash