docs: update README for yfinance upgrades/price target, curl_cffi pin

- Remove FMP from optional keys (no longer used)
- Update Finnhub description (upgrades moved to yfinance)
- Update upgrades endpoint description to note yfinance + price targets
- Update data sources table
- Fix conda setup instructions to use pip install -e .
- Add Known Issues section for curl_cffi TLS workaround
This commit is contained in:
Yaojia Wang
2026-03-19 16:36:03 +01:00
parent ac101c663a
commit b6f49055ad

View File

@@ -12,7 +12,7 @@ The core functionality uses **yfinance** (free, no API key). The API works witho
| Provider | Env Variable | How to Get | What It Unlocks | Free Limit |
|----------|-------------|------------|-----------------|------------|
| **Finnhub** | `INVEST_API_FINNHUB_API_KEY` | https://finnhub.io/register | Insider trades, analyst upgrades, recommendation trends | 60 calls/min |
| **Finnhub** | `INVEST_API_FINNHUB_API_KEY` | https://finnhub.io/register | Insider trades, recommendation trends, company news | 60 calls/min |
| **FRED** | `INVEST_API_FRED_API_KEY` | https://fred.stlouisfed.org/docs/api/api_key.html | Macro data: Fed rate, CPI, GDP, unemployment, treasury yields | 120 calls/min |
| **Alpha Vantage** | `INVEST_API_ALPHAVANTAGE_API_KEY` | https://www.alphavantage.co/support/#api-key | News sentiment scores (bullish/bearish per article per ticker) | 25 calls/day |
@@ -20,7 +20,6 @@ The core functionality uses **yfinance** (free, no API key). The API works witho
| Provider | Env Variable | What It Adds |
|----------|-------------|--------------|
| **FMP** | `OBB_FMP_API_KEY` | More granular financials, earnings transcripts (250 calls/day free) |
| **Intrinio** | `OBB_INTRINIO_API_KEY` | Institutional-grade fundamentals |
| **Tiingo** | `OBB_TIINGO_TOKEN` | Reliable historical price data |
| **Benzinga** | `OBB_BENZINGA_API_KEY` | Real-time news, analyst ratings |
@@ -40,9 +39,10 @@ export INVEST_API_ALPHAVANTAGE_API_KEY=your_alphavantage_key
### 1. Create conda environment
```bash
conda env create -f environment.yml
conda create -n openbb-invest-api python=3.12 -y
conda activate openbb-invest-api
pip install openbb-quantitative openbb-econometrics
pip install -e .
pip install openbb-quantitative openbb-econometrics openbb-technical
```
### 2. Start the server
@@ -116,15 +116,15 @@ curl -X POST http://localhost:8000/api/v1/portfolio/analyze \
| GET | `/api/v1/stock/{symbol}/news` | Recent company news |
| GET | `/api/v1/stock/{symbol}/summary` | Aggregated: quote + profile + metrics + financials |
### Sentiment & Analyst Data (Finnhub + Alpha Vantage, free keys)
### Sentiment & Analyst Data (Finnhub + Alpha Vantage + yfinance)
| Method | Path | Description |
|--------|------|-------------|
| GET | `/api/v1/stock/{symbol}/sentiment` | Aggregated: news sentiment + recommendations + upgrades |
| GET | `/api/v1/stock/{symbol}/news-sentiment?limit=30` | News articles with per-ticker sentiment scores (Alpha Vantage) |
| GET | `/api/v1/stock/{symbol}/insider-trades` | Insider transactions via Finnhub |
| GET | `/api/v1/stock/{symbol}/recommendations` | Monthly analyst buy/hold/sell counts |
| GET | `/api/v1/stock/{symbol}/upgrades` | Recent analyst upgrades and downgrades |
| GET | `/api/v1/stock/{symbol}/recommendations` | Monthly analyst buy/hold/sell counts (Finnhub) |
| GET | `/api/v1/stock/{symbol}/upgrades` | Analyst upgrades/downgrades with price targets (yfinance) |
### Technical Analysis (local computation, no key needed)
@@ -431,10 +431,18 @@ docker run -p 8000:8000 invest-api
| Source | Cost | Key Required | Data Provided |
|--------|------|-------------|---------------|
| **yfinance** | Free | No | Quotes, fundamentals, financials, historical prices, news, discovery, ETF, index, crypto, forex, options, futures |
| **yfinance** | Free | No | Quotes, fundamentals, financials, historical prices, news, discovery, ETF, index, crypto, forex, options, futures, analyst upgrades/downgrades, price targets |
| **SEC** | Free | No | Insider trading (Form 4), institutional holdings (13F), company filings |
| **Finnhub** | Free | Yes (free registration) | Insider trades, analyst recommendations, upgrades/downgrades |
| **Finnhub** | Free | Yes (free registration) | Insider trades, analyst recommendations, company news |
| **Alpha Vantage** | Free | Yes (free registration) | News sentiment scores (bullish/bearish per ticker per article), 25 req/day |
| **FRED** | Free | Yes (free registration) | Fed rate, treasury yields, CPI, unemployment, GDP, VIX, 800K+ economic series |
| **openbb-technical** | Free | No (local computation) | RSI, MACD, SMA, EMA, Bollinger Bands |
| **openbb-quantitative** | Free | No (local computation) | Sharpe ratio, CAPM, normality tests, unit root tests, summary statistics |
## Known Issues
### curl_cffi TLS Fingerprint
yfinance depends on `curl_cffi` for browser-impersonated HTTP requests. Versions 0.12+ have a BoringSSL bug
that causes `SSL_ERROR_SYSCALL` on some networks (especially Linux). This project pins `curl_cffi==0.7.4`
and patches the default TLS fingerprint from `chrome` to `safari` at startup (in `main.py`) to work around this.