API Reference

Access real-time and historical cryptocurrency market data, mining statistics, and live price feeds through our REST API and WebSocket connections.

Base URL
https://horizonforecast.com/api
Format
JSON responses, REST endpoints
Rate Limit
100 requests per minute

Getting Started

All API endpoints are available under the /api prefix. No authentication is required for public endpoints. Responses are returned in JSON format.

Example Request

curl https://horizonforecast.com/api/market/price/BTC

JavaScript / TypeScript

const response = await fetch("/api/market/price/BTC");
const data = await response.json();
console.log(data.price); // 97432.15

Market Data

Real-time and historical cryptocurrency market data.

Mining Data

Bitcoin mining statistics including hash rate, difficulty, and miner revenue.

WebSocket

Real-time price updates via Socket.IO WebSocket connection.

Error Handling

The API uses standard HTTP status codes. Errors include a descriptive message in the response body.

200Success
400Bad Request — invalid parameters
404Not Found — unknown symbol or endpoint
429Too Many Requests — rate limit exceeded
500Internal Server Error