Production-ready client libraries for the 5 most popular languages.
Zero config. Full coverage of all 19 endpoints. Type-safe where possible.
Each library covers all 19 API endpoints with idiomatic patterns for your stack.
Download the library file, drop it into your project, and start fetching crypto data in under a minute.
Only requests as dependency
Full type hints for IDE support
Uses native fetch API
Full .d.ts definitions included
Drop into any PHP project
Built-in PHP extension, no extras
Built-in HttpClient
Java-style method overloading
Full async/await pattern
Proper resource cleanup
Complete reference for every method, error handling, and configuration.
All requests require a valid API key passed as a Bearer token. Get your free API key at freecryptoapi.com.
from freecryptoapi import FreeCryptoAPI
api = FreeCryptoAPI("your_api_key")
from freecryptoapi import FreeCryptoAPI
api = FreeCryptoAPI("your_api_key")
# List all supported cryptocurrencies
crypto_list = api.get_crypto_list()
# Get data for one or multiple symbols
btc = api.get_data("BTC")
multi = api.get_data("BTC+ETH+SOL")
# Get data from a specific exchange
btc_binance = api.get_data("BTC@binance")
# Get top cryptocurrencies by market cap
top20 = api.get_top(20)
# Get data in a local currency
btc_eur = api.get_data_currency("BTC", "EUR")
# Performance metrics
perf = api.get_performance("BTC")
# Volatility data
vol = api.get_volatility(symbol="BTC")
# All-time high / all-time low
ath_atl = api.get_ath_atl(symbol="ETH")
# Fear & Greed Index
fg = api.get_fear_greed()
# Technical analysis summary
ta = api.get_technical_analysis("BTC")
# Breakout signals
breakouts = api.get_breakouts()
# Correlation between symbols
corr = api.get_correlation("BTC+ETH", days=30)
# Support and resistance levels
sr = api.get_support_resistance("BTC")
# Moving average ribbon
ribbon = api.get_ma_ribbon("BTC", days=60)
# Bollinger Bands
bb = api.get_bollinger("BTC", days=30, period=20, std_dev=2.0)
# Exchange data
exchange = api.get_exchange("binance")
# Currency conversion
result = api.get_conversion("BTC", "USD", 1.5)
# Last 30 days of price history
history = api.get_history("BTC", 30)
# Specific date range
timeframe = api.get_timeframe("BTC", "2024-01-01", "2024-06-30")
# OHLC candlestick data
ohlc = api.get_ohlc("BTC", days=7)
ohlc_range = api.get_ohlc("BTC", start_date="2024-01-01", end_date="2024-01-31")
The client raises FreeCryptoAPIError on HTTP errors. The exception includes the HTTP status code and message returned by the API.
from freecryptoapi import FreeCryptoAPI, FreeCryptoAPIError
api = FreeCryptoAPI("your_api_key")
try:
data = api.get_data("INVALID")
except FreeCryptoAPIError as e:
print(f"Status: {e.status_code}")
print(f"Message: {e}")
api = FreeCryptoAPI(
api_key="your_api_key",
base_url="https://api.freecryptoapi.com/v1", # default
timeout=30 # seconds, default
)
| Method | Endpoint | Description |
|---|---|---|
get_crypto_list() | /getCryptoList | List all supported cryptocurrencies |
get_data(symbol) | /getData | Current market data for symbol(s) |
get_top(top) | /getTop | Top cryptocurrencies by market cap |
get_data_currency(symbol, local) | /getDataCurrency | Market data in local currency |
get_performance(symbol) | /getPerformance | Performance metrics |
get_volatility(symbol, top) | /getVolatility | Volatility data |
get_ath_atl(symbol, months) | /getATHATL | All-time high / all-time low |
get_fear_greed() | /getFearGreed | Fear & Greed Index |
get_technical_analysis(symbol) | /getTechnicalAnalysis | Technical analysis summary |
get_breakouts(symbol) | /getBreakouts | Breakout signals |
get_correlation(symbols, days) | /getCorrelation | Symbol correlation |
get_support_resistance(symbol, period) | /getSupportResistance | Support & resistance levels |
get_ma_ribbon(symbol, days) | /getMARibbon | Moving average ribbon |
get_bollinger(symbol, days, period, std_dev) | /getBollinger | Bollinger Bands |
get_exchange(exchange) | /getExchange | Exchange data |
get_conversion(from_symbol, to_symbol, amount) | /getConversion | Currency conversion |
get_history(symbol, days) | /getHistory | Historical price data |
get_timeframe(symbol, start, end) | /getTimeframe | Price data for date range |
get_ohlc(symbol, days, start_date, end_date) | /getOHLC | OHLC candlestick data |
Supports both ES Modules and CommonJS. Uses the native fetch API — no dependencies required.
// ES Module
import { FreeCryptoAPI } from './freecryptoapi.js';
// CommonJS
const { FreeCryptoAPI } = require('./freecryptoapi.js');
const api = new FreeCryptoAPI('YOUR_API_KEY');
// Get Bitcoin market data
const btc = await api.getData('BTC');
console.log(btc);
// List all available cryptocurrencies
const list = await api.getCryptoList();
// Get data for one or multiple symbols
const btc = await api.getData('BTC');
const multi = await api.getData('BTC+ETH+SOL');
// Get top 20 by market cap
const top20 = await api.getTop(20);
// Market data in a local currency
const btcEur = await api.getDataCurrency('BTC', 'EUR');
// Performance metrics
const perf = await api.getPerformance('BTC');
// Volatility data
const vol = await api.getVolatility({ symbol: 'BTC' });
// All-time high / all-time low
const athAtl = await api.getATHATL({ symbol: 'ETH' });
// Fear & Greed Index
const fg = await api.getFearGreed();
// Technical analysis summary
const ta = await api.getTechnicalAnalysis('BTC');
// Breakout signals
const breakouts = await api.getBreakouts();
// Correlation between symbols
const corr = await api.getCorrelation('BTC+ETH', { days: 30 });
// Support and resistance levels
const sr = await api.getSupportResistance('BTC');
// Moving average ribbon
const ribbon = await api.getMARibbon('BTC', { days: 60 });
// Bollinger Bands
const bb = await api.getBollinger('BTC', { days: 30, period: 20, stdDev: 2.0 });
// Exchange data
const exchange = await api.getExchange('binance');
// Currency conversion
const result = await api.getConversion('BTC', 'USD', 1.5);
// Last 30 days of price history
const history = await api.getHistory('BTC', 30);
// Specific date range
const timeframe = await api.getTimeframe('BTC', '2024-01-01', '2024-06-30');
// OHLC candlestick data
const ohlc = await api.getOHLC('BTC', { days: 7 });
const ohlcRange = await api.getOHLC('BTC', { startDate: '2024-01-01', endDate: '2024-01-31' });
The client throws FreeCryptoAPIError on HTTP errors. The exception includes the HTTP status code and message.
import { FreeCryptoAPI, FreeCryptoAPIError } from './freecryptoapi.js';
const api = new FreeCryptoAPI('YOUR_API_KEY');
try {
const data = await api.getData('INVALID');
} catch (e) {
if (e instanceof FreeCryptoAPIError) {
console.error(`Status: ${e.statusCode}`);
console.error(`Message: ${e.message}`);
}
}
Download freecryptoapi.d.ts alongside the JS file. TypeScript will automatically pick up the type definitions — no extra configuration needed.
import { FreeCryptoAPI, FreeCryptoAPIError } from './freecryptoapi';
const api: FreeCryptoAPI = new FreeCryptoAPI('YOUR_API_KEY');
const btc: string = await api.getData('BTC');
const parsed = JSON.parse(btc);
| Method | Endpoint | Description |
|---|---|---|
getCryptoList() | /getCryptoList | List all supported cryptocurrencies |
getData(symbol) | /getData | Current market data for symbol(s) |
getTop(top) | /getTop | Top cryptocurrencies by market cap |
getDataCurrency(symbol, local) | /getDataCurrency | Market data in local currency |
getPerformance(symbol) | /getPerformance | Performance metrics |
getVolatility(opts?) | /getVolatility | Volatility data |
getATHATL(opts?) | /getATHATL | All-time high / all-time low |
getFearGreed() | /getFearGreed | Fear & Greed Index |
getTechnicalAnalysis(symbol) | /getTechnicalAnalysis | Technical analysis summary |
getBreakouts(symbol?) | /getBreakouts | Breakout signals |
getCorrelation(symbols, opts?) | /getCorrelation | Symbol correlation |
getSupportResistance(symbol, opts?) | /getSupportResistance | Support & resistance |
getMARibbon(symbol, opts?) | /getMARibbon | Moving average ribbon |
getBollinger(symbol, opts?) | /getBollinger | Bollinger Bands |
getExchange(exchange) | /getExchange | Exchange data |
getConversion(from, to, amount) | /getConversion | Currency conversion |
getHistory(symbol, days) | /getHistory | Historical price data |
getTimeframe(symbol, start, end) | /getTimeframe | Price data for date range |
getOHLC(symbol, opts?) | /getOHLC | OHLC candlestick data |
Download FreeCryptoAPI.php and FreeCryptoAPIException.php, drop them into your project, and require them.
<?php
require_once 'FreeCryptoAPIException.php';
require_once 'FreeCryptoAPI.php';
$api = new FreeCryptoAPI('your-api-key');
// Get Bitcoin market data
$btc = $api->getData('BTC');
echo $btc;
// List all available cryptocurrencies
$list = $api->getCryptoList();
// Get market data for symbol(s)
$btc = $api->getData('BTC');
$multi = $api->getData('BTC+ETH+SOL');
// Top cryptocurrencies by market cap
$top20 = $api->getTop(20);
// Market data in a local currency
$btcEur = $api->getDataCurrency('BTC', 'EUR');
// Performance metrics
$perf = $api->getPerformance('BTC');
// Volatility data
$vol = $api->getVolatility('BTC');
// All-time high / all-time low
$athAtl = $api->getATHATL('ETH');
// Fear & Greed Index
$fg = $api->getFearGreed();
// Technical analysis summary
$ta = $api->getTechnicalAnalysis('BTC');
// Breakout signals
$breakouts = $api->getBreakouts();
// Correlation between symbols
$corr = $api->getCorrelation('BTC,ETH,SOL', 30);
// Support and resistance levels
$sr = $api->getSupportResistance('BTC');
// Moving average ribbon
$ribbon = $api->getMARibbon('BTC', 60);
// Bollinger Bands
$bb = $api->getBollinger('BTC', 30, 20, 2.0);
// Exchange data
$exchange = $api->getExchange('binance');
// Currency conversion
$result = $api->getConversion('BTC', 'USD', 1.5);
// Last 30 days of price history
$history = $api->getHistory('BTC', 30);
// Specific date range
$timeframe = $api->getTimeframe('BTC', '2024-01-01', '2024-06-30');
// OHLC candlestick data
$ohlc = $api->getOHLC('BTC', 7);
$ohlcRange = $api->getOHLC('BTC', null, '2024-01-01', '2024-01-31');
The client throws FreeCryptoAPIException on HTTP errors. The exception includes the HTTP status code.
try {
$data = $api->getData('INVALID');
} catch (FreeCryptoAPIException $e) {
echo "Status: " . $e->getStatusCode() . "\n";
echo "Message: " . $e->getMessage() . "\n";
}
| Method | Endpoint | Description |
|---|---|---|
getCryptoList() | /getCryptoList | List all supported cryptocurrencies |
getData($symbol) | /getData | Current market data for symbol(s) |
getTop($top) | /getTop | Top cryptocurrencies by market cap |
getDataCurrency($symbol, $local) | /getDataCurrency | Market data in local currency |
getPerformance($symbol) | /getPerformance | Performance metrics |
getVolatility($symbol, $top) | /getVolatility | Volatility data |
getATHATL($symbol, $months) | /getATHATL | All-time high / all-time low |
getFearGreed() | /getFearGreed | Fear & Greed Index |
getTechnicalAnalysis($symbol) | /getTechnicalAnalysis | Technical analysis summary |
getBreakouts($symbol) | /getBreakouts | Breakout signals |
getCorrelation($symbols, $days) | /getCorrelation | Symbol correlation |
getSupportResistance($symbol, $period) | /getSupportResistance | Support & resistance |
getMARibbon($symbol, $days) | /getMARibbon | Moving average ribbon |
getBollinger($symbol, $days, $period, $stdDev) | /getBollinger | Bollinger Bands |
getExchange($exchange) | /getExchange | Exchange data |
getConversion($from, $to, $amount) | /getConversion | Currency conversion |
getHistory($symbol, $days) | /getHistory | Historical price data |
getTimeframe($symbol, $start, $end) | /getTimeframe | Price data for date range |
getOHLC($symbol, $days, $startDate, $endDate) | /getOHLC | OHLC candlestick data |
Download both FreeCryptoAPI.java and FreeCryptoAPIException.java into your com.freecryptoapi package directory. Java 11+ required — no external dependencies.
import com.freecryptoapi.FreeCryptoAPI;
import com.freecryptoapi.FreeCryptoAPIException;
public class Main {
public static void main(String[] args) {
FreeCryptoAPI api = new FreeCryptoAPI("your-api-key");
// Get Bitcoin market data
String btcData = api.getData("BTC");
System.out.println(btcData);
// Get top 10 cryptocurrencies
String top10 = api.getTop(10);
System.out.println(top10);
}
}
// List all available cryptocurrencies
String list = api.getCryptoList();
// Get market data for a specific cryptocurrency
String data = api.getData("BTC");
// Get top N cryptocurrencies
String top10 = api.getTop(10);
// Market data in a specific local currency
String eurData = api.getDataCurrency("BTC", "EUR");
// Performance data
String performance = api.getPerformance("ETH");
// Volatility data
String allVol = api.getVolatility();
String btcVol = api.getVolatility("BTC");
String topVol = api.getVolatilityByTop(20);
// All-time high / all-time low
String athAtl = api.getATHATL("BTC");
String athAtl6m = api.getATHATLByMonths("BTC", 6);
// Fear & Greed Index
String fearGreed = api.getFearGreed();
// Technical analysis indicators
String ta = api.getTechnicalAnalysis("BTC");
// Breakout signals
String allBreakouts = api.getBreakouts();
String btcBreakouts = api.getBreakouts("BTC");
// Correlation between cryptocurrencies
String corr = api.getCorrelation("BTC,ETH,SOL");
String corr30d = api.getCorrelation("BTC,ETH,SOL", 30);
// Support and resistance levels
String sr = api.getSupportResistance("BTC");
String sr90 = api.getSupportResistance("BTC", 90);
// Moving Average Ribbon
String maRibbon = api.getMARibbon("BTC");
String maRibbon200 = api.getMARibbon("BTC", 200);
// Bollinger Bands
String bollinger = api.getBollinger("BTC");
String bollingerCustom = api.getBollinger("BTC", 30, 20, 2.0);
// Exchange data
String binance = api.getExchange("binance");
// Currency conversion
String conversion = api.getConversion("BTC", "USD", 1.5);
// Historical data (last N days)
String history = api.getHistory("BTC", 30);
// Specific date range
String timeframe = api.getTimeframe("BTC", "2024-01-01", "2024-12-31");
// OHLC data
String ohlc = api.getOHLC("BTC");
String ohlc7d = api.getOHLC("BTC", 7);
String ohlcRange = api.getOHLC("BTC", "2024-01-01", "2024-06-30");
All API errors throw FreeCryptoAPIException, which extends RuntimeException and includes the HTTP status code.
try {
String data = api.getData("INVALID");
} catch (FreeCryptoAPIException e) {
System.err.println("Status code: " + e.getStatusCode());
System.err.println("Message: " + e.getMessage());
}
All requests require a valid API key passed as a Bearer token. Requires .NET 6.0 or later. No external NuGet dependencies.
using FreeCryptoAPI;
using var client = new FreeCryptoAPI("your_api_key");
// Get Bitcoin market data
string btc = await client.GetDataAsync("BTC");
Console.WriteLine(btc);
// List all supported cryptocurrencies
string cryptoList = await client.GetCryptoListAsync();
// Get data for one or multiple symbols
string btc = await client.GetDataAsync("BTC");
string multi = await client.GetDataAsync("BTC+ETH+SOL");
// Get data from a specific exchange
string btcBinance = await client.GetDataAsync("BTC@binance");
// Get top 20 by market cap
string top20 = await client.GetTopAsync(20);
// Market data in a local currency
string btcEur = await client.GetDataCurrencyAsync("BTC", "EUR");
// Performance metrics
string perf = await client.GetPerformanceAsync("BTC");
// Volatility data
string vol = await client.GetVolatilityAsync(symbol: "BTC");
// All-time high / all-time low
string athAtl = await client.GetATHATLAsync(symbol: "ETH");
// Fear & Greed Index
string fg = await client.GetFearGreedAsync();
// Technical analysis summary
string ta = await client.GetTechnicalAnalysisAsync("BTC");
// Breakout signals
string breakouts = await client.GetBreakoutsAsync();
// Correlation between symbols
string corr = await client.GetCorrelationAsync("BTC+ETH", days: 30);
// Support and resistance levels
string sr = await client.GetSupportResistanceAsync("BTC");
// Moving average ribbon
string ribbon = await client.GetMARibbonAsync("BTC", days: 60);
// Bollinger Bands
string bb = await client.GetBollingerAsync("BTC", days: 30, period: 20, stdDev: 2.0);
// Exchange data
string exchange = await client.GetExchangeAsync("binance");
// Currency conversion
string result = await client.GetConversionAsync("BTC", "USD", 1.5);
// Last 30 days of price history
string history = await client.GetHistoryAsync("BTC", 30);
// Specific date range
string timeframe = await client.GetTimeframeAsync("BTC", "2024-01-01", "2024-06-30");
// OHLC candlestick data
string ohlc = await client.GetOHLCAsync("BTC", days: 7);
string ohlcRange = await client.GetOHLCAsync("BTC", startDate: "2024-01-01", endDate: "2024-01-31");
The client throws FreeCryptoAPIException on HTTP errors. Includes the HTTP status code and message returned by the API.
using FreeCryptoAPI;
using var client = new FreeCryptoAPI("your_api_key");
try
{
string data = await client.GetDataAsync("INVALID");
}
catch (FreeCryptoAPIException ex)
{
Console.WriteLine($"Status: {(int)ex.StatusCode}");
Console.WriteLine($"Message: {ex.Message}");
}
using var client = new FreeCryptoAPI(
apiKey: "your_api_key",
baseUrl: "https://api.freecryptoapi.com/v1", // default
timeout: TimeSpan.FromSeconds(30) // default
);
| Method | Endpoint | Description |
|---|---|---|
GetCryptoListAsync() | /getCryptoList | List all supported cryptocurrencies |
GetDataAsync(symbol) | /getData | Current market data for symbol(s) |
GetTopAsync(top) | /getTop | Top cryptocurrencies by market cap |
GetDataCurrencyAsync(symbol, local) | /getDataCurrency | Market data in local currency |
GetPerformanceAsync(symbol) | /getPerformance | Performance metrics |
GetVolatilityAsync(symbol, top) | /getVolatility | Volatility data |
GetATHATLAsync(symbol, months) | /getATHATL | All-time high / all-time low |
GetFearGreedAsync() | /getFearGreed | Fear & Greed Index |
GetTechnicalAnalysisAsync(symbol) | /getTechnicalAnalysis | Technical analysis summary |
GetBreakoutsAsync(symbol) | /getBreakouts | Breakout signals |
GetCorrelationAsync(symbols, days) | /getCorrelation | Symbol correlation |
GetSupportResistanceAsync(symbol, period) | /getSupportResistance | Support & resistance |
GetMARibbonAsync(symbol, days) | /getMARibbon | Moving average ribbon |
GetBollingerAsync(symbol, days, period, stdDev) | /getBollinger | Bollinger Bands |
GetExchangeAsync(exchange) | /getExchange | Exchange data |
GetConversionAsync(from, to, amount) | /getConversion | Currency conversion |
GetHistoryAsync(symbol, days) | /getHistory | Historical price data |
GetTimeframeAsync(symbol, start, end) | /getTimeframe | Price data for date range |
GetOHLCAsync(symbol, days, startDate, endDate) | /getOHLC | OHLC candlestick data |
Every SDK gives you full access to the entire FreeCryptoAPI surface. No gaps.
/getData/getCryptoList/getTop/getDataCurrency/getPerformance/getVolatility/getATHATL/getFearGreed/getTechnicalAnalysis/getBreakouts/getCorrelation/getSupportResistance/getMARibbon/getBollinger/getExchange/getConversion/getHistory/getTimeframe/getOHLCGet your free API key and start integrating crypto data into your application in under 5 minutes.
Get Free API Key View Full Docs