Get Market Sparklines
curl --request POST \
--url https://synthesis.trade/api/v1/markets/sparklines \
--header 'Content-Type: application/json' \
--data '
[
"12345",
"KXBTC-25-T100000:Yes"
]
'import requests
url = "https://synthesis.trade/api/v1/markets/sparklines"
payload = ["12345", "KXBTC-25-T100000:Yes"]
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(['12345', 'KXBTC-25-T100000:Yes'])
};
fetch('https://synthesis.trade/api/v1/markets/sparklines', 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://synthesis.trade/api/v1/markets/sparklines",
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([
'12345',
'KXBTC-25-T100000:Yes'
]),
CURLOPT_HTTPHEADER => [
"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://synthesis.trade/api/v1/markets/sparklines"
payload := strings.NewReader("[\n \"12345\",\n \"KXBTC-25-T100000:Yes\"\n]")
req, _ := http.NewRequest("POST", url, payload)
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://synthesis.trade/api/v1/markets/sparklines")
.header("Content-Type", "application/json")
.body("[\n \"12345\",\n \"KXBTC-25-T100000:Yes\"\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://synthesis.trade/api/v1/markets/sparklines")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "[\n \"12345\",\n \"KXBTC-25-T100000:Yes\"\n]"
response = http.request(request)
puts response.read_body{
"success": true,
"response": {
"12345": [
0.41,
0.44,
0.48
],
"KXBTC-25-T100000:Yes": [
0.52,
0.54,
0.58
]
}
}Markets
Get Market Sparklines
Fetch sparkline history for a batch of market identifiers. The request body is a JSON array of market identifiers.
Get Market Sparklines
curl --request POST \
--url https://synthesis.trade/api/v1/markets/sparklines \
--header 'Content-Type: application/json' \
--data '
[
"12345",
"KXBTC-25-T100000:Yes"
]
'import requests
url = "https://synthesis.trade/api/v1/markets/sparklines"
payload = ["12345", "KXBTC-25-T100000:Yes"]
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(['12345', 'KXBTC-25-T100000:Yes'])
};
fetch('https://synthesis.trade/api/v1/markets/sparklines', 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://synthesis.trade/api/v1/markets/sparklines",
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([
'12345',
'KXBTC-25-T100000:Yes'
]),
CURLOPT_HTTPHEADER => [
"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://synthesis.trade/api/v1/markets/sparklines"
payload := strings.NewReader("[\n \"12345\",\n \"KXBTC-25-T100000:Yes\"\n]")
req, _ := http.NewRequest("POST", url, payload)
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://synthesis.trade/api/v1/markets/sparklines")
.header("Content-Type", "application/json")
.body("[\n \"12345\",\n \"KXBTC-25-T100000:Yes\"\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://synthesis.trade/api/v1/markets/sparklines")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "[\n \"12345\",\n \"KXBTC-25-T100000:Yes\"\n]"
response = http.request(request)
puts response.read_body{
"success": true,
"response": {
"12345": [
0.41,
0.44,
0.48
],
"KXBTC-25-T100000:Yes": [
0.52,
0.54,
0.58
]
}
}Body
application/json
Example:
["12345", "KXBTC-25-T100000:Yes"]
Response
200 - application/json
Sparkline history by market identifier
⌘I