Get token rate
curl --request GET \
--url https://api.paycrest.io/v1/rates/{token}/{amount}/{fiat}import requests
url = "https://api.paycrest.io/v1/rates/{token}/{amount}/{fiat}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.paycrest.io/v1/rates/{token}/{amount}/{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/rates/{token}/{amount}/{fiat}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/rates/{token}/{amount}/{fiat}"
req, _ := http.NewRequest("GET", url, nil)
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/rates/{token}/{amount}/{fiat}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paycrest.io/v1/rates/{token}/{amount}/{fiat}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Operation successful",
"data": 123
}{
"status": "error",
"message": "Error message",
"data": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"status": "error",
"message": "Error message",
"data": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"status": "error",
"message": "Error message",
"data": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"status": "error",
"message": "Error message",
"data": [
{
"field": "<string>",
"message": "<string>"
}
]
}General
Get Token Rate
GET
/
rates
/
{token}
/
{amount}
/
{fiat}
Get token rate
curl --request GET \
--url https://api.paycrest.io/v1/rates/{token}/{amount}/{fiat}import requests
url = "https://api.paycrest.io/v1/rates/{token}/{amount}/{fiat}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.paycrest.io/v1/rates/{token}/{amount}/{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/rates/{token}/{amount}/{fiat}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/rates/{token}/{amount}/{fiat}"
req, _ := http.NewRequest("GET", url, nil)
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/rates/{token}/{amount}/{fiat}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.paycrest.io/v1/rates/{token}/{amount}/{fiat}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"status": "success",
"message": "Operation successful",
"data": 123
}{
"status": "error",
"message": "Error message",
"data": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"status": "error",
"message": "Error message",
"data": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"status": "error",
"message": "Error message",
"data": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"status": "error",
"message": "Error message",
"data": [
{
"field": "<string>",
"message": "<string>"
}
]
}Retrieve an exchange rate for a token amount and fiat pair (legacy v1 API). Response
data is a single rate value (string/number).
For network in the path and buy/sell quotes, use Get Token Rate (v2) — GET /v2/rates/{network}/{from}/{amount}/{to}.Query Parameters
Network identifier for the blockchain (optional, filters tokens by network)
Available options:
ethereum, base, bnb-smart-chain, lisk, celo, arbitrum-one, polygon, starknet, tron Provider ID to get the rate for a specific provider. If not provided, returns rate from the public queue.