BuildShip Logo
BuildShipΒ Community

FinSage

This template provides an AI-powered investment analysis for any company based on the latest news headlines. It accepts a company name or ticker, fetches recent news, and returns a structured JSON report with sentiment scores, market trends, investment recommendations, and risk notes.

1

Report this template

Select the reason for reporting

Describe the issue in detail

Share template

Link to template

https://templates.buildship.com/template/aAJquzw9-CAq/

Inputs

company

Google
This is a static example using sample inputs. Remix the template to run it with your own values.

Output

Read me

AI-Based Stock Sentiment & Investment Scoring Workflow


πŸ“ˆ AI-Powered Stock Sentiment & Investment Score Generator

This project leverages Buildship's no-code automation platform and OpenAI's language models to create a smart financial analysis tool. By processing real-time news headlines for any public company, the workflow evaluates media sentiment, flags risk signals, and generates an investment recommendation β€” all within a structured API workflow.


πŸ” Overview

This workflow:

  • Accepts a company name (e.g., "Google", "Tesla")
  • Fetches the latest news headlines using the NewsAPI
  • Sends those headlines to an LLM (OpenAI) for analysis
  • Returns a structured JSON response with:
    • Sentiment analysis
    • Investment recommendation
    • Risk factors
    • Confidence score
    • Final investment score for ranking

🧠 Key Features

πŸ“° News IntegrationUses NewsAPI to fetch real-time headlines

🧠 AI Sentiment AnalysisOpenAI interprets tone, trends, risks, and investor sentiment

πŸ“Š Investment ScoringCalculates a 0–100 score to rank companies based on outlook

⚠️ Caution DetectionFlags layoffs, lawsuits, or product issues from headlines

πŸ” REST API InterfaceTriggered via POST with a company name as input

🧱 No frontend includedDesigned solely as a self-contained, API-based backend workflow


πŸ—οΈ Workflow Structure

Input Node: Accepts JSON: { "company": "CompanyName" }

NewsAPI Node: - Endpoint: /v2/everything - Params: q={{inputs.company}}, from=2025-06-01, sortBy=popularity, language=en

OpenAI Node (Text Generation): - Prompt: Analyzes sentiment, risk, and price direction - Produces JSON fields: - sentiment_score - sentiment_classification - recommendation - confidence - caution_notes - final_score - etc.

Code Node (Scoring Logic): - Parses OpenAI response - Applies formula: final_score = (sentiment_score * 0.5) + (recommendation_weight * 25) + (confidence * 0.2) - penalty


πŸ“₯ API Usage

πŸ”— Endpoint (example)

POST https://api.buildship.com/flow/<your-flow-id>

πŸ“¨ Request Body

jsonCopy code{ "company": "Tesla" }

πŸ“€ Response

{ "company": "Tesla", "sentiment_score": 78, "recommendation": "Hold", "confidence": 85, "caution_notes": "Layoffs in key teams.", "final_score": 82, "price_direction": "β†’", "top_headlines": [ { "title": "...", "sentiment": "Positive" }, { "title": "...", "sentiment": "Negative" }, ... ] }


πŸ“Š Scoring Formula

The investment scoring logic works as follows:

final_score = (sentiment_score * 0.5) + (recommendation_weight * 25) + (confidence * 0.2) - caution_penalty MetricWeight/ImpactSentiment Score0–100 β†’ 50% of total scoreRecommendationBuy=3, Hold=2, Sell=1ConfidenceWeighted at 20%Caution Penalty-15 if risk factors present


πŸ”’ API Keys Used

  • NewsAPI Key – securely stored in Buildship secrets
  • OpenAI API – managed by Buildship under LLM tools

πŸ“Œ Assumptions & Notes

  • No backend/frontend system required β€” submission is only the Buildship workflow
  • Works best when major news stories are available for the target company
  • Handles one company per request; multiple can be handled with looping extensions

βœ… Submission Summary

  • πŸ’‘ Project: AI-Powered Stock Investment Analysis API
  • πŸ“¦ Platform: Buildship
  • 🧠 AI Engine: OpenAI GPT-4
  • πŸ” Output: JSON structure containing investment insights and final score
  • πŸ“€ Delivery: Hosted API endpoint ready for external use