# TradingView API

> TradingView returns technical ratings and stock screener results as a workflow and API.

TradingView provides technical ratings for a stock, cryptocurrency, or currency pair, using the asset and optionally a timeframe as input. Screen stocks finds publicly listed stocks by country, with optional sector, company size, minimum dividend yield, result count, and sort order.

- Page: https://fous.com/workflows/tradingview
- Handle: `@tradingview`
- Category: [Finance](https://fous.com/workflows/category/finance)
- Source website: https://tradingview.com
- Last verified: Sep 29, 2026
- Fous is not affiliated with TradingView.

## Methods

### Get technical rating

Operation `get_technical_rating`, version 1. 1 credit per call.

Get TradingView buy, sell and neutral technical indicators for a stock, cryptocurrency or currency pair. Prices and signals can change and are not investment advice.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `asset` | string | yes | `"Apple"` | Stock, cryptocurrency, or currency pair name or symbol, such as Apple, Bitcoin, or EUR/USD. |
| `timeframe` | string | no | `"4_hours"` | Timeframe for the indicators, for example 4_hours. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "asset"
  ],
  "properties": {
    "asset": {
      "type": "string",
      "examples": [
        "Apple"
      ],
      "description": "Stock, cryptocurrency, or currency pair name or symbol, such as Apple, Bitcoin, or EUR/USD."
    },
    "timeframe": {
      "enum": [
        "1_hour",
        "4_hours",
        "1_day",
        "1_week",
        "1_month"
      ],
      "type": "string",
      "default": "1_day",
      "examples": [
        "4_hours"
      ],
      "description": "Timeframe for the indicators, for example 4_hours."
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "asset": "Apple"
    },
    {
      "asset": "Bitcoin",
      "timeframe": "4_hours"
    },
    {
      "asset": "NASDAQ:AAPL",
      "timeframe": "1_hour"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `name` | string | `"Apple Inc."` | Asset name. |
| `price` | number or null | `338.4` | Latest price for the selected timeframe. |
| `rsi_14` | number or null | `61.79237143352734` | Relative strength index (14). |
| `sma_20` | number or null | `330.33099999999996` | 20-period simple moving average. |
| `sma_50` | number or null | `321.92519999999996` | 50-period simple moving average. |
| `symbol` | string | `"AAPL"` | Trading symbol. |
| `sma_200` | number or null | `288.0726999999999` | 200-period simple moving average. |
| `currency` | string or null | `"USD"` | Currency of the price. |
| `exchange` | string | `"NASDAQ"` | Listing venue. |
| `buy_count` | integer | `14` | Number of buy indicators. |
| `timeframe` | string | `"1_day"` | Selected analysis timeframe. |
| `macd_level` | number or null | `6.07859989743406` | MACD level (12, 26). |
| `sell_count` | integer | `3` | Number of sell indicators. |
| `full_symbol` | string | `"NASDAQ:AAPL"` | TradingView exchange-prefixed symbol. |
| `neutral_count` | integer | `9` | Number of neutral indicators. |
| `overall_signal` | string | `"Buy"` | Summary signal. |
| `macd_signal_line` | number or null | `5.542018242890532` | MACD signal line. |
| `tradingview_link` | string | `"https://www.tradingview.com/symbols/NASDAQ-AAPL/technicals/"` | TradingView technicals page. |
| `oscillators_signal` | string or null | `"Neutral"` | Oscillators signal. |
| `overall_rating_score` | number or null | `0.4` | Raw summary score (-1 to 1). |
| `moving_averages_signal` | string or null | `"Strong buy"` | Moving averages signal. |
| `oscillators_rating_score` | number or null | `0` | Raw oscillators score (-1 to 1). |
| `moving_averages_rating_score` | number or null | `0.8` | Raw moving averages score (-1 to 1). |

**Example input**

```json
{
  "asset": "Apple"
}
```

**Example output**

```json
{
  "name": "Apple Inc.",
  "price": 338.4,
  "rsi_14": 61.79237143352734,
  "sma_20": 330.33099999999996,
  "sma_50": 321.92519999999996,
  "symbol": "AAPL",
  "sma_200": 288.0726999999999,
  "currency": "USD",
  "exchange": "NASDAQ",
  "buy_count": 14,
  "timeframe": "1_day",
  "macd_level": 6.07859989743406,
  "sell_count": 3,
  "full_symbol": "NASDAQ:AAPL",
  "neutral_count": 9,
  "overall_signal": "Buy",
  "macd_signal_line": 5.542018242890532,
  "tradingview_link": "https://www.tradingview.com/symbols/NASDAQ-AAPL/technicals/",
  "oscillators_signal": "Neutral",
  "overall_rating_score": 0.4,
  "moving_averages_signal": "Strong buy",
  "oscillators_rating_score": 0,
  "moving_averages_rating_score": 0.8
}
```

### Screen stocks

Operation `screen_stocks`, version 1. 1 credit per call.

Find publicly listed stocks in a country, filtered by sector, US-dollar market cap size, and minimum dividend yield, in the requested order. Technology includes electronic technology and technology services; quotes may be delayed.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `sort` | string | no | `"largest_first"` | Order stocks by market cap, daily gain, daily loss, or dividend yield, for example largest_first. |
| `sector` | string | no | `"Technology"` | TradingView stock sector, for example Technology, Finance, or Health Technology. |
| `country` | string | no | `"United States"` | Country of the stock exchange, for example United States or Canada. |
| `max_results` | integer | no | `5` | Maximum number of stocks to return, for example 20. |
| `company_size` | string | no | `"large"` | Market cap band: small under 2 billion, mid 2–10 billion, large over 10 billion, or any. |
| `minimum_dividend_yield_percent` | number | no | `2` | Minimum dividend yield as a percent, for example 3.5. |

**Input schema**

```json
{
  "type": "object",
  "properties": {
    "sort": {
      "enum": [
        "largest_first",
        "biggest_gainers",
        "biggest_losers",
        "highest_dividend"
      ],
      "type": "string",
      "default": "largest_first",
      "description": "Order stocks by market cap, daily gain, daily loss, or dividend yield, for example largest_first.",
      "examples": [
        "largest_first",
        "highest_dividend",
        "biggest_losers"
      ]
    },
    "sector": {
      "type": "string",
      "description": "TradingView stock sector, for example Technology, Finance, or Health Technology.",
      "examples": [
        "Technology",
        "Finance"
      ]
    },
    "country": {
      "type": "string",
      "default": "United States",
      "description": "Country of the stock exchange, for example United States or Canada.",
      "examples": [
        "United States",
        "Canada"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "description": "Maximum number of stocks to return, for example 20.",
      "x-fous-developer": true,
      "examples": [
        5,
        6
      ]
    },
    "company_size": {
      "enum": [
        "small",
        "mid",
        "large",
        "any"
      ],
      "type": "string",
      "default": "any",
      "description": "Market cap band: small under 2 billion, mid 2–10 billion, large over 10 billion, or any.",
      "examples": [
        "large",
        "small"
      ]
    },
    "minimum_dividend_yield_percent": {
      "type": "number",
      "minimum": 0,
      "description": "Minimum dividend yield as a percent, for example 3.5.",
      "examples": [
        2,
        100000
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "sort": "largest_first",
      "sector": "Technology",
      "country": "United States",
      "max_results": 5,
      "company_size": "large"
    },
    {
      "sort": "highest_dividend",
      "sector": "Finance",
      "country": "Canada",
      "max_results": 6,
      "company_size": "large",
      "minimum_dividend_yield_percent": 2
    },
    {
      "sort": "biggest_losers",
      "country": "United States",
      "max_results": 5,
      "company_size": "small"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `stocks` | array |  | Matching stocks in the selected order. |
| `stocks[].price` | number or null | `228.86` |  |
| `stocks[].sector` | string or null | `"Electronic technology"` |  |
| `stocks[].ticker` | string | `"NVDA"` |  |
| `stocks[].company` | string | `"NVIDIA Corporation"` |  |
| `stocks[].currency` | string or null | `"USD"` |  |
| `stocks[].exchange` | string | `"NASDAQ"` |  |
| `stocks[].pe_ratio` | number or null | `28.930801709099185` |  |
| `stocks[].market_cap` | number or null | `5515526179486.355` |  |
| `stocks[].tradingview_link` | string | `"https://www.tradingview.com/symbols/NASDAQ-NVDA/"` |  |
| `stocks[].change_percent_today` | number or null | `1.6839205580486163` |  |
| `stocks[].dividend_yield_percent` | number or null | `0.124405740436309` |  |

**Example input**

```json
{
  "sort": "largest_first",
  "sector": "Technology",
  "country": "United States",
  "max_results": 5,
  "company_size": "large"
}
```

**Example output**

```json
{
  "stocks": [
    {
      "price": 228.86,
      "sector": "Electronic technology",
      "ticker": "NVDA",
      "company": "NVIDIA Corporation",
      "currency": "USD",
      "exchange": "NASDAQ",
      "pe_ratio": 28.930801709099185,
      "market_cap": 5515526179486.355,
      "tradingview_link": "https://www.tradingview.com/symbols/NASDAQ-NVDA/",
      "change_percent_today": 1.6839205580486163,
      "dividend_yield_percent": 0.124405740436309
    },
    {
      "price": 338.4,
      "sector": "Electronic technology",
      "ticker": "AAPL",
      "company": "Apple Inc.",
      "currency": "USD",
      "exchange": "NASDAQ",
      "pe_ratio": 38.7926587415313,
      "market_cap": 4938670512304.597,
      "tradingview_link": "https://www.tradingview.com/symbols/NASDAQ-AAPL/",
      "change_percent_today": -0.7828305040021157,
      "dividend_yield_percent": 0.310786642038291
    },
    {
      "price": 339.16,
      "sector": "Technology services",
      "ticker": "GOOG",
      "company": "Alphabet Inc.",
      "currency": "USD",
      "exchange": "NASDAQ",
      "pe_ratio": 17.038678140997625,
      "market_cap": 4166856175744.328,
      "tradingview_link": "https://www.tradingview.com/symbols/NASDAQ-GOOG/",
      "change_percent_today": -0.5629177905476601,
      "dividend_yield_percent": 0.249208396857042
    }
  ]
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@tradingview",
  "visibility": "public",
  "operation": "get_technical_rating",
  "version": 1,
  "input": {
    "asset": "Apple"
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@tradingview\",\n  \"visibility\": \"public\",\n  \"operation\": \"get_technical_rating\",\n  \"version\": 1,\n  \"input\": {\n    \"asset\": \"Apple\"\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@tradingview",
  "visibility": "public",
  "operation": "get_technical_rating",
  "version": 1,
  "input": {
    "asset": "Apple"
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

Or describe the data in plain language: send `{"api":"@tradingview","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Compare buy, sell, and neutral indicator counts across assets.
- Review moving average and oscillator signals for selected assets.
- Find stocks by country, sector, and market capitalization.
- Identify stocks meeting a minimum dividend yield.
- Rank stocks by market cap, daily gain, daily loss, or dividend yield.

## FAQ

### Is Fous affiliated with TradingView?

No. Fous is not affiliated with TradingView. This workflow reads the public tradingview.com website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a TradingView account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from tradingview.com when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 29, 2026.

### What is the overall technical rating for an asset?

Use Get technical rating with an asset and, optionally, a timeframe to return the overall signal and indicator ratings.

### Which stocks meet my market cap and dividend criteria?

Use Screen stocks with a country and optional company size and minimum dividend yield to find matching stocks.

### Which stocks gained the most today?

Use Screen stocks and sort by daily gain to order matching stocks.

## Related

- [Finviz API](https://fous.com/workflows/finviz.md): Finviz provides delayed US stock snapshots, screening by company and trading criteria, and up to 200 recent public executive and director Form 4 trades.
- [Yahoo Finance API](https://fous.com/workflows/yahoo-finance.md): Yahoo Finance provides quotes, movers, company financials, analyst ratings, earnings, news, and up to 5,000 price rows with adjusted returns; prices may be delayed.
- [CompaniesMarketCap API](https://fous.com/workflows/companiesmarketcap.md): CompaniesMarketCap ranks public companies worldwide or by country and industry across size and financial measures, and provides company figures with market-cap history for completed years.
- [Stock Analysis API](https://fous.com/workflows/stock-analysis.md): Stock Analysis returns free-period company statements, statistics current as of its displayed date, typically top-25 ETF holdings, and US IPOs since 2019 with potentially missing prices or returns.
- [Trading Economics API](https://fous.com/workflows/trading-economics.md): Trading Economics provides economic indicators, market data and country statistics, including country overviews, latest reported country comparisons and current commodity prices reflecting reported trading days.
- [Google Finance API](https://fous.com/workflows/google-finance.md): Google Finance returns possibly delayed prices and figures, indexes, up to four movers timed by oldest quote, currency conversions, and up to five financial periods.
- [MSN Money API](https://fous.com/workflows/msn-money.md): MSN Money provides stock quotes, key facts, financial news, and market data, including current market movers; quotes and prices may be delayed.
- [Nasdaq API](https://fous.com/workflows/nasdaq.md): Nasdaq provides market activity, scheduled earnings by date with fiscal quarter-end month, monthly US IPO listings, and dated ex-dividend entries; dividend histories cover Nasdaq-listed stocks only.
- [All Finance workflows](https://fous.com/workflows/category/finance)
