GoldRush SDK
import { GoldRushClient } from "@covalenthq/client-sdk";
const ApiServices = async () => {
const client = new GoldRushClient("<GOLDRUSH_API_KEY>");
const resp = await client.PricingService.getTokenPrices("eth-mainnet", "USD", "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984");
console.log(resp.data);
};
ApiServices();curl --request GET \
--url https://api.covalenthq.com/v1/pricing/historical_by_addresses_v2/{chainName}/{quoteCurrency}/{contractAddress}/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.covalenthq.com/v1/pricing/historical_by_addresses_v2/{chainName}/{quoteCurrency}/{contractAddress}/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.covalenthq.com/v1/pricing/historical_by_addresses_v2/{chainName}/{quoteCurrency}/{contractAddress}/', 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.covalenthq.com/v1/pricing/historical_by_addresses_v2/{chainName}/{quoteCurrency}/{contractAddress}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.covalenthq.com/v1/pricing/historical_by_addresses_v2/{chainName}/{quoteCurrency}/{contractAddress}/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.covalenthq.com/v1/pricing/historical_by_addresses_v2/{chainName}/{quoteCurrency}/{contractAddress}/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.covalenthq.com/v1/pricing/historical_by_addresses_v2/{chainName}/{quoteCurrency}/{contractAddress}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"contract_decimals": 123,
"contract_name": "<string>",
"contract_ticker_symbol": "<string>",
"contract_address": "<string>",
"supports_erc": [
"<string>"
],
"update_at": "2023-11-07T05:31:56Z",
"quote_currency": "<string>",
"logo_urls": {
"token_logo_url": "<string>",
"protocol_logo_url": "<string>",
"chain_logo_url": "<string>"
},
"items": [
{
"date": "2023-11-07T05:31:56Z",
"price": 123,
"pretty_price": "<string>"
}
]
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "Chain nosuchchain-mainnet not supported.",
"error_code": 501
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "Too many concurrent database requests",
"error_code": 556
}Prices
Historical Token Price API
Get the historical prices of one (or many) large cap ERC20 tokens between specified date ranges. Also supports native tokens.
GET
/
v1
/
pricing
/
historical_by_addresses_v2
/
{chainName}
/
{quoteCurrency}
/
{contractAddress}
/
GoldRush SDK
import { GoldRushClient } from "@covalenthq/client-sdk";
const ApiServices = async () => {
const client = new GoldRushClient("<GOLDRUSH_API_KEY>");
const resp = await client.PricingService.getTokenPrices("eth-mainnet", "USD", "0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984");
console.log(resp.data);
};
ApiServices();curl --request GET \
--url https://api.covalenthq.com/v1/pricing/historical_by_addresses_v2/{chainName}/{quoteCurrency}/{contractAddress}/ \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.covalenthq.com/v1/pricing/historical_by_addresses_v2/{chainName}/{quoteCurrency}/{contractAddress}/"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.covalenthq.com/v1/pricing/historical_by_addresses_v2/{chainName}/{quoteCurrency}/{contractAddress}/', 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.covalenthq.com/v1/pricing/historical_by_addresses_v2/{chainName}/{quoteCurrency}/{contractAddress}/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.covalenthq.com/v1/pricing/historical_by_addresses_v2/{chainName}/{quoteCurrency}/{contractAddress}/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.covalenthq.com/v1/pricing/historical_by_addresses_v2/{chainName}/{quoteCurrency}/{contractAddress}/")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.covalenthq.com/v1/pricing/historical_by_addresses_v2/{chainName}/{quoteCurrency}/{contractAddress}/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"contract_decimals": 123,
"contract_name": "<string>",
"contract_ticker_symbol": "<string>",
"contract_address": "<string>",
"supports_erc": [
"<string>"
],
"update_at": "2023-11-07T05:31:56Z",
"quote_currency": "<string>",
"logo_urls": {
"token_logo_url": "<string>",
"protocol_logo_url": "<string>",
"chain_logo_url": "<string>"
},
"items": [
{
"date": "2023-11-07T05:31:56Z",
"price": 123,
"pretty_price": "<string>"
}
]
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "Chain nosuchchain-mainnet not supported.",
"error_code": 501
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "<string>",
"error_code": 123
}{
"data": null,
"error": true,
"error_message": "Too many concurrent database requests",
"error_code": 556
}Credit Cost
1 per call
Processing
Batch
Estimate your monthly cost for this API using the Pricing Calculator.
Supports a comma separated list of token contract addresses.If no date range is provided, the spot price (with a 5 minute refresh) is provided.
Authorizations
Path Parameters
Query Parameters
Response
Successful response