Getting Started
This page is the shortest path to a successful request. It covers install, the common call pattern, exports, cookies, and one invalid-input example so you can see how failures look.
Install
Or with uv:
For local development:
First Successful Call
from tv_scraper import Technicals
scraper = Technicals()
result = scraper.get_technicals(
exchange="NASDAQ",
symbol="AAPL",
technical_indicators=["RSI", "MACD.macd"],
)
if result["status"] == "success":
print(result["data"])
else:
print(result["error"])
Output structure (success):
{
"status": "success",
"data": {"RSI": 54.21, "MACD.macd": 0.15},
"metadata": {
"exchange": "NASDAQ",
"symbol": "AAPL",
"timeframe": "1d",
"technical_indicators": ["RSI", "MACD.macd"],
},
"warnings": [],
"error": None,
}
Output structure (failure):
{
"status": "failed",
"data": None,
"metadata": {"exchange": "INVALID", "symbol": "AAPL", "technical_indicators": ["RSI"]},
"warnings": [],
"error": "Invalid value: 'INVALID'. ...",
}
Use this same pattern across the library:
- Create the scraper or streamer.
- Call a public method with keyword arguments.
- Check
result["status"]. - Read
result["data"]on success orresult["error"]on failure.
Common Input Pattern
Most symbol-based methods take exchange and symbol separately:
To find accepted values quickly, jump straight to:
Response Shape
All public methods return the same outer envelope:
{
"status": "success" | "failed",
"data": ...,
"metadata": {...},
"warnings": [str, ...],
"error": None | "message",
}
Exports
Most scrapers can export successful responses to JSON or CSV:
from tv_scraper import Technicals
scraper = Technicals(export="json")
result = scraper.get_technicals(
exchange="NASDAQ",
symbol="AAPL",
technical_indicators=["RSI"],
)
Supported export formats:
"json""csv"
Invalid export formats are one of the few cases that fail at construction time:
Cookie-Based Features
A cookie is optional for most HTTP scrapers, but required for:
- Pine
- authenticated streaming flows such as custom indicator access
The library will use TRADINGVIEW_COOKIE automatically when the constructor cookie argument is omitted. See Getting Cookies.
wrong input
This input shape is wrong because exchange and symbol are separate arguments.
Use this instead:
Next Steps
- Want exact request rules and response behavior: API Basics
- Need a method-specific page: browse the scraper docs
- Need valid values fast: Validation & Supported Values