Get closed positions
curl --request GET \
--url https://api.orbscan.com/v1/trader/{address}/positions/closed \
--header 'Authorization: <api-key>'import requests
url = "https://api.orbscan.com/v1/trader/{address}/positions/closed"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.orbscan.com/v1/trader/{address}/positions/closed', 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.orbscan.com/v1/trader/{address}/positions/closed",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <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.orbscan.com/v1/trader/{address}/positions/closed"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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.orbscan.com/v1/trader/{address}/positions/closed")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbscan.com/v1/trader/{address}/positions/closed")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "OK",
"status_code": "1",
"data": {
"items": [
{
"marketId": "3658111",
"marketSlug": "btc-updown-5m-1787036100",
"eventSlug": "btc-updown-5m-1787036100",
"conditionId": "0xb8dd5113e94626f2d31209d00fb46596ed7dc397b472ba995a32048b4863024f",
"marketTitle": "Bitcoin Up or Down - August 18, 2:55AM-3:00AM ET",
"logo": "https://polymarket-upload.s3.us-east-2.amazonaws.com/BTC+fullsize.png",
"closed": true,
"tokenId": "89557885051081542286903003624357156109233126349016624043674353363446112914315",
"positionSide": "Up",
"outcomeIndex": 0,
"balance": "0",
"avgPrice": "0.213749",
"currentPrice": "1",
"avgExit": "1",
"totalInvested": "8.54996",
"totalBought": "40",
"value": "0",
"unrealizedPnl": "0",
"realizedPnl": "31.45004",
"totalPnl": "31.45004",
"percentPnl": null,
"closedAt": 1787036472
}
],
"nextCursor": "3657217|1787033766|417536012314..."
}
}{
"message": "Missing or invalid API key",
"status_code": "0",
"data": null
}Endpoints
Get Closed Positions
Returns all closed positions for a wallet — outcome tokens held in markets that have since resolved, with final PnL and market metadata.
GET
/
v1
/
trader
/
{address}
/
positions
/
closed
Get closed positions
curl --request GET \
--url https://api.orbscan.com/v1/trader/{address}/positions/closed \
--header 'Authorization: <api-key>'import requests
url = "https://api.orbscan.com/v1/trader/{address}/positions/closed"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.orbscan.com/v1/trader/{address}/positions/closed', 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.orbscan.com/v1/trader/{address}/positions/closed",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <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.orbscan.com/v1/trader/{address}/positions/closed"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<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.orbscan.com/v1/trader/{address}/positions/closed")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.orbscan.com/v1/trader/{address}/positions/closed")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"message": "OK",
"status_code": "1",
"data": {
"items": [
{
"marketId": "3658111",
"marketSlug": "btc-updown-5m-1787036100",
"eventSlug": "btc-updown-5m-1787036100",
"conditionId": "0xb8dd5113e94626f2d31209d00fb46596ed7dc397b472ba995a32048b4863024f",
"marketTitle": "Bitcoin Up or Down - August 18, 2:55AM-3:00AM ET",
"logo": "https://polymarket-upload.s3.us-east-2.amazonaws.com/BTC+fullsize.png",
"closed": true,
"tokenId": "89557885051081542286903003624357156109233126349016624043674353363446112914315",
"positionSide": "Up",
"outcomeIndex": 0,
"balance": "0",
"avgPrice": "0.213749",
"currentPrice": "1",
"avgExit": "1",
"totalInvested": "8.54996",
"totalBought": "40",
"value": "0",
"unrealizedPnl": "0",
"realizedPnl": "31.45004",
"totalPnl": "31.45004",
"percentPnl": null,
"closedAt": 1787036472
}
],
"nextCursor": "3657217|1787033766|417536012314..."
}
}{
"message": "Missing or invalid API key",
"status_code": "0",
"data": null
}Authorizations
Pass your Orbscan API key as a Bearer token, formatted as Bearer <your_api_key>.
Path Parameters
Trader address, 0x + 40 hex chars.
Example:
"0x0484e64092ba4108c2786b61e6fc052d3bf41b1a"
Query Parameters
Page size. Defaults to 20, maximum 100.
Required range:
1 <= x <= 100Pagination cursor from the previous response's nextCursor. Omit for the first page.
Comma-separated market IDs to filter to (e.g. ?marketIds=1,2).
Example:
"3658111,3657996"
⌘I