Get market rate
curl --request GET \
--url https://api.paycrest.io/v1/provider/rates/{token}/{fiat} \
--header 'API-Key: <api-key>'import requests
url = "https://api.paycrest.io/v1/provider/rates/{token}/{fiat}"
headers = {"API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'API-Key': '<api-key>'}};
fetch('https://api.paycrest.io/v1/provider/rates/{token}/{fiat}', 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.paycrest.io/v1/provider/rates/{token}/{fiat}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.paycrest.io/v1/provider/rates/{token}/{fiat}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.paycrest.io/v1/provider/rates/{token}/{fiat}")
.header("API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paycrest.io/v1/provider/rates/{token}/{fiat}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Operation successful",
"data": {
"buy": {
"marketRate": "<string>",
"minimumRate": "<string>",
"maximumRate": "<string>",
"position": {
"bestPublicRate": "<string>",
"yourEffectiveRate": "<string>",
"deltaVsBest": "<string>"
}
},
"sell": {
"marketRate": "<string>",
"minimumRate": "<string>",
"maximumRate": "<string>",
"position": {
"bestPublicRate": "<string>",
"yourEffectiveRate": "<string>",
"deltaVsBest": "<string>"
}
}
}
}{
"status": "error",
"message": "Error message",
"data": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"status": "error",
"message": "Error message",
"data": [
{
"field": "<string>",
"message": "<string>"
}
]
}Provider
Get Market Rate
GET
/
provider
/
rates
/
{token}
/
{fiat}
Get market rate
curl --request GET \
--url https://api.paycrest.io/v1/provider/rates/{token}/{fiat} \
--header 'API-Key: <api-key>'import requests
url = "https://api.paycrest.io/v1/provider/rates/{token}/{fiat}"
headers = {"API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'API-Key': '<api-key>'}};
fetch('https://api.paycrest.io/v1/provider/rates/{token}/{fiat}', 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.paycrest.io/v1/provider/rates/{token}/{fiat}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.paycrest.io/v1/provider/rates/{token}/{fiat}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("API-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.paycrest.io/v1/provider/rates/{token}/{fiat}")
.header("API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paycrest.io/v1/provider/rates/{token}/{fiat}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Operation successful",
"data": {
"buy": {
"marketRate": "<string>",
"minimumRate": "<string>",
"maximumRate": "<string>",
"position": {
"bestPublicRate": "<string>",
"yourEffectiveRate": "<string>",
"deltaVsBest": "<string>"
}
},
"sell": {
"marketRate": "<string>",
"minimumRate": "<string>",
"maximumRate": "<string>",
"position": {
"bestPublicRate": "<string>",
"yourEffectiveRate": "<string>",
"deltaVsBest": "<string>"
}
}
}
}{
"status": "error",
"message": "Error message",
"data": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"status": "error",
"message": "Error message",
"data": [
{
"field": "<string>",
"message": "<string>"
}
]
}Retrieve the market rate for a token and fiat pair (v1 path; same response shape as
GET /v2/provider/rates/{token}/{fiat}).
The data object contains buy and sell sides when applicable, each with marketRate, minimumRate, and maximumRate (strings). The older flat fields marketBuyRate / marketSellRate / minimumRate / maximumRate at the top level are no longer returned.
The optional position object (bestPublicRate, yourEffectiveRate, deltaVsBest) applies to this v1 path with the same semantics as the v2 route. See Get Market Rate (v2) for full position documentation.Authorizations
⌘I