Cryptocurrency Prices
curl --request GET \
--url https://api.example.com/pricesimport requests
url = "https://api.example.com/prices"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/prices', 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.example.com/prices",
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.example.com/prices"
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.example.com/prices")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/prices")
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{
"success": true,
"data.BTC": {},
"data.ETH": {},
"data.LTC": {},
"data.SOL": {}
}Utilities
Cryptocurrency Prices
Get current cryptocurrency prices
GET
/
prices
Cryptocurrency Prices
curl --request GET \
--url https://api.example.com/pricesimport requests
url = "https://api.example.com/prices"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/prices', 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.example.com/prices",
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.example.com/prices"
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.example.com/prices")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/prices")
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{
"success": true,
"data.BTC": {},
"data.ETH": {},
"data.LTC": {},
"data.SOL": {}
}Get current cryptocurrency prices in various fiat currencies.
boolean
Indicates if the request was successful
object
Bitcoin prices in different currencies
object
Ethereum prices in different currencies
object
Litecoin prices in different currencies
object
Solana prices in different currencies
Example Request
curl -X GET https://api.transaction.gg/prices
Example Response
{
"success": true,
"data": {
"BTC": {
"USD": 45000.00,
"EUR": 40000.00
},
"ETH": {
"USD": 3000.00,
"EUR": 2700.00
},
"LTC": {
"USD": 100.00,
"EUR": 90.00
},
"SOL": {
"USD": 50.00,
"EUR": 45.00
}
}
}
Usage Example
// Get current Bitcoin price in USD
async function getBitcoinPrice() {
const response = await fetch('https://api.transaction.gg/prices');
const data = await response.json();
if (data.success) {
return data.data.BTC.USD;
}
throw new Error('Failed to fetch prices');
}
⌘I