Skip to content

Market Predictions API

Retrieve AI-powered price predictions for all tickers in a specific market. Use this endpoint to screen an entire market for trading signals.

GET /v1/market/{market}/predictions/{type}

Requires API key via token query parameter.

ParameterTypeRequiredDescription
marketstringYesMarket identifier (e.g., S&P 500, NASDAQ)
typestringYesPrediction type: daily or monthly
ParameterTypeRequiredDescription
tokenstringYesYour API key
dateFromstringNoStart date (YYYY-MM-DD)
dateTostringNoEnd date (YYYY-MM-DD)
Terminal window
# Get daily predictions for S&P 500
curl "https://api.finbrain.tech/v1/market/S%26P%20500/predictions/daily?token=YOUR_API_KEY"
# Get monthly predictions for NASDAQ
curl "https://api.finbrain.tech/v1/market/NASDAQ/predictions/monthly?token=YOUR_API_KEY"
[
{
"ticker": "STX",
"name": "Seagate Technology",
"prediction": {
"expectedShort": "1.24632",
"expectedMid": "1.34583",
"expectedLong": "0.07213",
"lastUpdate": "2020-10-27T23:46:54.359Z",
"type": "daily"
},
"sentimentScore": "-0.137"
},
{
"ticker": "TAP",
"name": "Molson Coors Brewing Company",
"prediction": {
"expectedShort": "0.14241",
"expectedMid": "1.19539",
"expectedLong": "1.34984",
"lastUpdate": "2020-10-27T23:46:54.415Z",
"type": "daily"
},
"sentimentScore": "0.261"
}
// ... more tickers
]

The response is an array of prediction objects with the following fields:

FieldTypeDescription
tickerstringTicker symbol
namestringCompany name
predictionobjectPrediction data object
sentimentScorestringCurrent sentiment score for the ticker
FieldTypeDescription
expectedShortstringExpected price change % (short-term, ~3 days)
expectedMidstringExpected price change % (mid-term, ~5 days)
expectedLongstringExpected price change % (long-term, ~10 days)
lastUpdatestringTimestamp of last prediction update (ISO 8601)
typestringPrediction type (daily or monthly)
from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
# Get all S&P 500 predictions
predictions = fb.predictions.market("S&P 500", prediction_type="daily")
# Filter for strongly bullish predictions (expectedLong > 2%)
bullish = []
for pred in predictions:
expected_long = float(pred["prediction"]["expectedLong"])
if expected_long > 2.0:
bullish.append({
"ticker": pred["ticker"],
"name": pred["name"],
"expected_long": expected_long,
"sentiment": float(pred["sentimentScore"])
})
# Sort by expected return
bullish = sorted(bullish, key=lambda x: x["expected_long"], reverse=True)
print("Top Bullish Signals (10-day expected return > 2%):")
for b in bullish[:10]:
print(f" {b['ticker']}: {b['expected_long']:.2f}% expected, sentiment: {b['sentiment']:.3f}")
from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
def market_sentiment_summary(market):
"""Calculate overall market sentiment from predictions"""
predictions = fb.predictions.market(market, prediction_type="daily")
bullish = 0
bearish = 0
neutral = 0
for pred in predictions:
expected_long = float(pred["prediction"]["expectedLong"])
if expected_long > 1.0:
bullish += 1
elif expected_long < -1.0:
bearish += 1
else:
neutral += 1
total = len(predictions)
return {
"market": market,
"total_tickers": total,
"bullish": bullish,
"bearish": bearish,
"neutral": neutral,
"bullish_pct": bullish / total * 100 if total > 0 else 0
}
summary = market_sentiment_summary("S&P 500")
print(f"Market: {summary['market']}")
print(f"Bullish: {summary['bullish']} ({summary['bullish_pct']:.1f}%)")
print(f"Bearish: {summary['bearish']}")
print(f"Neutral: {summary['neutral']}")
from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
markets = ["S&P 500", "NASDAQ"]
for market in markets:
predictions = fb.predictions.market(market, prediction_type="daily")
bullish_count = 0
for pred in predictions:
expected_long = float(pred["prediction"]["expectedLong"])
if expected_long > 1.0:
bullish_count += 1
total = len(predictions)
print(f"{market}: {bullish_count}/{total} bullish ({bullish_count/total*100:.1f}%)")
CodeErrorDescription
400Bad RequestInvalid market or prediction type
401UnauthorizedInvalid or missing API key
404Not FoundMarket not found
500Internal Server ErrorServer-side error