API SYMBOL SEARCH & DOCUMENTATION

Find the exact symbol you need for our API, then explore the docs to integrate it.

INTRODUCTION

Welcome! This guide provides everything you need to start using the ModelMango Custom Prediction API. Our API is designed to be straightforward and powerful, enabling you to programmatically access our AI-driven market forecasts.

  • Simple RESTful API over HTTPS.
  • Predict multiple symbols in a single request.
  • Clear and predictable JSON responses.
  • Secure authentication using API keys.

AUTHENTICATION

All API requests must be authenticated using your unique API key. You can generate and manage your keys from your Dashboard. Requests without a valid key will fail with a 401 Unauthorized error.

Pass your API key in the X-Api-Key header of your request.

PREDICTION ENDPOINT

This is the core endpoint for fetching custom predictions.

POSThttps://api.modelmango.co/api/v1/custom/predict

Request Body

The request body must be a JSON object containing a list of strings under the key "symbols". Use the symbol format found via the search tool above (e.g., AAPL.US, ETH-USD.CC).

1{
2  "symbols": ["AAPL.US", "TSLA.US", "BTC-USD.CC"]
3}

Response Body

The API responds with a JSON array. Each object in the array corresponds to a requested symbol and contains its prediction or an error message.

1[
2  {
3    "symbol": "AAPL.US",
4    "prediction_date": "2023-10-27T10:30:00.123Z",
5    "predicted_high": 172.50,
6    "predicted_low": 169.80,
7    "predicted_close": 171.15,
8    "message": "Prediction generated successfully for AAPL.US."
9  },
10  {
11    "symbol": "UNKNOWN.SYMBOL",
12    "prediction_date": null,
13    "predicted_high": null,
14    "predicted_low": null,
15    "predicted_close": null,
16    "message": "Error: Symbol UNKNOWN.SYMBOL not found or insufficient data."
17  }
18]

CODE EXAMPLES

Python

This script demonstrates how to fetch predictions using Python's popular requests library.

1import requests
2import json
3import os
4
5# --- Configuration ---
6API_ENDPOINT = "https://api.modelmango.co/api/v1/custom/predict"
7# Recommended: store the key as an environment variable
8YOUR_API_KEY = os.getenv('MODELMANGO_API_KEY', "YOUR_SECRET_API_KEY_HERE")
9symbols_to_predict = ["AAPL.US", "GOOGL.US", "BTC-USD.CC"]
10
11# --- Main execution ---
12if __name__ == "__main__":
13    if YOUR_API_KEY == "YOUR_SECRET_API_KEY_HERE":
14        print("ERROR: Please set the MODELMANGO_API_KEY environment variable.")
15        exit()
16
17    headers = {
18        'X-Api-Key': YOUR_API_KEY,
19        'Content-Type': 'application/json'
20    }
21    payload = {"symbols": symbols_to_predict}
22
23    try:
24        response = requests.post(API_ENDPOINT, headers=headers, json=payload, timeout=30)
25        response.raise_for_status() # Raise an exception for bad status codes
26        
27        predictions = response.json()
28        print("Successfully retrieved predictions:")
29        print(json.dumps(predictions, indent=2))
30
31    except requests.exceptions.HTTPError as err:
32        print(f"HTTP Error: {err.response.status_code} {err.response.reason}")
33        print(f"Details: {err.response.text}")
34    except requests.exceptions.RequestException as err:
35        print(f"Request Error: {err}")

RATE LIMITS & ERRORS

Your API access is subject to rate limits based on your subscription plan. Exceeding these limits will result in a 429 Too Many Requests error response.

Always check the message field for each symbol in the response to handle cases where a specific prediction could not be generated.

For any issues, please contact support at info@giovannicanclini.com.