The easiest way to fetch cryptocurrency prices into Google Sheets and Excel.

price2sheet API Documentation

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.

API Endpoints

  • GET https://api.price2sheet.com/raw/{crypto}/{fiat}
  • GET https://api.price2sheet.com/json/{crypto}/{fiat}
  • GET https://api.price2sheet.com/xml/{crypto}/{fiat}

Example API Calls

Here are some examples of how to use the API in different languages:

cURL

curl -s https://api.price2sheet.com/json/btc/usd

PHP

$response = file_get_contents("https://api.price2sheet.com/json/eth/usd");
$data = json_decode($response, true);
echo $data['price'];

Python

import requests
response = requests.get("https://api.price2sheet.com/json/sol/usd")
print(response.json()["price"])

JavaScript (Node.js)

const fetch = require('node-fetch');
fetch("https://api.price2sheet.com/json/doge/usd")
    .then(response => response.json())
    .then(data => console.log(data.price));

C#

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);
    }
}

Java

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();
    }
}

Rate Limits

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.

Handling Errors

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
}