Post Backtest Sweep
curl --request POST \
--url https://api.polyquantlab.com/v1/backtest/sweep \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"strategy": {},
"x_axis": {
"param": "<string>",
"start": 123,
"end": 123,
"steps": 5
},
"y_axis": {
"param": "<string>",
"start": 123,
"end": 123,
"steps": 5
},
"event_type": "<string>",
"ticker": "<string>",
"since": "2023-11-07T05:31:56Z",
"until": "2023-11-07T05:31:56Z",
"market_limit": 50
}
'import requests
url = "https://api.polyquantlab.com/v1/backtest/sweep"
payload = {
"strategy": {},
"x_axis": {
"param": "<string>",
"start": 123,
"end": 123,
"steps": 5
},
"y_axis": {
"param": "<string>",
"start": 123,
"end": 123,
"steps": 5
},
"event_type": "<string>",
"ticker": "<string>",
"since": "2023-11-07T05:31:56Z",
"until": "2023-11-07T05:31:56Z",
"market_limit": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
strategy: {},
x_axis: {param: '<string>', start: 123, end: 123, steps: 5},
y_axis: {param: '<string>', start: 123, end: 123, steps: 5},
event_type: '<string>',
ticker: '<string>',
since: '2023-11-07T05:31:56Z',
until: '2023-11-07T05:31:56Z',
market_limit: 50
})
};
fetch('https://api.polyquantlab.com/v1/backtest/sweep', 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.polyquantlab.com/v1/backtest/sweep",
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([
'strategy' => [
],
'x_axis' => [
'param' => '<string>',
'start' => 123,
'end' => 123,
'steps' => 5
],
'y_axis' => [
'param' => '<string>',
'start' => 123,
'end' => 123,
'steps' => 5
],
'event_type' => '<string>',
'ticker' => '<string>',
'since' => '2023-11-07T05:31:56Z',
'until' => '2023-11-07T05:31:56Z',
'market_limit' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.polyquantlab.com/v1/backtest/sweep"
payload := strings.NewReader("{\n \"strategy\": {},\n \"x_axis\": {\n \"param\": \"<string>\",\n \"start\": 123,\n \"end\": 123,\n \"steps\": 5\n },\n \"y_axis\": {\n \"param\": \"<string>\",\n \"start\": 123,\n \"end\": 123,\n \"steps\": 5\n },\n \"event_type\": \"<string>\",\n \"ticker\": \"<string>\",\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\",\n \"market_limit\": 50\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.polyquantlab.com/v1/backtest/sweep")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"strategy\": {},\n \"x_axis\": {\n \"param\": \"<string>\",\n \"start\": 123,\n \"end\": 123,\n \"steps\": 5\n },\n \"y_axis\": {\n \"param\": \"<string>\",\n \"start\": 123,\n \"end\": 123,\n \"steps\": 5\n },\n \"event_type\": \"<string>\",\n \"ticker\": \"<string>\",\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\",\n \"market_limit\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polyquantlab.com/v1/backtest/sweep")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"strategy\": {},\n \"x_axis\": {\n \"param\": \"<string>\",\n \"start\": 123,\n \"end\": 123,\n \"steps\": 5\n },\n \"y_axis\": {\n \"param\": \"<string>\",\n \"start\": 123,\n \"end\": 123,\n \"steps\": 5\n },\n \"event_type\": \"<string>\",\n \"ticker\": \"<string>\",\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\",\n \"market_limit\": 50\n}"
response = http.request(request)
puts response.read_body{
"job_id": "swp_a812c0f0",
"status": "queued",
"submitted_at": "2026-06-06T03:54:11+00:00",
"strategy_template": {
"type": "threshold_entry"
},
"sweep_params": {
"threshold": [
0.25,
0.27,
0.3,
0.33,
0.35
]
},
"universe": {
"ticker": "BTC",
"event_type": "5m"
},
"result": null,
"error": null
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Backtest
Post Backtest Sweep
Submit a parameter-sweep job. Same async pattern as /v1/backtest — returns 202 + job_id, client polls GET /v1/backtest/.
Tier gates checked:
market_limit≤ tier’s max_market_limit (same as single backtest)- Total grid cell count ≤ tier’s max_sweep_cells
- Per-key in-flight cap (sweeps count against the same concurrent_backtests budget as single backtests)
POST
/
v1
/
backtest
/
sweep
Post Backtest Sweep
curl --request POST \
--url https://api.polyquantlab.com/v1/backtest/sweep \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"strategy": {},
"x_axis": {
"param": "<string>",
"start": 123,
"end": 123,
"steps": 5
},
"y_axis": {
"param": "<string>",
"start": 123,
"end": 123,
"steps": 5
},
"event_type": "<string>",
"ticker": "<string>",
"since": "2023-11-07T05:31:56Z",
"until": "2023-11-07T05:31:56Z",
"market_limit": 50
}
'import requests
url = "https://api.polyquantlab.com/v1/backtest/sweep"
payload = {
"strategy": {},
"x_axis": {
"param": "<string>",
"start": 123,
"end": 123,
"steps": 5
},
"y_axis": {
"param": "<string>",
"start": 123,
"end": 123,
"steps": 5
},
"event_type": "<string>",
"ticker": "<string>",
"since": "2023-11-07T05:31:56Z",
"until": "2023-11-07T05:31:56Z",
"market_limit": 50
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
strategy: {},
x_axis: {param: '<string>', start: 123, end: 123, steps: 5},
y_axis: {param: '<string>', start: 123, end: 123, steps: 5},
event_type: '<string>',
ticker: '<string>',
since: '2023-11-07T05:31:56Z',
until: '2023-11-07T05:31:56Z',
market_limit: 50
})
};
fetch('https://api.polyquantlab.com/v1/backtest/sweep', 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.polyquantlab.com/v1/backtest/sweep",
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([
'strategy' => [
],
'x_axis' => [
'param' => '<string>',
'start' => 123,
'end' => 123,
'steps' => 5
],
'y_axis' => [
'param' => '<string>',
'start' => 123,
'end' => 123,
'steps' => 5
],
'event_type' => '<string>',
'ticker' => '<string>',
'since' => '2023-11-07T05:31:56Z',
'until' => '2023-11-07T05:31:56Z',
'market_limit' => 50
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://api.polyquantlab.com/v1/backtest/sweep"
payload := strings.NewReader("{\n \"strategy\": {},\n \"x_axis\": {\n \"param\": \"<string>\",\n \"start\": 123,\n \"end\": 123,\n \"steps\": 5\n },\n \"y_axis\": {\n \"param\": \"<string>\",\n \"start\": 123,\n \"end\": 123,\n \"steps\": 5\n },\n \"event_type\": \"<string>\",\n \"ticker\": \"<string>\",\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\",\n \"market_limit\": 50\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://api.polyquantlab.com/v1/backtest/sweep")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"strategy\": {},\n \"x_axis\": {\n \"param\": \"<string>\",\n \"start\": 123,\n \"end\": 123,\n \"steps\": 5\n },\n \"y_axis\": {\n \"param\": \"<string>\",\n \"start\": 123,\n \"end\": 123,\n \"steps\": 5\n },\n \"event_type\": \"<string>\",\n \"ticker\": \"<string>\",\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\",\n \"market_limit\": 50\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.polyquantlab.com/v1/backtest/sweep")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"strategy\": {},\n \"x_axis\": {\n \"param\": \"<string>\",\n \"start\": 123,\n \"end\": 123,\n \"steps\": 5\n },\n \"y_axis\": {\n \"param\": \"<string>\",\n \"start\": 123,\n \"end\": 123,\n \"steps\": 5\n },\n \"event_type\": \"<string>\",\n \"ticker\": \"<string>\",\n \"since\": \"2023-11-07T05:31:56Z\",\n \"until\": \"2023-11-07T05:31:56Z\",\n \"market_limit\": 50\n}"
response = http.request(request)
puts response.read_body{
"job_id": "swp_a812c0f0",
"status": "queued",
"submitted_at": "2026-06-06T03:54:11+00:00",
"strategy_template": {
"type": "threshold_entry"
},
"sweep_params": {
"threshold": [
0.25,
0.27,
0.3,
0.33,
0.35
]
},
"universe": {
"ticker": "BTC",
"event_type": "5m"
},
"result": null,
"error": null
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Base strategy spec (same shape as /v1/backtest). The x_axis (and y_axis if provided) override the named params; everything else stays fixed across every cell.
One axis of the parameter grid.
Show child attributes
Show child attributes
One axis of the parameter grid.
Show child attributes
Show child attributes
Required range:
x <= 500Response
Successful Response
Available options:
queued, running, complete, failed Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I