Build autonomous AI agents that discover, evaluate, and execute trading strategies with HGM Intelligence API.
P95 latency of 85ms ensures agents can execute decisions instantly
Every API call generates HMAC-SHA256 signed receipts for verification
Pay only for what you use via x402 protocol in USDC
3-call setup: discover → authenticate → start querying
Real-time streaming of opportunities, alerts, and market data
Push notifications for opportunities, alerts, and sentiment changes
Query multiple categories and assets in single request
Automatic retry with exponential backoff and detailed error codes
All API requests require a Bearer token in the Authorization header:
Authorization: Bearer hgm_live_xxxxxxxxxxxxxGet your API key from the Agent Dashboard
import requests
import json
from datetime import datetime
# Initialize HGM API client
class HGMAgent:
def __init__(self, api_key: str):
self.api_key = api_key
self.base_url = "https://api.heathglobalmacro.xyz"
self.headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
def discover_opportunities(self, min_confidence: int = 80):
"""Discover arbitrage opportunities"""
response = requests.get(
f"{self.base_url}/api/v1/opportunities",
params={"minConfidence": min_confidence},
headers=self.headers
)
return response.json()
def get_market_intelligence(self):
"""Get macro indicators and sector signals"""
response = requests.get(
f"{self.base_url}/api/v1/market-intelligence",
headers=self.headers
)
return response.json()
def get_sentiment(self, asset: str = None):
"""Get sentiment analysis"""
params = {}
if asset:
params["asset"] = asset
response = requests.get(
f"{self.base_url}/api/v1/sentiment",
params=params,
headers=self.headers
)
return response.json()
def execute_autonomous_workflow(self):
"""Example autonomous trading workflow"""
# 1. Discover opportunities
opportunities = self.discover_opportunities(min_confidence=85)
# 2. Get market intelligence
intelligence = self.get_market_intelligence()
# 3. Get sentiment
sentiment = self.get_sentiment()
# 4. Evaluate and execute
for opp in opportunities['data']:
if opp['confidence'] > 85 and sentiment['sentiment_score'] > 0.7:
print(f"Executing: {opp['name']}")
print(f"Expected Return: {opp['expectedReturn']}")
print(f"Spread: {opp['spread']}%")
return {
"opportunities": opportunities,
"intelligence": intelligence,
"sentiment": sentiment,
"timestamp": datetime.now().isoformat()
}
# Usage
if __name__ == "__main__":
agent = HGMAgent(api_key="your_api_key_here")
result = agent.execute_autonomous_workflow()
print(json.dumps(result, indent=2))/api/v1/opportunitiesDiscover arbitrage opportunities across 8 market categories
$0.001 per call
/api/v1/market-intelligenceGet macro indicators, sector signals, and volatility indices
$0.0005 per call
/api/v1/sentimentReal-time sentiment analysis from news and social media
$0.002 per call
/api/v1/alerts/weatherWeather events affecting commodity prices
$0.0003 per call
/api/v1/alerts/policyPolicy changes and regulatory updates
$0.0005 per call