Developer Documentation

API Reference

Programmatic access to trading signals, performance data, and real-time streams.

Getting Started

Base URL

https://signals-api-gateway.fly.dev

Response Format

All responses are in JSON format with appropriate HTTP status codes:

  • 200 OK - Request successful
  • 404 Not Found - Resource not found
  • 500 Internal Server Error - Server error

Rate Limiting

API requests are rate-limited to 60 requests per minute per IP address. Exceeding this limit will result in HTTP 429 responses.

Authentication

Currently, all endpoints are publicly accessible without authentication. Premium features requiring API keys will be available in a future release.

Available Endpoints

GET/v1/signals

Retrieve recent trading signals

Parameters

mode
(string)

Trading mode: "paper" or "live" (default: paper)

limit
(number)

Number of signals to return (default: 200, max: 1000)

pair
(string)

Filter by trading pair (e.g., "BTC/USD")

Example Request

curl "https://signals-api-gateway.fly.dev /v1/signals?mode=paper&limit=10"
GET/v1/signals/stream

Server-Sent Events stream for real-time signals

Parameters

mode
(string)

Trading mode: "paper" or "live"

Example Request

curl -N "https://signals-api-gateway.fly.dev /v1/signals/stream?mode=paper"
GET/v1/pnl

Get historical PnL / equity curve data

Parameters

n
(number)

Number of data points (default: 500, max: 10000)

Example Request

curl "https://signals-api-gateway.fly.dev /v1/pnl?n=1000"
GET/v1/backtest/pnl

Get backtest equity curve for a specific symbol

Parameters

symbol
(string)required

Trading pair (e.g., "BTC-USD")

timeframe
(string)

Chart timeframe (default: "1h")

Example Request

curl "https://signals-api-gateway.fly.dev /v1/backtest/pnl?symbol=BTC-USD"
GET/v1/backtest/trades

Get backtest trade entry/exit markers

Parameters

symbol
(string)required

Trading pair (e.g., "BTC-USD")

Example Request

curl "https://signals-api-gateway.fly.dev /v1/backtest/trades?symbol=BTC-USD"
GET/health

API health check endpoint

Example Request

curl "https://signals-api-gateway.fly.dev /health"
GET/v1/pnl/summary

Performance metrics summary

Parameters

mode
(string)

Trading mode: "paper" or "live"

Example Request

curl "https://signals-api-gateway.fly.dev /v1/pnl/summary?mode=paper"
GET/v1/signals/latest

Get most recent signals (REST)

Parameters

mode
(string)

Trading mode: "paper" or "live"

limit
(number)

Number of signals (default: 50)

Example Request

curl "https://signals-api-gateway.fly.dev /v1/signals/latest?mode=paper&limit=10"

Code Examples

JavaScript / TypeScript

// Fetch recent signals
const response = await fetch('https://signals-api-gateway.fly.dev
/v1/signals?mode=paper&limit=10');
const signals = await response.json();

// Connect to real-time stream
const eventSource = new EventSource('https://signals-api-gateway.fly.dev
/v1/signals/stream?mode=paper');
eventSource.addEventListener('signal', (event) => {
  const signal = JSON.parse(event.data);
  console.log('New signal:', signal);
});

Python

import requests

# Fetch recent signals
response = requests.get('https://signals-api-gateway.fly.dev
/v1/signals', params={'mode': 'paper', 'limit': 10})
signals = response.json()

# Get PnL data
pnl_response = requests.get('https://signals-api-gateway.fly.dev
/v1/pnl', params={'n': 1000})
pnl_data = pnl_response.json()

Need help or have questions? Join our Discord community or email support@aipredictedsignals.cloud