Skip to content

Ticker Predictions API

Retrieve AI-powered price predictions for a specific ticker. Returns daily or monthly forecasts with directional signals and confidence scores.

GET /v1/ticker/{ticker}/predictions/{type}

Requires API key via token query parameter.

ParameterTypeRequiredDescription
tickerstringYesStock ticker symbol (e.g., AAPL, MSFT)
typestringYesPrediction type: daily or monthly
ParameterTypeRequiredDescription
tokenstringYesYour API key
dateFromstringNoStart date (YYYY-MM-DD)
dateTostringNoEnd date (YYYY-MM-DD)
Terminal window
# Get daily predictions
curl "https://api.finbrain.tech/v1/ticker/AAPL/predictions/daily?token=YOUR_API_KEY"
# Get monthly predictions
curl "https://api.finbrain.tech/v1/ticker/AAPL/predictions/monthly?token=YOUR_API_KEY"
# Get historical predictions
curl "https://api.finbrain.tech/v1/ticker/AAPL/predictions/daily?token=YOUR_API_KEY&dateFrom=2024-01-01&dateTo=2024-01-31"
{
"ticker": "AAPL",
"name": "Apple Inc.",
"prediction": {
"2024-11-04": "201.33,197.21,205.45",
"2024-11-05": "202.77,196.92,208.61",
"2024-11-06": "203.99,196.90,211.08",
"2024-11-07": "204.68,196.78,212.59",
"2024-11-08": "204.72,195.56,213.88",
"2024-11-11": "203.48,193.22,213.73",
"2024-11-12": "203.32,191.97,214.66",
"2024-11-13": "203.11,190.97,215.26",
"2024-11-14": "203.32,190.66,215.97",
"2024-11-15": "204.05,190.93,217.18",
"expectedShort": "0.22",
"expectedMid": "0.58",
"expectedLong": "0.25",
"type": "daily",
"lastUpdate": "2024-11-01T23:24:18.371Z"
},
"sentimentAnalysis": {
"2024-11-04": "0.186",
"2024-11-01": "0.339",
"2024-10-31": "0.565",
"2024-10-30": "0.437",
"2024-10-29": "0.433",
"2024-10-28": "0.398",
"2024-10-25": "0.443",
"2024-10-24": "0.426",
"2024-10-23": "0.426",
"2024-10-22": "0.426"
}
}
FieldTypeDescription
tickerstringStock ticker symbol
namestringCompany name
predictionobjectPrediction data object with date-keyed forecasts
sentimentAnalysisobjectHistorical sentiment scores keyed by date
FieldTypeDescription
{date}stringDate-keyed price predictions in format "predicted,low,high"
expectedShortstringExpected short-term price change % (~3 days)
expectedMidstringExpected mid-term price change % (~5 days)
expectedLongstringExpected long-term price change % (~10 days)
typestringPrediction type (daily or monthly)
lastUpdatestringWhen prediction was last updated (ISO 8601)

Each date entry contains a comma-separated string with three values:

  • Predicted price: The model’s price forecast
  • Low bound: Lower confidence bound
  • High bound: Upper confidence bound

Example: "201.33,197.21,205.45" means predicted price of $201.33, with range $197.21 - $205.45

The sentimentAnalysis object contains historical sentiment scores keyed by date:

FieldTypeDescription
{date}stringSentiment score for that date (-1 to 1)

The expected move fields indicate percentage price change predictions:

FieldTime Horizon
expectedShort~3 trading days
expectedMid~5 trading days
expectedLong~10 trading days
from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
data = fb.predictions.ticker("AAPL", prediction_type="daily")
pred = data["prediction"]
print(f"AAPL Prediction (updated {pred['lastUpdate']})")
print(f" Expected Short-term: {pred['expectedShort']}%")
print(f" Expected Mid-term: {pred['expectedMid']}%")
print(f" Expected Long-term: {pred['expectedLong']}%")
# Parse date-keyed predictions
for key, value in pred.items():
if key.startswith("202"): # Date keys start with year
predicted, low, high = value.split(",")
print(f" {key}: ${predicted} (range: ${low} - ${high})")
from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
def get_price_forecasts(ticker):
"""Extract price forecasts from predictions"""
data = fb.predictions.ticker(ticker, prediction_type="daily")
pred = data["prediction"]
forecasts = []
for key, value in pred.items():
# Date keys are in YYYY-MM-DD format
if "-" in key and len(key) == 10:
predicted, low, high = value.split(",")
forecasts.append({
"date": key,
"predicted": float(predicted),
"low": float(low),
"high": float(high)
})
return sorted(forecasts, key=lambda x: x["date"])
forecasts = get_price_forecasts("AAPL")
for f in forecasts:
print(f"{f['date']}: ${f['predicted']:.2f} (${f['low']:.2f} - ${f['high']:.2f})")
from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
data = fb.predictions.ticker("AAPL", prediction_type="daily")
sentiment = data["sentimentAnalysis"]
# Convert to sorted list
sentiment_history = [
{"date": date, "score": float(score)}
for date, score in sentiment.items()
]
sentiment_history.sort(key=lambda x: x["date"], reverse=True)
print("Recent Sentiment History:")
for s in sentiment_history[:5]:
sentiment_label = "Positive" if s["score"] > 0 else "Negative"
print(f" {s['date']}: {s['score']:.3f} ({sentiment_label})")
from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
tickers = ["AAPL", "MSFT", "GOOGL", "NVDA"]
for ticker in tickers:
data = fb.predictions.ticker(ticker, prediction_type="daily")
pred = data["prediction"]
print(f"{ticker}: Short {pred['expectedShort']}%, Mid {pred['expectedMid']}%, Long {pred['expectedLong']}%")
CodeErrorDescription
400Bad RequestInvalid ticker or prediction type
401UnauthorizedInvalid or missing API key
404Not FoundTicker not found
500Internal Server ErrorServer-side error