API Documentation
Integrate AmpFi's Trading Strategy API into your applications
On this page
Overview
The AmpFi Trading Strategy API provides programmatic access to our institutional-grade trading strategy predictions. Get real-time trading signals, multi-timeframe analysis, and confidence scoring for any supported trading pair.
Real-time Predictions
Get up-to-date trading strategy predictions with confidence scores and risk assessments for any supported trading pair.
Multi-timeframe Analysis
Access predictions across multiple timeframes (1h, 4h, daily) with price targets, support, and resistance levels.
Confidence Scoring
Each prediction includes confidence scores and validation metrics to help you make informed trading decisions.
Staleness Detection
Built-in staleness detection ensures you know when predictions may need updating, helping you avoid trading on outdated signals.
Value Proposition
Access $50M institutional infrastructure via API. The same technology used by hedge funds and institutional traders is now available through a simple REST API.Expert plan required.
Use Cases
The AmpFi API can be integrated into various applications and workflows. Here are some common use cases:
Custom Trading Dashboards
Build your own trading dashboard that displays real-time predictions, confidence scores, and market analysis for multiple trading pairs.
Dashboard IntegrationAutomated Trading Bots
Integrate AmpFi predictions into your existing trading bots to enhance decision-making with institutional-grade signals.
Portfolio Management Tools
Use API predictions to inform portfolio allocation decisions and risk management strategies across multiple assets.
Portfolio ToolsResearch & Analysis
Access historical and real-time predictions for research, backtesting, and market analysis purposes.
Research ToolsComplete Integration Guide
New to API integration? Our comprehensive guide walks you through integrating AmpFi Strategy API with popular trading automation platforms including CryptoHopper, 3Commas, Pionex, Bitsgap, and TradingView. Includes step-by-step instructions, complete code examples, and best practices.
Read Integration GuideGetting Started
Follow these steps to get your API token and start making requests:
Login to Dashboard
Visit https://winu.ampfi.app and log in to your account.
Navigate to Settings
Go to the Settings page from your dashboard menu.
API Credentials Section
Find the "API Credentials" section in Settings.
Generate Bearer Token
Click "Generate Token" to create your API bearer token. Store it securely.
Note: API access requires an Expert plan subscription. Upgrade your plan to access the API.
Quick Start Example
curl -X GET "https://rose.ampfi.app/api/v1/public/strategy/BTCUSDT" \ -H "Authorization: Bearer YOUR_BEARER_TOKEN"Need help integrating with trading platforms? Check out our comprehensive guide on integrating with CryptoHopper, 3Commas, Pionex, Bitsgap, and TradingView.
View Integration GuideAuthentication
The AmpFi API uses Bearer token authentication. Include your bearer token in the Authorization header of every request.
Base URL
https://rose.ampfi.appHeader Format
Authorization: Bearer <your-bearer-token>Example Request
curl -X GET "https://rose.ampfi.app/api/v1/public/strategy/BTCUSDT" \ -H "Authorization: Bearer YOUR_BEARER_TOKEN"Security Best Practices
- Never commit tokens to version control
- Use environment variables to store tokens
- Rotate tokens regularly for enhanced security
- Store tokens securely and limit access
- Use HTTPS for all API requests
API Endpoint
/api/v1/public/strategy/:symbolGet trading strategy predictions for a specific trading symbol.
Path Parameters
symbolRequiredTrading symbol in exchange format (e.g., BTCUSDT, ETHUSDT, TRUMPUSDT)
Format Requirements:
- Uppercase letters only
- No slashes or separators
- Must match exchange symbol format
Examples:
Query Parameters
currentPriceOptionalCurrent price of the symbol. If not provided, the price will be fetched from the exchange.
When to use:
Use this parameter when you have real-time price data from your own source and want to ensure the API uses the most current price.
Format:
Number (decimal format, e.g., 45000.50)
Request Examples
# Basic requestcurl -X GET "https://rose.ampfi.app/api/v1/public/strategy/BTCUSDT" \ -H "Authorization: Bearer YOUR_BEARER_TOKEN" # With currentPrice parametercurl -X GET "https://rose.ampfi.app/api/v1/public/strategy/BTCUSDT?currentPrice=45000.50" \ -H "Authorization: Bearer YOUR_BEARER_TOKEN"Rate Limiting
Rate limiting information will be available soon. For enterprise rate limits, please contact support.
Response Format
All successful responses return a JSON object containing the trading symbol and comprehensive strategy information.
Example Response (TRUMPUSDT)
Response Explorer
Click to expand nested objects and arrays
Response Fields
Error Handling
The API uses standard HTTP status codes to indicate success or failure. All error responses include a JSON object with error details.
Invalid or Missing Bearer Token
The bearer token is missing, invalid, or expired.
{ "error": "Invalid bearer token", "code": "INVALID_BEARER_TOKEN"}Troubleshooting:
- Verify your bearer token is correct
- Check that the Authorization header format is correct
- Ensure your token hasn't expired
- Regenerate your token if needed
Expert Plan Required
Your account does not have an Expert plan subscription required for API access.
{ "error": "Expert plan required", "code": "EXPERT_PLAN_REQUIRED", "message": "This endpoint is only available to users with an expert plan subscription"}Solution:
Upgrade to Expert plan to access the API.
Symbol Not Found
The requested symbol is not available on any of your configured exchanges.
{ "error": "Symbol not found in configured exchanges", "message": "Symbol BTC/USDT is not available on any of your configured exchanges."}Insufficient Historical Data
The symbol does not have enough historical data to generate predictions.
{ "error": "Insufficient historical data", "message": "Symbol BTC/USDT does not have enough historical data (minimum 208 days required)"}Invalid currentPrice Parameter
The currentPrice query parameter is not a valid number.
{ "error": "Invalid currentPrice parameter"}No Prediction Available
No prediction is currently available for the requested symbol.
{ "error": "No prediction found for BTC/USDT", "generationRequested": false}Server Error
An internal server error occurred while processing your request.
{ "error": "Failed to generate trading strategy"}Troubleshooting:
- Retry the request after a few moments
- Check our status page for service updates
- Contact support if the issue persists
Error Handling Example
try { const response = await fetch( 'https://rose.ampfi.app/api/v1/public/strategy/BTCUSDT', { headers: { 'Authorization': 'Bearer YOUR_BEARER_TOKEN' } } ); if (!response.ok) { const error = await response.json(); if (response.status === 401) { console.error('Invalid token:', error); // Handle token refresh or re-authentication } else if (response.status === 403) { console.error('Expert plan required:', error); // Redirect to pricing page } else if (response.status === 404) { console.error('Symbol not found:', error); // Handle symbol not available } else { console.error('API error:', error); } return; } const data = await response.json(); console.log('Strategy data:', data);} catch (error) { console.error('Network error:', error);}Code Examples
Real-world examples showing how to integrate the AmpFi API into your applications.
Example 1: Basic Request
Simple request to get strategy for a trading pair.
async function getStrategy(symbol) { const response = await fetch( `https://rose.ampfi.app/api/v1/public/strategy/${symbol}`, { headers: { 'Authorization': `Bearer ${process.env.AMPFI_API_TOKEN}` } } ); if (!response.ok) { throw new Error(`API error: ${response.status}`); } return await response.json();} // Usageconst strategy = await getStrategy('BTCUSDT');console.log('Signal:', strategy.strategy.signal);console.log('Confidence:', strategy.strategy.confidence);Example 2: Request with Current Price
Include current price when you have real-time price data from another source.
async function getStrategyWithPrice(symbol, currentPrice) { const url = new URL( `https://rose.ampfi.app/api/v1/public/strategy/${symbol}` ); url.searchParams.append('currentPrice', currentPrice.toString()); const response = await fetch(url, { headers: { 'Authorization': `Bearer ${process.env.AMPFI_API_TOKEN}` } }); return await response.json();} // Usage with real-time priceconst currentPrice = 45000.50; // From your price feedconst strategy = await getStrategyWithPrice('BTCUSDT', currentPrice);Example 3: Response Parsing
Parse and use the response data in your application.
async function parseStrategy(symbol) { const response = await fetch( `https://rose.ampfi.app/api/v1/public/strategy/${symbol}`, { headers: { 'Authorization': `Bearer ${process.env.AMPFI_API_TOKEN}` } } ); const data = await response.json(); const strategy = data.strategy; // Extract key information return { symbol: data.symbol, signal: strategy.signal, regime: strategy.regime, confidence: strategy.confidence, entryPrice: strategy.entry_price, targetPrice: strategy.target_price, stopLoss: strategy.stop_loss, isStale: strategy.staleness?.is_stale || false, reason: strategy.reason };} // Usageconst parsed = await parseStrategy('BTCUSDT');if (parsed.signal === 'buy' && parsed.confidence > 0.7) { console.log('High confidence buy signal!'); console.log('Entry:', parsed.entryPrice); console.log('Target:', parsed.targetPrice); console.log('Stop Loss:', parsed.stopLoss);}