curl --request POST \
--url https://refract.prismapi.io/v1/solana/dex/profiles/positions/search-profiles \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"filter": {
"metrics.7d.pnl": {
"$gt": 1000
}
},
"options": {
"include_metadata": true,
"include_labels": true,
"include_metrics": [
"7d"
]
},
"sort": {
"field": "metrics.7d.pnl",
"direction": "desc"
},
"dynamic_labels": {
"winner": {
"metrics.7d.roi": {
"$gt": 50
}
}
},
"limit": 10
}
'import requests
url = "https://refract.prismapi.io/v1/solana/dex/profiles/positions/search-profiles"
payload = {
"filter": { "metrics.7d.pnl": { "$gt": 1000 } },
"options": {
"include_metadata": True,
"include_labels": True,
"include_metrics": ["7d"]
},
"sort": {
"field": "metrics.7d.pnl",
"direction": "desc"
},
"dynamic_labels": { "winner": { "metrics.7d.roi": { "$gt": 50 } } },
"limit": 10
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filter: {'metrics.7d.pnl': {$gt: 1000}},
options: {include_metadata: true, include_labels: true, include_metrics: ['7d']},
sort: {field: 'metrics.7d.pnl', direction: 'desc'},
dynamic_labels: {winner: {'metrics.7d.roi': {$gt: 50}}},
limit: 10
})
};
fetch('https://refract.prismapi.io/v1/solana/dex/profiles/positions/search-profiles', 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://refract.prismapi.io/v1/solana/dex/profiles/positions/search-profiles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filter' => [
'metrics.7d.pnl' => [
'$gt' => 1000
]
],
'options' => [
'include_metadata' => true,
'include_labels' => true,
'include_metrics' => [
'7d'
]
],
'sort' => [
'field' => 'metrics.7d.pnl',
'direction' => 'desc'
],
'dynamic_labels' => [
'winner' => [
'metrics.7d.roi' => [
'$gt' => 50
]
]
],
'limit' => 10
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://refract.prismapi.io/v1/solana/dex/profiles/positions/search-profiles"
payload := strings.NewReader("{\n \"filter\": {\n \"metrics.7d.pnl\": {\n \"$gt\": 1000\n }\n },\n \"options\": {\n \"include_metadata\": true,\n \"include_labels\": true,\n \"include_metrics\": [\n \"7d\"\n ]\n },\n \"sort\": {\n \"field\": \"metrics.7d.pnl\",\n \"direction\": \"desc\"\n },\n \"dynamic_labels\": {\n \"winner\": {\n \"metrics.7d.roi\": {\n \"$gt\": 50\n }\n }\n },\n \"limit\": 10\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://refract.prismapi.io/v1/solana/dex/profiles/positions/search-profiles")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {\n \"metrics.7d.pnl\": {\n \"$gt\": 1000\n }\n },\n \"options\": {\n \"include_metadata\": true,\n \"include_labels\": true,\n \"include_metrics\": [\n \"7d\"\n ]\n },\n \"sort\": {\n \"field\": \"metrics.7d.pnl\",\n \"direction\": \"desc\"\n },\n \"dynamic_labels\": {\n \"winner\": {\n \"metrics.7d.roi\": {\n \"$gt\": 50\n }\n }\n },\n \"limit\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://refract.prismapi.io/v1/solana/dex/profiles/positions/search-profiles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": {\n \"metrics.7d.pnl\": {\n \"$gt\": 1000\n }\n },\n \"options\": {\n \"include_metadata\": true,\n \"include_labels\": true,\n \"include_metrics\": [\n \"7d\"\n ]\n },\n \"sort\": {\n \"field\": \"metrics.7d.pnl\",\n \"direction\": \"desc\"\n },\n \"dynamic_labels\": {\n \"winner\": {\n \"metrics.7d.roi\": {\n \"$gt\": 50\n }\n }\n },\n \"limit\": 10\n}"
response = http.request(request)
puts response.read_body{
"count": 123,
"cursor": "<string>",
"data": [
{
"updated_at": "2023-11-07T05:31:56Z",
"synced_at": "2023-11-07T05:31:56Z",
"position_address": "<string>",
"wallet_address": "<string>",
"token_address": "<string>",
"labels": [
"<string>"
],
"dynamic_labels": [
"<string>"
],
"metadata": {
"last_trade_at": "2023-11-07T05:31:56Z"
},
"metrics": {}
}
]
}{
"error": "Bad request: Invalid request parameters"
}{
"error": "Unauthorized: Invalid or missing API key"
}{
"error": "Forbidden: Access denied for the current API plan"
}{
"error": "Too many requests: Rate limit exceeded"
}{
"error": "Internal server error"
}Search Profiles
Filter, query, and sort position profiles based on specified metrics and conditions.
curl --request POST \
--url https://refract.prismapi.io/v1/solana/dex/profiles/positions/search-profiles \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"filter": {
"metrics.7d.pnl": {
"$gt": 1000
}
},
"options": {
"include_metadata": true,
"include_labels": true,
"include_metrics": [
"7d"
]
},
"sort": {
"field": "metrics.7d.pnl",
"direction": "desc"
},
"dynamic_labels": {
"winner": {
"metrics.7d.roi": {
"$gt": 50
}
}
},
"limit": 10
}
'import requests
url = "https://refract.prismapi.io/v1/solana/dex/profiles/positions/search-profiles"
payload = {
"filter": { "metrics.7d.pnl": { "$gt": 1000 } },
"options": {
"include_metadata": True,
"include_labels": True,
"include_metrics": ["7d"]
},
"sort": {
"field": "metrics.7d.pnl",
"direction": "desc"
},
"dynamic_labels": { "winner": { "metrics.7d.roi": { "$gt": 50 } } },
"limit": 10
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
filter: {'metrics.7d.pnl': {$gt: 1000}},
options: {include_metadata: true, include_labels: true, include_metrics: ['7d']},
sort: {field: 'metrics.7d.pnl', direction: 'desc'},
dynamic_labels: {winner: {'metrics.7d.roi': {$gt: 50}}},
limit: 10
})
};
fetch('https://refract.prismapi.io/v1/solana/dex/profiles/positions/search-profiles', 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://refract.prismapi.io/v1/solana/dex/profiles/positions/search-profiles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'filter' => [
'metrics.7d.pnl' => [
'$gt' => 1000
]
],
'options' => [
'include_metadata' => true,
'include_labels' => true,
'include_metrics' => [
'7d'
]
],
'sort' => [
'field' => 'metrics.7d.pnl',
'direction' => 'desc'
],
'dynamic_labels' => [
'winner' => [
'metrics.7d.roi' => [
'$gt' => 50
]
]
],
'limit' => 10
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://refract.prismapi.io/v1/solana/dex/profiles/positions/search-profiles"
payload := strings.NewReader("{\n \"filter\": {\n \"metrics.7d.pnl\": {\n \"$gt\": 1000\n }\n },\n \"options\": {\n \"include_metadata\": true,\n \"include_labels\": true,\n \"include_metrics\": [\n \"7d\"\n ]\n },\n \"sort\": {\n \"field\": \"metrics.7d.pnl\",\n \"direction\": \"desc\"\n },\n \"dynamic_labels\": {\n \"winner\": {\n \"metrics.7d.roi\": {\n \"$gt\": 50\n }\n }\n },\n \"limit\": 10\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://refract.prismapi.io/v1/solana/dex/profiles/positions/search-profiles")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"filter\": {\n \"metrics.7d.pnl\": {\n \"$gt\": 1000\n }\n },\n \"options\": {\n \"include_metadata\": true,\n \"include_labels\": true,\n \"include_metrics\": [\n \"7d\"\n ]\n },\n \"sort\": {\n \"field\": \"metrics.7d.pnl\",\n \"direction\": \"desc\"\n },\n \"dynamic_labels\": {\n \"winner\": {\n \"metrics.7d.roi\": {\n \"$gt\": 50\n }\n }\n },\n \"limit\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://refract.prismapi.io/v1/solana/dex/profiles/positions/search-profiles")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"filter\": {\n \"metrics.7d.pnl\": {\n \"$gt\": 1000\n }\n },\n \"options\": {\n \"include_metadata\": true,\n \"include_labels\": true,\n \"include_metrics\": [\n \"7d\"\n ]\n },\n \"sort\": {\n \"field\": \"metrics.7d.pnl\",\n \"direction\": \"desc\"\n },\n \"dynamic_labels\": {\n \"winner\": {\n \"metrics.7d.roi\": {\n \"$gt\": 50\n }\n }\n },\n \"limit\": 10\n}"
response = http.request(request)
puts response.read_body{
"count": 123,
"cursor": "<string>",
"data": [
{
"updated_at": "2023-11-07T05:31:56Z",
"synced_at": "2023-11-07T05:31:56Z",
"position_address": "<string>",
"wallet_address": "<string>",
"token_address": "<string>",
"labels": [
"<string>"
],
"dynamic_labels": [
"<string>"
],
"metadata": {
"last_trade_at": "2023-11-07T05:31:56Z"
},
"metrics": {}
}
]
}{
"error": "Bad request: Invalid request parameters"
}{
"error": "Unauthorized: Invalid or missing API key"
}{
"error": "Forbidden: Access denied for the current API plan"
}{
"error": "Too many requests: Rate limit exceeded"
}{
"error": "Internal server error"
}Authorizations
Your Prism API key. You can get one for free in the Prism Dashboard.
Body
Conditions that a profile must satisfy to be included in the results.
Each key is either a field path paired with comparison operators, or a logical operator ($and, $or) that combines nested filter objects.
Show child attributes
Show child attributes
{
"$or": [
{
"metrics.7d.cumulative_pnl": { "$gt": 65000, "$lt": 100000 }
},
{ "metrics.30d.max_drawdown": { "$lt": 20 } }
]
}
Rule that determines the order in which matching profiles are returned.
Show child attributes
Show child attributes
Map of custom label names to filter rules. Each returned profile is tagged with a label when its data satisfies the corresponding filter, allowing you to annotate results with ad-hoc categories defined at query time.
Show child attributes
Show child attributes
{
"smart": { "metrics.30d.winrate": { "$gt": 70 } }
}
Controls which optional sections are included in each returned position profile.
Show child attributes
Show child attributes
Maximum number of results to return in a single page.
1 <= x <= 100Opaque cursor returned by a previous response. Pass it to fetch the next page of results.
Was this page helpful?