Skip to main content
GET
/
api
/
v1
/
market
/
ticker
/
:exchange
/
:symbol
Tickers
curl --request GET \
  --url https://api.example.com/api/v1/market/ticker/:exchange/:symbol
{
  "error": "Exchange and symbol are required"
}

Overview

Fetch real-time price and volume data for a specific trading pair on an exchange. The endpoint supports Redis caching with a 10-second TTL and automatically falls back to database storage when the CCXT service is unavailable.

Endpoint

GET /api/v1/market/ticker/:exchange/:symbol

Path Parameters

exchange
string
required
The exchange identifier (e.g., binance, coinbase, kraken)
symbol
string
required
The trading pair symbol in exchange format (e.g., BTC/USDT, ETH/USD)

Response Schema

exchange
string
required
The exchange name from the request
symbol
string
required
The trading pair symbol from the request
price
decimal
required
The last traded price for the symbol
volume
decimal
required
The 24-hour trading volume
timestamp
timestamp
required
The timestamp when this data was captured from the exchange

Code Examples

curl -X GET "https://api.neuratrade.io/api/v1/market/ticker/binance/BTC/USDT" \
  -H "Content-Type: application/json"

Response Example

{
  "exchange": "binance",
  "symbol": "BTC/USDT",
  "price": "50000.00",
  "volume": "1250.5432",
  "timestamp": "2026-03-03T10:30:45Z"
}

Data Sources

The endpoint retrieves data in the following priority order:
  1. Redis Cache - Returns cached data if available (10-second TTL)
  2. Live CCXT Service - Fetches real-time data from the exchange if CCXT service is healthy
  3. Database Fallback - Queries the most recent ticker from the market_data table if live service is unavailable

Error Responses

{
  "error": "Exchange and symbol are required"
}

Implementation Details

  • Caching Strategy: 10-second Redis TTL for ticker data
  • Database Schema: Joins market_data, exchanges, and trading_pairs tables
  • Source Code: services/backend-api/internal/api/handlers/market.go:435

Bulk Tickers

To retrieve all tickers for a specific exchange, use the bulk endpoint:
GET /api/v1/market/tickers/:exchange
See the bulk tickers endpoint for retrieving multiple trading pairs in a single request.

Build docs developers (and LLMs) love