# TradingView Screener Export (`saffron_discussion/tradingview-screener`) Actor

Multi-asset TradingView-style screener (stock, crypto, ETF, bond, CEX, DEX). Export filtered results to a dataset for automation.

- **URL**: https://apify.com/saffron\_discussion/tradingview-screener.md
- **Developed by:** [barry Alan](https://apify.com/saffron_discussion) (community)
- **Categories:** Developer tools, AI, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 screener results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## TradingView Screener Export

Run a **TradingView-style multi-asset screener** and write every hit to an Apify Dataset — ready for watchlists, quant screens, and scheduled jobs (Make / n8n / cron).

Powered by [TradingView Data API](https://www.tradingviewapi.com) (`POST /api/screener/…/scan`). **Not** official TradingView. **Not** a live quote stream: each run is a snapshot.

### What you get

One HTTP scan per run, then **one Dataset row per result**. You choose the asset class, market, how many rows to keep, and optional filters in the same JSON shape as the upstream screener.

Supported `assetType` values:

| `assetType` | Upstream path |
|-------------|---------------|
| `stock` | `/api/screener/scan` |
| `crypto` | `/api/screener/crypto/scan` |
| `etf` | `/api/screener/etf/scan` |
| `bond` | `/api/screener/bond/scan` |
| `cex` | `/api/screener/cex/scan` |
| `dex` | `/api/screener/dex/scan` |

Typical row fields (exact columns follow the upstream scan): `symbol`, `close`, `change`, `volume`, `market_cap_basic`, `price_earnings_ttm`, `sector`, `analystrating`, plus `assetType`, `market`, and `scrapedAt`.

### How to use

1. Set `assetType` (`stock` by default) and `market` (e.g. `america`, `crypto`).
2. Set `maxResults` (default 50, max **500**). This is how many rows you keep — it is not hardcoded to 5.
3. Optionally add `filters` (JSON). Example: market cap ≥ $10B.
4. Run, then export JSON / CSV / Excel or schedule the Actor.

Discover filter field ids, operations, and enums with:

`GET https://www.tradingviewapi.com/api/screener/filter-options?asset_type=stock`

#### Example — US large caps

```json
{
  "assetType": "stock",
  "market": "america",
  "maxResults": 25,
  "filters": {
    "market_cap_basic": { "operation": "greater_or_equal", "value": 10000000000 }
  }
}
```

### Input

| Field | Required | Description |
|-------|----------|-------------|
| `assetType` | yes | `stock` | `crypto` | `etf` | `bond` | `cex` | `dex` |
| `market` | yes | e.g. `america`, `brazil`, `crypto` |
| `maxResults` | no | 1–500 (default 50) |
| `filters` | no | JSON object; same shape as the Data API screener |

No user API key is required. Credentials are stored on the Actor.

### Pricing (pay per event)

| Event | When |
|-------|------|
| `screener-run` | Once per Actor run (the scan itself) |
| `screener-result` | Once per Dataset row pushed |

A 50-row scan ⇒ 1× `screener-run` + 50× `screener-result`. Raise `maxResults` only as far as you need; extra rows cost extra.

### Limits and notes

- Snapshot only — prices can move after the run.
- Result columns are whatever the upstream screener returns for that asset type.
- Filter syntax: comparison object `{ "operation": "greater_or_equal", "value": n }`, arrays for multi-select, scalars for equality.
- Not investment advice. Unofficial wrapper around [TradingView Data API](https://www.tradingviewapi.com).

### Related Actors

- [Fundamentals Card](https://apify.com/saffron_discussion/tradingview-fundamentals)
- [Leaderboard Snapshot](https://apify.com/saffron_discussion/tradingview-leaderboard)
- [Quote + TA Batch](https://apify.com/saffron_discussion/tradingview-quote-ta)
- [News & Calendar Digest](https://apify.com/saffron_discussion/tradingview-news-calendar)

# Actor input Schema

## `assetType` (type: `string`):

Asset type

## `market` (type: `string`):

e.g. america, brazil, crypto

## `maxResults` (type: `integer`):

Max results

## `filters` (type: `object`):

Screener filters. Discover fields via GET /api/screener/filter-options.

## `apiKey` (type: `string`):

API key override

## Actor input object example

```json
{
  "assetType": "stock",
  "market": "america",
  "maxResults": 50
}
```

# Actor output Schema

## `results` (type: `string`):

Default dataset with screener matches.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "assetType": "stock",
    "market": "america"
};

// Run the Actor and wait for it to finish
const run = await client.actor("saffron_discussion/tradingview-screener").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "assetType": "stock",
    "market": "america",
}

# Run the Actor and wait for it to finish
run = client.actor("saffron_discussion/tradingview-screener").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "assetType": "stock",
  "market": "america"
}' |
apify call saffron_discussion/tradingview-screener --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,saffron_discussion/tradingview-screener"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/OhWQZH1CqTVzr2nVK/builds/TVimbDqhZ82QdnAE7/openapi.json
