API & Integration

Overview

The TradeHeavenAI API gives you programmatic access to AI signals, analytics, and trading automation. Connect your bots, build dashboards, automate trading, or pipe data into your favorite tools—with simple REST and WebSocket endpoints.

Use Cases

  • Automate trading on CEX/DEX using live AI signals
  • Integrate with TradingView, Telegram bots, or portfolio trackers
  • Backtest signals with your own models or analytics
  • Power your research, alerts, or portfolio dashboards

Authentication & Access

  • Log in on the dashboard and generate an API key
  • Attach the API key as an Authorization header in your requests
  • Free tier: standard endpoints; Staked/holder: premium endpoints (real-time, no delay)
  • Each key is rate-limited—rotate or request higher limits for pro access

REST Endpoints

  • GET /api/v1/signals/latest: Latest signals for all supported assets
  • GET /api/v1/signals/{pair}: Signals for a specific asset/pair
  • GET /api/v1/portfolio/{wallet}: Portfolio stats & analytics by wallet
  • GET /api/v1/leaderboard: Signal builder and referral rankings

See full OpenAPI spec in the Dev Resources section.

Webhooks & Alerts

  • Create webhook endpoints in the dashboard for instant signal delivery
  • Integrate with Discord, Telegram, Slack, or your custom endpoints
  • Webhook body contains: asset, action (buy/sell), confidence, target/stop, timestamp

Bot & Third-Party Integration

  • Connect to CEX/DEX bots using REST or WebSocket
  • Integrate with TradingView using webhook alerts
  • Examples and adapters available for Python, Node.js, and MQL5

Example: Python Signal Fetch

import requests
  
  API_KEY = "your_api_key_here"
  headers = {"Authorization": f"Bearer {API_KEY}"}
  
  resp = requests.get("https://tradeheavenai.com/api/v1/signals/latest", headers=headers)
  print(resp.json())
  

Limits, Pricing & Rate Limits

  • Free: 60 requests/minute, delayed data
  • Premium (staker/holder): 300 requests/minute, real-time, all features unlocked
  • Contact support for high-frequency/enterprise options

FAQ

  • Can I backtest via API? Yes—download historical signals and plug into your analytics.
  • Can I use this with my CEX bot? Yes—API returns are compatible with most trading bots.
  • How do I get premium access? Stake or hold the required amount of THAI, then re-generate your API key.
  • Is there a sandbox? Yes—test endpoints with demo data, no risk.