public/get_ticker
Returns the latest ticker snapshot for a single instrument named by instrument_name. The payload matches the data of a ticker_slim.{instrument}.{interval} subscription update (mark/index prices, best bid/ask, sizes, greeks, and related fields). Returns an error if no ticker is available. Public endpoint.
curl --request POST \
--url https://api.derive.xyz/v3/public/get_ticker \
--header 'Content-Type: application/json' \
--data '
{
"instrument_name": "<string>"
}
'import requests
url = "https://api.derive.xyz/v3/public/get_ticker"
payload = { "instrument_name": "<string>" }
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({instrument_name: '<string>'})
};
fetch('https://api.derive.xyz/v3/public/get_ticker', 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.derive.xyz/v3/public/get_ticker",
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([
'instrument_name' => '<string>'
]),
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://api.derive.xyz/v3/public/get_ticker"
payload := strings.NewReader("{\n \"instrument_name\": \"<string>\"\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://api.derive.xyz/v3/public/get_ticker")
.header("Content-Type", "application/json")
.body("{\n \"instrument_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/public/get_ticker")
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 \"instrument_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"A": "<string>",
"B": "<string>",
"I": "<string>",
"M": "<string>",
"a": "<string>",
"b": "<string>",
"maxp": "<string>",
"minp": "<string>",
"stats": {
"c": "<string>",
"h": "<string>",
"l": "<string>",
"n": 1,
"oi": "<string>",
"p": "<string>",
"pr": "<string>",
"v": "<string>"
},
"t": 123,
"f": "<string>",
"option_pricing": {
"ai": "<string>",
"bi": "<string>",
"d": "<string>",
"df": "<string>",
"f": "<string>",
"g": "<string>",
"i": "<string>",
"m": "<string>",
"r": "<string>",
"t": "<string>",
"v": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"data": "<string>"
}
}Response
Success
Maximum price at which an aggressive buyer can be matched. Any portion of a market order that would execute above this price is cancelled. A limit buy order with limit price above this value is treated as post only (i.e. it is rejected if it would cross any existing resting order).
Minimum price at which an aggressive seller can be matched. Any portion of a market order that would execute below this price is cancelled. A limit sell order with limit price below this value is treated as post only (i.e. it is rejected if it would cross any existing resting order).
curl --request POST \
--url https://api.derive.xyz/v3/public/get_ticker \
--header 'Content-Type: application/json' \
--data '
{
"instrument_name": "<string>"
}
'import requests
url = "https://api.derive.xyz/v3/public/get_ticker"
payload = { "instrument_name": "<string>" }
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({instrument_name: '<string>'})
};
fetch('https://api.derive.xyz/v3/public/get_ticker', 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.derive.xyz/v3/public/get_ticker",
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([
'instrument_name' => '<string>'
]),
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://api.derive.xyz/v3/public/get_ticker"
payload := strings.NewReader("{\n \"instrument_name\": \"<string>\"\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://api.derive.xyz/v3/public/get_ticker")
.header("Content-Type", "application/json")
.body("{\n \"instrument_name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.derive.xyz/v3/public/get_ticker")
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 \"instrument_name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"A": "<string>",
"B": "<string>",
"I": "<string>",
"M": "<string>",
"a": "<string>",
"b": "<string>",
"maxp": "<string>",
"minp": "<string>",
"stats": {
"c": "<string>",
"h": "<string>",
"l": "<string>",
"n": 1,
"oi": "<string>",
"p": "<string>",
"pr": "<string>",
"v": "<string>"
},
"t": 123,
"f": "<string>",
"option_pricing": {
"ai": "<string>",
"bi": "<string>",
"d": "<string>",
"df": "<string>",
"f": "<string>",
"g": "<string>",
"i": "<string>",
"m": "<string>",
"r": "<string>",
"t": "<string>",
"v": "<string>"
}
}{
"error": {
"code": 123,
"message": "<string>",
"data": "<string>"
}
}