Purchase Now

Overview

CoinTrail now offers API access for Pro and Premium tier subscribers. This feature allows your users to integrate real-time cryptocurrency data into their own applications, trading bots, dashboards, and more.

Pro Feature

API access is only available to users with Pro, Premium, Enterprise, or Business subscriptions. Free tier users will see a prompt to upgrade.

User API Dashboard

Pro subscribers can access their API dashboard at /user/api to manage their API keys and view usage statistics.

frontend/api-key-generation.png

Dashboard Features

  • API Key Management - Create, revoke, and manage up to 5 API keys per account
  • Usage Statistics - View detailed usage stats for each key
  • Call History - See the 50 most recent API calls
  • Response Times - Monitor API performance
  • Monthly Usage - Track usage over the last 30 days

Creating API Keys

Users can create new API keys with customizable permissions:

Read Permission

Access market data, cryptocurrency information, and read portfolio data.

Write Permission

Create and manage portfolios, add holdings, create price alerts.

Available API Endpoints

The API provides access to the following endpoint categories:

Market Data Endpoints

Endpoint Method Description
/api/v1/markets GET List all cryptocurrencies with market data
/api/v1/markets/search GET Search cryptocurrencies by name or symbol
/api/v1/markets/global GET Get global market statistics
/api/v1/markets/top-movers GET Get top gaining and losing cryptocurrencies
/api/v1/coins/{idOrSymbol} GET Get specific cryptocurrency details
/api/v1/coins/{idOrSymbol}/history GET Get historical price data

Portfolio Endpoints

Endpoint Method Description
/api/v1/portfolio GET Get user's portfolios
/api/v1/portfolio POST Create new portfolio
/api/v1/portfolio/{id} GET Get specific portfolio
/api/v1/portfolio/{id}/transactions GET Get portfolio transactions
/api/v1/portfolio/{id}/sync POST Sync portfolio prices
/api/v1/portfolio/{portfolioId}/holdings POST Add holdings to portfolio

Price Alerts Endpoints

Endpoint Method Description
/api/v1/alerts GET Get all price alerts
/api/v1/alerts POST Create new price alert
/api/v1/alerts/{id} GET Get specific alert
/api/v1/alerts/{id}/toggle POST Toggle alert status
/api/v1/alerts/{id} DELETE Delete alert

API Authentication

All API requests must include the API key in the request header:

HTTP Header
X-API-Key: your_api_key_here

Example Request

curl -X GET "https://yoursite.com/api/v1/markets" \
  -H "X-API-Key: your_api_key_here" \
  -H "Accept: application/json"
const response = await fetch('https://yoursite.com/api/v1/markets', {
  headers: {
    'X-API-Key': 'your_api_key_here',
    'Accept': 'application/json'
  }
});
const data = await response.json();
import requests

response = requests.get(
    'https://yoursite.com/api/v1/markets',
    headers={
        'X-API-Key': 'your_api_key_here',
        'Accept': 'application/json'
    }
)
data = response.json()
$ch = curl_init('https://yoursite.com/api/v1/markets');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-API-Key: your_api_key_here',
    'Accept: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$data = json_decode($response, true);

Rate Limits

API rate limits are determined by the user's subscription tier:

Subscription Tier Monthly Calls Features
Free 1,000 Basic endpoints only
Premium 10,000 All endpoints + webhooks
Pro Unlimited Everything + priority support