Get user position series
curl --request GET \
--url https://perp-api.phoenix.trade/v1/users/{user_pubkey}/position-seriesimport requests
url = "https://perp-api.phoenix.trade/v1/users/{user_pubkey}/position-series"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://perp-api.phoenix.trade/v1/users/{user_pubkey}/position-series', 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://perp-api.phoenix.trade/v1/users/{user_pubkey}/position-series",
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://perp-api.phoenix.trade/v1/users/{user_pubkey}/position-series"
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://perp-api.phoenix.trade/v1/users/{user_pubkey}/position-series")
.asString();require 'uri'
require 'net/http'
url = URI("https://perp-api.phoenix.trade/v1/users/{user_pubkey}/position-series")
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{
"points": [
{
"avgEntryPrice": "<string>",
"size": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"liquidationPrice": "<string>",
"markPrice": "<string>",
"stopLossPrice": "<string>",
"takeProfitPrice": "<string>",
"unrealizedPnl": "<string>"
}
],
"positionId": "<string>",
"resolution": "1m"
}Trader
Get user position series
Handles GET /v1/users/{user_pubkey}/position-series via get.v1.users.by_user_pubkey.position_series.
GET
/
v1
/
users
/
{user_pubkey}
/
position-series
Get user position series
curl --request GET \
--url https://perp-api.phoenix.trade/v1/users/{user_pubkey}/position-seriesimport requests
url = "https://perp-api.phoenix.trade/v1/users/{user_pubkey}/position-series"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://perp-api.phoenix.trade/v1/users/{user_pubkey}/position-series', 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://perp-api.phoenix.trade/v1/users/{user_pubkey}/position-series",
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://perp-api.phoenix.trade/v1/users/{user_pubkey}/position-series"
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://perp-api.phoenix.trade/v1/users/{user_pubkey}/position-series")
.asString();require 'uri'
require 'net/http'
url = URI("https://perp-api.phoenix.trade/v1/users/{user_pubkey}/position-series")
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{
"points": [
{
"avgEntryPrice": "<string>",
"size": "<string>",
"timestamp": "2023-11-07T05:31:56Z",
"liquidationPrice": "<string>",
"markPrice": "<string>",
"stopLossPrice": "<string>",
"takeProfitPrice": "<string>",
"unrealizedPnl": "<string>"
}
],
"positionId": "<string>",
"resolution": "1m"
}Query Parameters
Response
200 - application/json
Successful response
A position sampled at its open, at every resolution boundary while it was held, and at its close (or now, while open).