# 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/tools/tradingview
- Handle: `@tradingview`
- Category: [Finance](https://fous.com/tools/category/finance)
- Source website: https://tradingview.com
- Last verified: Sep 29, 2026

## Methods

### Get technical rating

Operation `get_technical_rating`, version 1. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

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 completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.

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

Replace `YOUR_API_KEY` with a Fous API key. To create one, open Developers at the bottom of Fous Studio, turn on Developer mode, then go to API keys (https://app.fous.com/keys). Change the values in `input` to run the same tool on new data.

```bash
curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 180 \
  -H "Authorization: Bearer YOUR_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.
import json
import urllib.error
import urllib.request

api_key = "YOUR_API_KEY"

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=180) 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.
const apiKey = "YOUR_API_KEY";

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(180_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);
```

## Use from an AI assistant

Connect this tool to Claude Code, Claude Desktop, Cursor, VS Code, Codex and any MCP client as its own MCP server. Each method is a typed tool whose arguments are the method’s input.

- Server URL: `https://api.fous.com/mcp/tools/tradingview`
- Authorization: `Authorization: Bearer <Fous API key>`

**Tools**

- `get_technical_rating`: Get technical rating. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `screen_stocks`: Screen stocks. 1 credit per completed call. Failed calls without a completed billing receipt are free; completed work can remain charged if delivery is interrupted.
- `fous_get_run`: the result of a run that was still going, by its `request_id`. Free.

Claude Code:

```bash
claude mcp add --scope user --transport http fous-tradingview https://api.fous.com/mcp/tools/tradingview --header "Authorization: Bearer ${FOUS_API_KEY:?Set FOUS_API_KEY to your Fous API key}"
```

To give the assistant every tool, connect `https://api.fous.com/mcp`: it finds one with `fous_search_tools` and runs it with `fous_run_tool`. Setup for other clients: https://fous.com/llms-full.txt.

## 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

### Can I run it with my own inputs?

Yes. Change the inputs in Studio and press Run, or send new inputs from your code, or ask a connected AI assistant.

### Can I call this TradingView tool as an API?

Yes. Send a POST request to /v1/query with your Fous API key and the inputs, and get JSON back.

### How much does it cost?

Each completed run costs 1 credit. Failed runs without a completed receipt are free; completed work can remain charged if delivery is interrupted. 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. Some results are reused for up to 24 hours, and results that use your account or key are never reused. It was last verified 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/tools/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/tools/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/tools/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/tools/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/tools/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/tools/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/tools/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/tools/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 tools](https://fous.com/tools/category/finance)
