# TradingView Data API
Real-time & historical market data via REST, WebSocket, SSE, and MCP. Covers stocks, crypto, forex, futures, bonds, ETFs, indices, technical analysis, leaderboards, calendars, news, community ideas, and world economy indicators.
> **Full documentation, parameters, response schemas, and interactive testing are on the official site. This page is only a quick index.**
## Key Features
- ⚡ **Real-time Data**: Live price updates and market information
- 🌍 **Global Coverage**: Access data from major worldwide exchanges
- 📦 **Batch Operations**: Efficiently fetch data for multiple symbols
- ⏱️ **Multiple Timeframes**: Support for various chart intervals
- 📈 **Professional Analysis**: Built-in technical analysis indicators
- 🏆 **Market Leaderboards**: Discover trending stocks and market opportunities through comprehensive leaderboards
- 🧮 **Stock Screener**: Run TradingView-style stock scans with metadata-driven filters, preset field groups, sorting, and market-specific coverage
- 🌐 **World Economy Indicators**: Track macroeconomic rankings across regions and countries
- 🔌 **WebSocket Streaming**: Bidirectional real-time price and quote subscriptions with JWT auth
- 📡 **SSE Streaming**: Lightweight one-way real-time push with automatic reconnect support
- 🤖 **MCP Integration**: Native Model Context Protocol support for AI assistants (Claude, Cursor)
- 🏢 **Comprehensive Market Data**: Detailed financial information including company profiles, financial statements, technical indicators, and analyst recommendations
- 📰 **Financial News**: Multi-category news feed across stocks, crypto, forex, futures, bonds, ETFs, indices, and economic events
- 📅 **Calendar Events**: Economic, earnings, dividends, and IPO calendars across global markets
- 🔍 **Market Search**: Discover instruments across all asset types by keyword or symbol
- 💡 **Community Insights**: Access TradingView community trading ideas, market sentiment, and expert analysis
## Recommended Integration (AI Agent Skill)
The fastest way to integrate is the **`tradingview-api-integration`** skill — it gives AI coding agents (Claude Code, Cursor, Codex, and other `SKILL.md`-compatible tools) full endpoint knowledge, metadata-driven parameter resolution, and a bundled live API client.
**Install** (via [skills.sh](https://skills.sh)):
```bash
# Global install (recommended)
npx skills add hypier/tradingview-api-integration-skill -g -y
# Project-level install
npx skills add hypier/tradingview-api-integration-skill -y
```
**API key** — set `RAPIDAPI_KEY`, or save once with `python3 scripts/tv_api.py --save-key 'YOUR_KEY'` (get your key on [RapidAPI](https://rapidapi.com/hypier/api/tradingview-data1)).
- **GitHub**: [hypier/tradingview-api-integration-skill](https://github.com/hypier/tradingview-api-integration-skill)
- **skills.sh**: [skills.sh/hypier/tradingview-api-integration-skill](https://skills.sh/hypier/tradingview-api-integration-skill)
- **Full skill guide**: [docs — AI Agent Skill](https://www.tradingviewapi.com/docs/#agent-skill)
## Official Resources
- **Docs**: [https://www.tradingviewapi.com/docs/](https://www.tradingviewapi.com/docs/) — complete endpoint reference, parameters, and examples
- **Playground**: [https://www.tradingviewapi.com/playground/](https://www.tradingviewapi.com/playground/) — test endpoints live in your browser
- **Metadata Browser**: [https://www.tradingviewapi.com/metadata-browser/](https://www.tradingviewapi.com/metadata-browser/) — markets, tabs, column sets, languages, 353+ exchanges
- **Screener Metadata Guide**: [https://www.tradingviewapi.com/screener-metadata/](https://www.tradingviewapi.com/screener-metadata/) — screener filter IDs, enum values, preset groups, and request-shape guidance
- **WebSocket Test**: [https://www.tradingviewapi.com/ws-test](https://www.tradingviewapi.com/ws-test) — interactive WS connection testing
## Endpoint Index
For parameters and response schemas, see the [official docs](https://www.tradingviewapi.com/docs/).
| Category | Endpoints |
|---|---|
| **Price Data** | `GET /api/price/{symbol}` · `POST /api/price/batch` |
| **Quotes** | `GET /api/quote/{symbol}` · `POST /api/quote/batch` |
| **Search** | `GET /api/search/market/{query}` |
| **Technical Analysis** | `GET /api/ta/{symbol}` · `GET /api/ta/{symbol}/indicators` |
| **Market Data** | `GET /api/market-data/{symbol}` (+ `/company`, `/ipo`, `/indicators`, `/ttm`, `/current`, `/financials-quarterly`, `/financials-annual`, `/history-quarterly`, `/history-annual`, `/dividend`, `/analyst-recommendations`, `/enterprise-value`, `/credit-ratings`, `/cash-flow`) |
| **Community Ideas** | `GET /api/ideas/hot` · `/editors-picks` · `/{symbol}/minds` · `/list/{symbol}` · `/{imageUrl}` |
| **News** | `GET /api/news` · `/news/{stock\|crypto\|forex\|futures\|bond\|etf\|index\|economic}` · `/news/{newsId}` |
| **Leaderboards** | `GET /api/leaderboard/{stocks\|indices\|crypto\|futures\|forex\|bonds\|corporate-bonds\|etfs}` · `GET /api/leaderboard/data?id=...` (legacy) |
| **Screener** | `GET /api/screener/filter-options` · `GET /api/screener/presets` · `POST /api/screener/scan` |
| **Calendar** | `GET /api/calendar/{economic\|earnings\|revenue\|ipo}` (`revenue` = dividends calendar) |
| **World Economy** | `GET /api/world-economy/indicators/{indicator}` |
| **Metadata** | `GET /api/metadata/{markets\|tabs\|columnsets\|languages\|exchanges\|world-economy/indicators}` |
| **Logo** | `GET /logo?url=...` · `GET /logo/{path}` |
| **Token (WS/SSE)** | `POST /api/token/generate` |
| **MCP** | `POST /api/mcp/generate` |
| **WebSocket** | `wss://ws.tradingviewapi.com/ws?token=...` |
| **SSE** | `GET https://ws.tradingviewapi.com/sse/stream?token=...&symbols=...` |
## Screener Workflow
Use the Screener endpoints when you need a TradingView-style stock scanner instead of a leaderboard snapshot.
1. Call `GET /api/screener/filter-options` first to discover valid screener field IDs, enum values, value types, and supported operations.
2. Call `GET /api/screener/presets` if you want ready-made output groups such as `overview`, `valuation`, or `technicals`.
3. Call `POST /api/screener/scan` with `market`, `range`, and your selected `preset_fields`, `fields`, or `extra_fields`. Add `filters` and `sort` only when needed.
**Quick notes:**
- Common stock screener market codes include `america`, `canada`, `china`, `japan`, `uk`, and `germany`.
- Use the exact screener field ID in `filters`, including case-sensitive names such as `AnalystRating`.
- Enum filters should use the exact `value` returned by `GET /api/screener/filter-options`, not a translated label.
- For field-level screener guidance, examples, and current market coverage, use the [Screener Metadata Guide](https://www.tradingviewapi.com/screener-metadata/).
## Real-time Streaming (WS / SSE / MCP)
All streaming endpoints use JWT auth. Generate a token via `POST /api/token/generate` (or `/api/mcp/generate` for MCP), then connect using the returned `wsUrl` / `sseUrl` / `mcpUrl`.
> **⚠️ Tokens expire.** Watch the `expiresAt` timestamp and refresh before expiry to avoid disconnects. Token lifetime depends on your plan (Basic: 30 min, Ultra: 1 day, Mega: 30 days). See the [official docs](https://www.tradingviewapi.com/docs/) for connection flow, message formats, and MCP client configuration (Cursor / Claude Desktop).
## Supported Markets
8 asset types: Stocks (68+ markets), Indices, Crypto, Futures, Forex, Government Bonds, Corporate Bonds, ETFs/Funds — across 353+ global exchanges.
Browse all markets, tabs, column sets, and exchanges in the [Metadata Browser](https://www.tradingviewapi.com/metadata-browser/).
---
For detailed parameters, response examples, and interactive testing, always refer to **[the official documentation](https://www.tradingviewapi.com/docs/)** and **[Playground](https://www.tradingviewapi.com/playground/)**.