The easiest way to fetch cryptocurrency prices into Google Sheets and Excel.
Price2Sheet offers a free and simple API for fetching cryptocurrency prices. No authentication is required, and you can get data in raw text, JSON, or XML format.
https://api.price2sheet.com/raw/{crypto}/{fiat}
https://api.price2sheet.com/json/{crypto}/{fiat}
https://api.price2sheet.com/xml/{crypto}/{fiat}
Here are some examples of how to use the API in different languages:
curl -s https://api.price2sheet.com/json/btc/usd
$response = file_get_contents("https://api.price2sheet.com/json/eth/usd");
$data = json_decode($response, true);
echo $data['price'];
import requests
response = requests.get("https://api.price2sheet.com/json/sol/usd")
print(response.json()["price"])
const fetch = require('node-fetch');
fetch("https://api.price2sheet.com/json/doge/usd")
.then(response => response.json())
.then(data => console.log(data.price));
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
using HttpClient client = new HttpClient();
string response = await client.GetStringAsync("https://api.price2sheet.com/json/btc/usd");
Console.WriteLine(response);
}
}
import java.net.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws Exception {
URL url = new URL("https://api.price2sheet.com/json/eth/usd");
BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream()));
String json = reader.readLine();
System.out.println(json);
reader.close();
}
}
The API is free to use, but we have a rate limit to prevent abuse. If you exceed the limit, you will receive a 429 Too Many Requests
error.
If an invalid currency or request format is used, the API will return an appropriate error message:
{
"error": "Invalid currency. Supported: BTC, ETH, SOL, ...",
"code": 400
}