openapi: 3.1.0 info: title: Api version: 0.1.0 description: Trading Dashboard API specification servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: trading description: Trading analysis operations - name: git description: Git sync operations paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check description: Returns server health status responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /trading/analyse: post: operationId: analyseMarket tags: [trading] summary: AI market analysis description: Analyse market conditions for a symbol and return trading signal requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/AnalyseRequest" responses: "200": description: Analysis result content: application/json: schema: $ref: "#/components/schemas/AnalyseResponse" /trading/whale: post: operationId: getWhaleInfo tags: [trading] summary: Whale tracking analysis description: AI analysis of institutional whale activity for a symbol requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/WhaleRequest" responses: "200": description: Whale analysis result content: application/json: schema: $ref: "#/components/schemas/WhaleResponse" /trading/sentiment: post: operationId: getSentiment tags: [trading] summary: Retail sentiment analysis description: AI analysis of retail buy/sell sentiment for a symbol requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/SentimentRequest" responses: "200": description: Sentiment analysis result content: application/json: schema: $ref: "#/components/schemas/SentimentResponse" /trading/stock-analyze: post: operationId: analyzeStock tags: [trading] summary: AI stock analysis description: AI-powered stock analysis using real financial data requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/StockAnalyzeRequest" responses: "200": description: Stock analysis result content: application/json: schema: $ref: "#/components/schemas/StockAnalyzeResponse" /git/sync: post: operationId: syncGit tags: [git] summary: Sync local changes to GitHub description: Commits all local changes and pushes to the configured GitHub remote requestBody: required: false content: application/json: schema: $ref: "#/components/schemas/GitSyncRequest" responses: "200": description: Sync result content: application/json: schema: $ref: "#/components/schemas/GitSyncResponse" /trading/news: get: operationId: getNews tags: [trading] summary: Market news description: Get latest market news for trading assets parameters: - name: symbol in: query required: false schema: type: string responses: "200": description: News articles content: application/json: schema: $ref: "#/components/schemas/NewsResponse" components: schemas: HealthStatus: type: object properties: status: type: string required: - status AnalyseRequest: type: object properties: symbol: type: string description: Trading symbol (e.g. BTCUSD, XAUUSD, EURUSD, USOIL) timeframe: type: string description: Candle timeframe (2, 5, or 10 minutes) whaleData: type: string description: Whale activity summary sentimentData: type: string description: Retail sentiment summary newsData: type: string description: Recent news headlines required: - symbol - timeframe AnalyseResponse: type: object properties: symbol: type: string signal: type: string description: "Trading signal: STRONG_BUY, BUY, NEUTRAL, SELL, STRONG_SELL" signalScore: type: number description: Score from -100 (strong sell) to 100 (strong buy) direction: type: string description: "UP or DOWN" confidence: type: number description: Confidence percentage 0-100 reasoning: type: string description: Detailed reasoning for the signal keyFactors: type: array items: type: string description: Key factors driving the signal riskLevel: type: string description: "LOW, MEDIUM, HIGH" timestamp: type: string required: - symbol - signal - signalScore - direction - confidence - reasoning - keyFactors - riskLevel - timestamp WhaleRequest: type: object properties: symbol: type: string required: - symbol WhaleResponse: type: object properties: symbol: type: string whaleActivity: type: string description: "ACCUMULATING, DISTRIBUTING, NEUTRAL" institutionalBias: type: string description: "BULLISH, BEARISH, NEUTRAL" largeOrderFlow: type: number description: Net large order flow score -100 to 100 openInterestTrend: type: string description: "RISING, FALLING, STABLE" liquidityZones: type: array items: type: string summary: type: string keyMetrics: type: array items: type: string timestamp: type: string required: - symbol - whaleActivity - institutionalBias - largeOrderFlow - openInterestTrend - liquidityZones - summary - keyMetrics - timestamp SentimentRequest: type: object properties: symbol: type: string required: - symbol SentimentResponse: type: object properties: symbol: type: string buyPercent: type: number description: Percentage of retail traders buying (0-100) sellPercent: type: number description: Percentage of retail traders selling (0-100) sentimentScore: type: number description: Score from -100 (extreme fear/sell) to 100 (extreme greed/buy) sentiment: type: string description: "STRONG_BUY, BUY, NEUTRAL, SELL, STRONG_SELL" crowdBias: type: string description: Overall crowd directional bias contrarySignal: type: string description: Contrarian signal based on crowd behavior summary: type: string timestamp: type: string required: - symbol - buyPercent - sellPercent - sentimentScore - sentiment - crowdBias - contrarySignal - summary - timestamp StockAnalyzeRequest: type: object properties: ticker: type: string required: - ticker StockAnalyzeResponse: type: object properties: ticker: { type: string } companyName: { type: string } exchange: { type: string } sector: { type: string } industry: { type: string } currentPrice: { type: number, nullable: true } previousClose: { type: number, nullable: true } change: { type: number, nullable: true } changePercent: { type: number, nullable: true } marketCap: { type: string, nullable: true } pe: { type: number, nullable: true } forwardPE: { type: number, nullable: true } eps: { type: number, nullable: true } beta: { type: number, nullable: true } week52High: { type: number, nullable: true } week52Low: { type: number, nullable: true } dividendYield: { type: number, nullable: true } revenueGrowth: { type: number, nullable: true } grossMargin: { type: number, nullable: true } profitMargin: { type: number, nullable: true } operatingMargin: { type: number, nullable: true } returnOnEquity: { type: number, nullable: true } debtToEquity: { type: number, nullable: true } targetMeanPrice: { type: number, nullable: true } recommendationKey: { type: string } analystCounts: type: object properties: strongBuy: { type: number } buy: { type: number } hold: { type: number } sell: { type: number } strongSell: { type: number } required: [strongBuy, buy, hold, sell, strongSell] hasRealData: { type: boolean } verdict: { type: string } verdictScore: { type: number } confidence: { type: number } priceTargetLow: { type: number, nullable: true } priceTargetHigh: { type: number, nullable: true } fundamentalScore: { type: number } technicalScore: { type: number } riskLevel: { type: string } executiveSummary: { type: string } bullCase: { type: string } bearCase: { type: string } keyStrengths: type: array items: { type: string } keyRisks: type: array items: { type: string } catalysts: type: array items: { type: string } valuationComment: { type: string } disclaimer: { type: string } timestamp: { type: string } required: - ticker - companyName - exchange - sector - industry - currentPrice - previousClose - change - changePercent - marketCap - pe - forwardPE - eps - beta - week52High - week52Low - dividendYield - revenueGrowth - grossMargin - profitMargin - operatingMargin - returnOnEquity - debtToEquity - targetMeanPrice - recommendationKey - analystCounts - hasRealData - verdict - verdictScore - confidence - priceTargetLow - priceTargetHigh - fundamentalScore - technicalScore - riskLevel - executiveSummary - bullCase - bearCase - keyStrengths - keyRisks - catalysts - valuationComment - disclaimer - timestamp GitSyncRequest: type: object properties: message: type: string description: Optional commit message override GitSyncResponse: type: object properties: ok: type: boolean status: type: string description: "pushed, nothing_to_commit, or failed" commitSha: type: string description: SHA of the new commit (when one was created) commitMessage: type: string pushedAt: type: string details: type: string description: Human-readable details (e.g. git output snippet) error: type: string required: - ok - status - pushedAt NewsArticle: type: object properties: title: type: string source: type: string summary: type: string sentiment: type: string description: "BULLISH, BEARISH, NEUTRAL" relevantSymbols: type: array items: type: string publishedAt: type: string url: type: string required: - title - source - summary - sentiment - relevantSymbols - publishedAt NewsResponse: type: object properties: articles: type: array items: $ref: "#/components/schemas/NewsArticle" lastUpdated: type: string required: - articles - lastUpdated