Getting Started
To use the InvestAware API, you need an API key and must specify your allowed origins in your profile settings. All requests must include your API key and Origin header.
- Base URL: https://investaware.us/.netlify/functions/
- Authentication: X-API-Key header
- Origin restriction: Origin header must match your allowed domains
POST
/api-predict
Request a new AI-powered stock prediction.
| Header | Required | Description |
|---|---|---|
| X-API-Key | Yes | Your API key |
| Origin | Yes | Must match allowed origins |
| Content-Type | Yes | application/json |
| Body Parameter | Type | Required | Description |
|---|---|---|---|
| stock | string | Yes | Ticker symbol (e.g., AAPL) |
curl -X POST https://investaware.us/.netlify/functions/api-predict -H "Content-Type: application/json" -H "X-API-Key: APIKEYHERE" -H "Origin: ORIGINHERE" -d "{ \"stock\": \"STOCKNAMEHERE\" }"Example Success Response:
{
"success": true,
"prediction": {
"stock": "AAPL",
"prediction": "up",
"confidence": 0.87,
"date": "2024-06-28"
}
}
GET
/get-api-predictions
Retrieve your past prediction requests and their results.
| Header | Required | Description |
|---|---|---|
| X-API-Key | Yes | Your API key |
| Origin | Yes | Must match allowed origins |
| Query Parameter | Type | Required | Description |
|---|---|---|---|
| limit | integer | No | Number of results to return (default: 5) |
| status | string | No | Filter by status (e.g., completed) |
curl -X GET "https://investaware.us/.netlify/functions/get-api-predictions?limit=5&status=completed" -H "X-API-Key: APIKEYHERE" -H "Origin: ORIGINHERE"Example Success Response:
{
"success": true,
"predictions": [
{
"stock": "AAPL",
"prediction": "up",
"confidence": 0.87,
"date": "2024-06-28",
"status": "completed"
},
{
"stock": "TSLA",
"prediction": "down",
"confidence": 0.72,
"date": "2024-06-27",
"status": "completed"
}
]
}
Best Practices & Tips
- Keep your API key secure. Do not share it publicly.
- Whitelist only trusted domains as allowed origins.
- Respect rate limits and avoid excessive requests.
- Check the API status page for outages or maintenance.
Need help? Contact support@investaware.us or see our FAQ.