Docs
API Integration

API Integration

How to integrate with Forquant's API to access data and build custom solutions

Forquant API Overview

Forquant offers a comprehensive API that allows developers and advanced users to access our quantitative data, create custom integrations, and build automated trading systems. This documentation provides an overview of our API capabilities and how to get started.

API Access

Authentication

Forquant's API uses token-based authentication:

  1. Generate your API key in the dashboard under Settings > API Management
  2. Include your key in the Authorization header with each request:
Authorization: Bearer YOUR_API_KEY

Rate Limits

API access is subject to the following rate limits based on your subscription tier:

  • Standard Plan: 100 requests per hour
  • Pro Plan: 500 requests per hour
  • Business Plan: 2000 requests per hour and custom limits available

Core Endpoints

Market Data

Access real-time and historical market data:

GET /api/v1/market-data/{instrument}/{timeframe}

Parameters:

  • instrument: The market identifier (e.g., "EURUSD")
  • timeframe: Data timeframe (e.g., "1h", "4h", "1d")
  • start_date (optional): Historical data start date
  • end_date (optional): Historical data end date

Analysis Endpoints

Retrieve Forquant's proprietary analysis data:

GET /api/v1/analysis/cot-report/{instrument}
GET /api/v1/analysis/retail-sentiment/{instrument}
GET /api/v1/analysis/scoring/{instrument}
GET /api/v1/analysis/forecasted-levels/{instrument}/{timeframe}

Economic Data

Access economic indicators and calendar events:

GET /api/v1/economic-data/indicators/{country}/{indicator}
GET /api/v1/economic-data/calendar?start_date={date}&end_date={date}

Webhooks & Notifications

Set up webhooks to receive real-time notifications for:

  • Score changes above certain thresholds
  • New trading signals
  • Economic data releases
  • Custom alert triggers

Configuration available through:

POST /api/v1/webhooks/config

Example Applications

Automated Strategy Implementation

Build trading bots that respond to Forquant signals:

  1. Poll the scoring endpoint for high-probability setups
  2. Validate with sentiment and economic data endpoints
  3. Execute trades through your broker's API
  4. Monitor performance and adjust parameters

Custom Dashboard Integration

Integrate Forquant data into your existing trading dashboard:

  1. Use our API to pull relevant data points
  2. Combine with your proprietary metrics
  3. Create a unified view for decision making

Alert Systems

Build sophisticated alert systems beyond what's available in the UI:

  1. Create complex multi-factor conditions via our API
  2. Set up webhooks to receive real-time notifications
  3. Route alerts to your preferred communication channels

Sample Code

Python Example

import requests
import json
 
API_KEY = "your_api_key_here"
BASE_URL = "https://api.forquant.com/v1"
 
headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}
 
# Get EURUSD scoring data
response = requests.get(
    f"{BASE_URL}/analysis/scoring/EURUSD",
    headers=headers
)
 
if response.status_code == 200:
    score_data = response.json()
    print(f"Current EURUSD score: {score_data['current_score']}")
    print(f"Trend direction: {score_data['trend_direction']}")
else:
    print(f"Error: {response.status_code}")
    print(response.text)

JavaScript Example

const fetchForquantData = async () => {
  const API_KEY = 'your_api_key_here';
  const BASE_URL = 'https://api.forquant.com/v1';
  
  try {
    const response = await fetch(`${BASE_URL}/analysis/forecasted-levels/GBPUSD/4h`, {
      headers: {
        'Authorization': `Bearer ${API_KEY}`,
        'Content-Type': 'application/json'
      }
    });
    
    if (!response.ok) {
      throw new Error(`API error: ${response.status}`);
    }
    
    const data = await response.json();
    console.log('Forecasted support levels:', data.support_levels);
    console.log('Forecasted resistance levels:', data.resistance_levels);
    return data;
  } catch (error) {
    console.error('Failed to fetch data:', error);
  }
};

API Documentation Resources

For comprehensive API documentation:

  • Interactive API reference available at api-docs.forquant.com
  • Swagger UI for testing endpoints
  • Sample projects on our GitHub repository
  • Language-specific SDKs for Python, JavaScript, and Java

Support

For API integration support:

  • Email api-support@forquant.com
  • Visit our developer forum
  • Schedule a consultation with our API integration team (Business plan subscribers only)