{"repo":"deepentropy/tvscreener","free":true,"listed":false,"github":"https://github.com/deepentropy/tvscreener","clone":"git clone https://github.com/deepentropy/tvscreener.git","description":"TradingView Screener API - Stock, Crypto, Forex, Bond, Futures, Coin","language":"JavaScript","stars":1429,"topics":["quantitative-finance","technical-analysis","tradingview"],"license":"Apache-2.0","category":"data_api","readme_excerpt":"<div align=\"center\">\n  <img src=\"https://raw.githubusercontent.com/deepentropy/tvscreener/main/.github/img/logo.png\" alt=\"TradingView Screener API Logo\" width=\"200\" height=\"200\"><br>\n  <h1>TradingView™ Screener API</h1>\n</div>\n\n-----------------\n\n# TradingView™ Screener API: simple Python library to retrieve data from TradingView™ Screener\n\n[![PyPI version](https://badge.fury.io/py/tvscreener.svg)](https://badge.fury.io/py/tvscreener)\n[![Downloads](https://pepy.tech/badge/tvscreener)](https://pepy.tech/project/tvscreener)\n[![Coverage](https://codecov.io/github/deepentropy/tvscreener/coverage.svg?branch=main)](https://codecov.io/gh/deepentropy/tvscreener)\n\n## 🚀 Try the Code Generator\n\n**Build screener queries visually and get Python code instantly!**\n\n[![Code Generator](https://img.shields.io/badge/Try%20it-Code%20Generator-2962ff?style=for-the-badge&logo=python&logoColor=white)](https://deepentropy.github.io/tvscreener/)\n\nThe Code Generator lets you:\n- Select from 6 screener types (Stock, Crypto, Forex, Bond, Futures, Coin)\n- Build filters visually with 13,000+ fields\n- Generate ready-to-use Python code\n- Copy and run in your environment\n\n---\n\n![tradingview-screener.png](https://raw.githubusercontent.com/deepentropy/tvscreener/main/.github/img/tradingview-screener.png)\n\nGet the results as a Pandas Dataframe\n\n![dataframe.png](https://github.com/deepentropy/tvscreener/blob/main/.github/img/dataframe.png?raw=true)\n\n## Disclaimer\n\n**This is an unofficial, third-party library and is not affiliated with, endorsed by, or connected to TradingView™ in any way.** TradingView™ is a trademark of TradingView™, Inc. This independent project provides a Python interface to publicly available data from TradingView's screener. Use of this library is at your own risk and subject to TradingView's terms of service.\n\n# What's New in v0.2.0\n\n**MCP Server Integration** - This release adds Model Context Protocol (MCP) support, enabling AI assistants like Claude to query market data directly.\n\n### MCP Server for AI Assistants\n\n```bash\n# Install with MCP support\npip install tvscreener[mcp]\n\n# Run MCP server\ntvscreener-mcp\n\n# Register with Claude Code\nclaude mcp add tvscreener -- tvscreener-mcp\n```\n\n**MCP Tools:**\n- `discover_fields` - Search 3500+ available fields by keyword\n- `custom_query` - Flexible queries with any fields and filters\n- `search_stocks` / `search_crypto` / `search_forex` - Simplified screeners\n- `get_top_movers` - Get top gainers/losers\n\n---\n\n# What's New in v0.1.0\n\n**Major API Enhancement Release** - This release significantly expands the library with new screeners, 13,000+ fields, and a more intuitive API.\n\n### New Screeners\n- **BondScreener** - Query government and corporate bonds\n- **FuturesScreener** - Query futures contracts\n- **CoinScreener** - Query coins from CEX and DEX exchanges\n\n### Expanded Field Coverage\n- **13,000+ fields** across all screener types (up from ~300)\n- Complete technical indicator coverage with all time intervals\n- Fields organized by category with search and discovery methods\n\n### Pythonic Comparison Syntax\n```python\nfrom tvscreener import StockScreener, StockField\n\nss = StockScreener()\nss.where(StockField.PRICE > 50)\nss.where(StockField.VOLUME >= 1_000_000)\nss.where(StockField.MARKET_CAPITALIZATION.between(1e9, 50e9))\nss.where(StockField.SECTOR.isin(['Technology', 'Healthcare']))\ndf = ss.get()\n```\n\n### Fluent API\n```python\n# Chain methods for cleaner code\nss = StockScreener()\nss.select(StockField.NAME, StockField.PRICE, StockField.CHANGE_PERCENT)\nss.where(StockField.PRICE > 100)\ndf = ss.get()\n```\n\n### Field Presets\n```python\nfrom tvscreener import StockScreener, STOCK_VALUATION_FIELDS, STOCK_DIVIDEND_FIELDS\n\nss = StockScreener()\nss.specific_fields = STOCK_VALUATION_FIELDS + STOCK_DIVIDEND_FIELDS\n```\n\n### Type-Safe Validation\nThe library now validates that you're using the correct field types with each screener, catching errors early.\n\n---\n\n# Main Features\n\n- Query **Stock**, **Forex**, **Crypto**, **Bond**, **Futures**, and **Coin** Screeners\n- All the **fields available**: 13,000+ fields across all screener types\n- **Any time interval** (`no need to be a registered user` - 1D, 5m, 1h, etc.)\n- **Fluent API** with `select()` and `where()` methods for cleaner code\n- **Field discovery** - search fields by name, get technicals, filter by category\n- **Field presets** - curated field groups for common use cases\n- **Type-safe validation** - catches field/screener mismatches\n- Filters by any fields, symbols, markets, countries, etc.\n- Get the results as a Pandas Dataframe\n- **Styled output** with TradingView-like colors and formatting\n- **Streaming/Auto-update** - continuously fetch data at specified intervals\n\n## Installation\n\nThe source code is currently hosted on GitHub at:\nhttps://github.com/deepentropy/tvscreener\n\nBinary installers for the latest released version are available at the [Python\nPackage Index (PyPI)](https://pypi.org/project/tvscreener)\n\n```sh\n# or PyPI\npip install tvscreener\n```\n\nFrom pip + GitHub:\n\n```sh\n$ pip install git+https://github.com/deepentropy/tvscreener.git\n```\n\n## Usage\n\n### Basic Screeners\n\n```python\nimport tvscreener as tvs\n\n# Stock Screener\nss = tvs.StockScreener()\ndf = ss.get()  # returns a dataframe with 150 rows by default\n\n# Forex Screener\nfs = tvs.ForexScreener()\ndf = fs.get()\n\n# Crypto Screener\ncs = tvs.CryptoScreener()\ndf = cs.get()\n\n# Bond Screener (NEW)\nbs = tvs.BondScreener()\ndf = bs.get()\n\n# Futures Screener (NEW)\nfuts = tvs.FuturesScreener()\ndf = futs.get()\n\n# Coin Screener (NEW) - CEX and DEX coins\ncoins = tvs.CoinScreener()\ndf = coins.get()\n```\n\n### Fluent API\n\nUse `select()` and `where()` for cleaner, chainable code:\n\n```python\nfrom tvscreener import StockScreener, StockField\n\nss = StockScreener()\nss.select(\n    StockField.NAME,\n    StockField.PRICE,\n    StockField.CHANGE_PERCENT,\n    StockField.VOLUME,\n    StockField.MARKET_CAPITALIZATION\n)\nss.where(StockField.MARKET_CAPITALIZATION > 1e9)\nss.where(StockField.CHANGE_PERCENT > 5)\ndf = ss.get()\n```\n\n### Field Discovery\n\nSearch and explore the 13,000+ available fields:\n\n```python\nfrom tvscreener import StockField\n\n# Search fields by name or label\nrsi_fields = StockField.search(\"rsi\")\nprint(f\"Found {len(rsi_fields)} RSI-related fields\")\n\n# Get all technical indicator fields\ntechnicals = StockField.technicals()\nprint(f\"Found {len(technicals)} technical fields\")\n\n# Get recommendation fields\nrecommendations = StockField.recommendations()\n```\n\n### Field Presets\n\nUse curated field groups for common analysis needs:\n\n```python\nfrom tvscreener import (\n    StockScreener, get_preset, list_presets,\n    STOCK_PRICE_FIELDS, STOCK_VALUATION_FIELDS, STOCK_DIVIDEND_FIELDS,\n    STOCK_PERFORMANCE_FIELDS, STOCK_OSCILLATOR_FIELDS\n)\n\n# See all available presets\nprint(list_presets())\n# ['stock_price', 'stock_volume', 'stock_valuation', 'stock_dividend', ...]\n\n# Use presets directly\nss = StockScreener()\nss.specific_fields = STOCK_VALUATION_FIELDS + STOCK_DIVIDEND_FIELDS\ndf = ss.get()\n\n# Or get preset by name\nfields = get_preset('stock_performance')\n```\n\n**Available Presets:**\n| Category | Presets |\n|----------|---------|\n| Stock | `stock_price`, `stock_volume`, `stock_valuation`, `stock_dividend`, `stock_profitability`, `stock_performance`, `stock_oscillators`, `stock_moving_averages`, `stock_earnings` |\n| Crypto | `crypto_price`, `crypto_volume`, `crypto_performance`, `crypto_technical` |\n| Forex | `forex_price`, `forex_performance`, `forex_technical` |\n| Bond | `bond_basic`, `bond_yield`, `bond_maturity` |\n| Futures | `futures_price`, `futures_technical` |\n| Coin | `coin_price`, `coin_market` |\n\n### Time Intervals for Technical Fields\n\nApply different time intervals to technical indicators:\n\n```python\nfrom tvscreener import StockScreener, StockField\n\nss = StockScreener()\n\n# Get RSI with 1-hour interval\nrsi_1h = StockField.RELATIVE_STRENGTH_INDEX_14.with_interval(\"60\")\n\n# Available intervals: 1, 5, 15, 30, 60, 120, 240, 1D, 1W, 1M\nss.specific_fields = [\n    StockField.NAME,\n    StockField.PRICE,\n    rsi_1h,\n    StockField.MACD_LEVEL_12_26.with_interval(\"240\"),  # 4-hour MACD\n]\ndf = ss.get()\n```\n\n## Parameters\n\nFor detailed usage examples, see the documentation and notebooks below.\n\n## Styled Output\n\nYou can apply TradingView-style formatting to your screener results using the `beautify` function. This adds colored text for ratings and percent changes, formatted numbers with K/M/B suffixes, and visual indicators for buy/sell/neutral recommendations.\n\n```python\nimport tvscreener as tvs\n\n# Get raw data\nss = tvs.StockScreener()\ndf = ss.get()\n\n# Apply TradingView styling\nstyled = tvs.beautify(df, tvs.StockField)\n\n# Display in Jupyter/IPython (shows colored output)\nstyled\n```\n\nThe styled output includes:\n- **Rating columns** with colored text and directional arrows:\n  - Buy signals: Blue color with up arrow (↑)\n  - Sell signals: Red color with down arrow (↓)\n  - Neutral: Gray color with dash (-)\n- **Percent change columns**: Green for positive, Red for negative\n- **Number formatting**: K, M, B, T suffixes for large numbers\n- **Missing values**: Displayed as \"--\"\n\n## Streaming / Auto-Update\n\nYou can use the `stream()` method to continuously fetch screener data at specified intervals. This is useful for monitoring real-time market data.\n\n```python\nimport tvscreener as tvs\n\n# Basic streaming with iteration limit\nss = tvs.StockScreener()\nfor df in ss.stream(interval=10, max_iterations=5):\n    print(f\"Got {len(df)} rows\")\n\n# Streaming with callback\nfrom datetime import datetime\n\ndef on_update(df):\n    print(f\"Updated at {datetime.now()}: {len(df)} rows\")\n\nss = tvs.StockScreener()\ntry:\n    for df in ss.stream(interval=5, on_update=on_update):\n        # Process data\n        pass\nexcept KeyboardInterrupt:\n    print(\"Stopped streaming\")\n\n# Stream with filters\nss = tvs.StockScreener()\nss.set_markets(tvs.Market.AMERICA)\nfor df in ss.stream(interval=30, max_iterations=10):\n    print(df.head())\n```\n\n**Parameters:**\n- `interval`: Refresh in","default_branch":"main","files":114,"tree":[".dev/codegen/Generate FilterFields.ipynb",".dev/codegen/Generate.ipynb",".dev/codegen/code/country.py.generated",".dev/codegen/code/exchange.py.generated",".dev/codegen/code/index.py.generated",".dev/codegen/code/industry.py.generated",".dev/codegen/code/sector.py.generated",".dev/codegen/code/submarket.py.generated",".dev/codegen/code/symbol_type.py.generated",".dev/codegen/data/country.json",".dev/codegen/data/crypto.json",".dev/codegen/data/exchange.json",".dev/codegen/data/forex.json",".dev/codegen/data/index.json",".dev/codegen/data/industry.json",".dev/codegen/data/main.json",".dev/codegen/data/patterns.json",".dev/codegen/data/sector.json",".dev/codegen/data/stock.json",".dev/codegen/data/submarket.json",".dev/codegen/data/symbol type.json",".dev/codegen/data/time_intervals.json",".dev/codegen/generate.py",".github/img/dataframe.png",".github/img/logo.png",".github/img/tradingview-screener.png",".github/workflows/codecov.yml",".github/workflows/deploy-pages.yml",".github/workflows/pip-publish.yml",".gitignore","LICENSE","README.md","app/css/styles.css","app/index.html","app/js/app.js","app/js/code-generator.js","app/js/field-data.js","app/scripts/export_fields.py","docs/api/enums.md","docs/api/fields.md","docs/api/filters.md","docs/api/screeners.md","docs/changelog.md","docs/examples/crypto-strategies.md","docs/examples/stock-screening.md","docs/examples/technical-analysis.md","docs/getting-started/code-generator.md","docs/getting-started/installation.md","docs/getting-started/quickstart.md","docs/guide/filtering.md","docs/guide/selecting-fields.md","docs/guide/sorting-pagination.md","docs/guide/streaming.md","docs/guide/styled-output.md","docs/guide/time-intervals.md","docs/index.md","docs/notebooks/01-quickstart.ipynb","docs/notebooks/02-stocks.ipynb","docs/notebooks/03-crypto.ipynb","docs/notebooks/04-forex.ipynb","docs/notebooks/05-bonds-futures.ipynb","docs/screeners/bond.md","docs/screeners/coin.md","docs/screeners/crypto.md","docs/screeners/forex.md","docs/screeners/futures.md","docs/screeners/stock.md","docs/stylesheets/extra.css","mkdocs.yml","pyproject.toml","requirements.txt","tests/__init__.py","tests/functional/__init__.py","tests/functional/test_cryptoscreener.py","tests/functional/test_forexscreener.py","tests/functional/test_stockscreener.py","tests/unit/__init__.py","tests/unit/test_beauty.py","tests/unit/test_columns.py","tests/unit/test_field_conditions.py","tests/unit/test_fields.py","tests/unit/test_filters.py","tests/unit/test_sort_by.py","tests/unit/test_stream.py","tests/unit/test_ta.py","tests/unit/test_util.py","tvscreener/__init__.py","tvscreener/beauty.py","tvscreener/core/__init__.py","tvscreener/core/base.py","tvscreener/core/bond.py","tvscreener/core/coin.py","tvscreener/core/crypto.py","tvscreener/core/forex.py","tvscreener/core/futures.py","tvscreener/core/stock.py","tvscreener/exceptions.py","tvscreener/field/__init__.py","tvscreener/field/bond.py","tvscreener/field/coin.py","tvscreener/field/crypto.py","tvscreener/field/forex.py","tvscreener/field/futures.py","tvscreener/field/presets.py","tvscreener/field/stock.py","tvscreener/filter.py","tvscreener/mcp/__init__.py","tvscreener/mcp/__main__.py","tvscreener/mcp/server.py","tvscreener/mcp/tools.py","tvscreener/news.py","tvscreener/py.typed","tvscreener/ta/__init__.py","tvscreener/util.py"],"storefront":"/r/deepentropy","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/deepentropy/tvscreener/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}