Create or replace a script data value
curl --request PUT \
--url https://developers.myfundedperpetuals.com/v1/scripts/data/{key} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"value": "5800:-1.2,5850:0.4,5900:2.7"
}
'import requests
url = "https://developers.myfundedperpetuals.com/v1/scripts/data/{key}"
payload = { "value": "5800:-1.2,5850:0.4,5900:2.7" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: '5800:-1.2,5850:0.4,5900:2.7'})
};
fetch('https://developers.myfundedperpetuals.com/v1/scripts/data/{key}', 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://developers.myfundedperpetuals.com/v1/scripts/data/{key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'value' => '5800:-1.2,5850:0.4,5900:2.7'
]),
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://developers.myfundedperpetuals.com/v1/scripts/data/{key}"
payload := strings.NewReader("{\n \"value\": \"5800:-1.2,5850:0.4,5900:2.7\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://developers.myfundedperpetuals.com/v1/scripts/data/{key}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"value\": \"5800:-1.2,5850:0.4,5900:2.7\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developers.myfundedperpetuals.com/v1/scripts/data/{key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"value\": \"5800:-1.2,5850:0.4,5900:2.7\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"key": "spx-gex.0dte",
"chars": 123,
"created_at": 123,
"updated_at": 123
}
}{
"data": {
"key": "spx-gex.0dte",
"chars": 123,
"created_at": 123,
"updated_at": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}
}Script Data
Create or replace a script data value
Stores value under key, replacing any earlier value. Needs trade scope. Sending the value the key already holds changes nothing and doesn’t count toward the write limits. Open charts running a script that reads the key recalculate with the new value.
PUT
/
v1
/
scripts
/
data
/
{key}
Create or replace a script data value
curl --request PUT \
--url https://developers.myfundedperpetuals.com/v1/scripts/data/{key} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"value": "5800:-1.2,5850:0.4,5900:2.7"
}
'import requests
url = "https://developers.myfundedperpetuals.com/v1/scripts/data/{key}"
payload = { "value": "5800:-1.2,5850:0.4,5900:2.7" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({value: '5800:-1.2,5850:0.4,5900:2.7'})
};
fetch('https://developers.myfundedperpetuals.com/v1/scripts/data/{key}', 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://developers.myfundedperpetuals.com/v1/scripts/data/{key}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'value' => '5800:-1.2,5850:0.4,5900:2.7'
]),
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://developers.myfundedperpetuals.com/v1/scripts/data/{key}"
payload := strings.NewReader("{\n \"value\": \"5800:-1.2,5850:0.4,5900:2.7\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://developers.myfundedperpetuals.com/v1/scripts/data/{key}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"value\": \"5800:-1.2,5850:0.4,5900:2.7\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://developers.myfundedperpetuals.com/v1/scripts/data/{key}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"value\": \"5800:-1.2,5850:0.4,5900:2.7\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"key": "spx-gex.0dte",
"chars": 123,
"created_at": 123,
"updated_at": 123
}
}{
"data": {
"key": "spx-gex.0dte",
"chars": 123,
"created_at": 123,
"updated_at": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"details": [
{
"field": "<string>",
"issue": "<string>"
}
]
}
}Authorizations
bearerAuthbearerAuth & partnerKey
API key beginning with fp_live_ (live keys, served at developers.myfundedperpetuals.com) or fp_test_ (test keys, served at sandbox.myfundedperpetuals.com). A key presented on the other host is rejected with 401 and a message naming the correct host. Affiliate API keys are fp_live_ keys created on the Affiliates page: they read only the /v1/affiliate endpoints and get 403 with code insufficient_scope on every other authenticated endpoint. Every other key gets the same 403 on /v1/affiliate.
Path Parameters
Body
application/json