Playground Sign in Start free
News and finance · tradingview.com

How to scrape TradingView

TradingView (tradingview.com) is a news and finance site. This guide is built from our own checks of its public pages: what the pages contain, whether our requests get through right now, and the request settings that worked.

Ujeebu scrapes any public website. Not listed here? Try any URL in the Playground or ask us about a site.

Working 1 credit a page, about $0.10 per 1,000 on Pro

21 of 21 of our checks passed in the last 7 days (100%).

Last check 2026-11-22 20:31 UTC · last pass 2026-11-22 20:31 UTC · checked with our own requests, never customer data.

Try it in the Playground

Recipe one call

Use the TradingView recipe: send the URL, get JSON

1 credit a page
curl -G 'https://api.ujeebu.com/scrape' \
  -H "ApiKey: $UJEEBU_API_KEY" \
  --data-urlencode 'url=https://www.tradingview.com/symbols/NASDAQ-TSLA/' \
  --data-urlencode 'recipe=tradingview'

The answer is {"result": {...}} with the fields of the recipe. Billed like any /scrape call: successful responses cost credits; blocked, timed-out and failed requests are free.

Run the code on this page with your own key: 5,000 free credits for 7 days, no card. Get a free API key →

Recipe

Call the recipe by name with the recipe parameter: the Scrape API applies its extract rules and the settings that work on TradingView. Each recipe was run on two real TradingView pages and keeps only the fields that came back on both; it is checked again every week, and hidden if it stops working.

Public pages

Validated 2026-11-14

One call: recipe=tradingview 1 credit a page

curl -G 'https://api.ujeebu.com/scrape' \
  -H "ApiKey: $UJEEBU_API_KEY" \
  --data-urlencode 'url=https://www.tradingview.com/symbols/NASDAQ-TSLA/' \
  --data-urlencode 'recipe=tradingview'

The answer is {"result": {...}} with the fields below; the Ujb-Recipe header names the version (for example tradingview/page@v1) and Ujb-Credits the cost.

What this recipe extracts

FieldTypeExample
dataset.descriptiontextHistorical and real-time Tesla, Inc. stock price data from NASDAQ w...
dataset.nametextTSLA price data
imageimage URLhttps://s3-symbol-logo.tradingview.com/tesla--600.png
urlURLhttps://www.tradingview.com/symbols/NASDAQ-TSLA/
quote.betanumber (as text)1.82
quote.currencytextUSD
quote.epstext1.00 USD
quote.exchangetextNASDAQ
quote.market_captext1.52 T USD
quote.nametextTesla, Inc.
quote.net_incometext3.79 B USD
quote.pe_rationumber (as text)444.20
quote.pricenumber (as text)359.63
quote.revenuetext94.83 B USD
quote.shares_floattext2.82 B
quote.symboltextTSLA

Examples from www.tradingview.com/symbols/NASDAQ-TSLA/ on 2026-11-14, shortened.

Sample output (real, trimmed)

{
    "quote": {
        "beta": "1.82",
        "currency": "USD",
        "eps": "1.00 USD",
        "exchange": "NASDAQ",
        "market_cap": "1.52 T USD",
        "name": "Tesla, Inc.",
        "net_income": "3.79 B USD",
        "pe_ratio": "444.20",
        "price": "359.63",
        "revenue": "94.83 B USD",
        "shares_float": "2.82 B",
        "symbol": "TSLA"
    },
    "dataset": {
        "description": "Historical and real-time Tesla, Inc. stock price data from NASDAQ with charts, trends, and key market metrics.",
        "name": "TSLA price data"
    },
    "image": "https://s3-symbol-logo.tradingview.com/tesla--600.png",
    "url": "https://www.tradingview.com/symbols/NASDAQ-TSLA/"
}
extract_rules (4 rules): the rules behind the recipe

The API applies these rules and the settings js=false for you when you send recipe=tradingview. To change what comes back, send your own extract_rules (they replace the recipe's) or any setting (yours always win). Sites without a recipe work the same way with extract rules.

{
    "dataset": {
        "type": "fn",
        "fn": "const T = ['Dataset']; const n = [...document.querySelectorAll('script[type=\"application/ld+json\"]')].flatMap(s => { try { return [].concat(JSON.parse(s.textContent)).flatMap(x => x['@graph'] || [x]); } catch (e) { return []; } }).find(x => x && [].concat(x['@type']).some(t => T.includes(t))); if (!n) return null; const g = p => p.split('|').map(q => q.split('.').reduce((v, k) => v == null ? v : (Array.isArray(v) ? v[0] : v)?.[k], n)).find(v => v != null && v !== ''); const all = v => Array.isArray(v) ? v.map(all).filter(x => x != null).join(', ') : (v && typeof v === 'object' ? (v.name ?? v['@id'] ?? null) : (typeof v === 'string' ? v.replace('https://schema.org/', '').replace('http://schema.org/', '') : v ?? null)); const one = v => all(Array.isArray(v) ? v[0] : v); return { description: all(g('description')), name: all(g('name')) };"
    },
    "image": {
        "selector": "meta[property=\"og:image\"]",
        "type": "attr",
        "attribute": "content"
    },
    "url": {
        "selector": "link[rel=\"canonical\"]",
        "type": "attr",
        "attribute": "href"
    },
    "quote": {
        "type": "fn",
        "fn": "const __r = (() => { const ld = [...document.querySelectorAll('script[type=\"application/ld+json\"]')].flatMap(s => { try { return [].concat(JSON.parse(s.textContent)); } catch (e) { return []; } }); const fp = ld.find(x => x && x['@type'] === 'FinancialProduct'); const faq = ld.find(x => x && x['@type'] === 'FAQPage'); let price = null, cur = null; if (faq) for (const q of [].concat(faq.mainEntity || [])) { const t = q && q.acceptedAnswer ? String(q.acceptedAnswer.text || '') : ''; const m = t.match(/trades at ([\\d.,]+)\\s*([A-Z]{3})/); if (m) { price = m[1]; cur = m[2]; break; } } const ks = {}; document.querySelectorAll('[data-container-name=\"key-stats-id\"] [class*=\"block-\"]').forEach(b => { const l = b.querySelector('[class*=\"label-\"]'); const v = b.querySelector('[class*=\"value-\"]'); if (l && v && !ks[l.textContent.trim()]) { const c = v.cloneNode(true); c.querySelectorAll('[class*=\"badge-\"]').forEach(x => x.remove()); const t = c.textContent.replace(/[\\u202a\\u202c\\u00a0]/g, ' ').replace(/\\s+/g, ' ').trim(); if (t && t !== '\\u2014') ks[l.textContent.trim()] = t; } }); const k = re => { const x = Object.keys(ks).find(n => re.test(n)); return x ? ks[x] : null; }; const pm = location.pathname.match(/\\/symbols\\/([A-Z0-9_]+)-([A-Z0-9._!]+)\\//i) || (document.querySelector('link[rel=\"canonical\"]') || { href: '' }).href.match(/\\/symbols\\/([A-Z0-9_]+)-([A-Z0-9._!]+)\\//i); if (!price && !Object.keys(ks).length) return null; const out = { symbol: pm ? pm[2] : null, name: fp ? fp.name : null, exchange: pm ? pm[1] : null, currency: cur, price: price, market_cap: k(/^market cap/i), dividend_yield: k(/^dividend yield/i), pe_ratio: k(/^price to earnings/i), eps: k(/^basic eps/i),  beta: k(/^beta/i), shares_float: k(/^shares float/i), revenue: k(/^revenue \\(fy\\)/i), net_income: k(/^net income \\(fy\\)/i), change_1y: k(/^change \\(1y\\)/i), next_report_date: k(/^next report date/i), eps_estimate: k(/^eps estimate/i), employees: k(/^employees/i),  sector: k(/^sector/i), industry: k(/^industry/i), website: k(/^website/i), headquarters: k(/^headquarters/i), founded: k(/^founded/i), isin: k(/^isin/i) }; let s = null; for (const e of document.querySelectorAll('script[type=\"application/prs.init-data+json\"]')) { try { const j = JSON.parse(e.textContent); for (const v of Object.values(j)) { const c = v && v.data && v.data.symbol; if (c && c.pro_symbol && c.daily_bar) { s = c; break; } } } catch (x) {} if (s) break; } if (s) { const b = s.daily_bar; out.open = b.open || null; out.day_range = b.low && b.high ? b.low + ' - ' + b.high : null; out.volume = b.volume || null; const t = +(b.update_time || 0); out.updated_at = t ? new Date(t * 1000).toISOString() : null; } return out; })(); if (!__r) return null; const __o = {}; for (const k of [\"beta\",\"currency\",\"eps\",\"exchange\",\"market_cap\",\"name\",\"net_income\",\"pe_ratio\",\"price\",\"revenue\",\"shares_float\",\"symbol\"]) if (__r[k] !== undefined && __r[k] !== null) __o[k] = __r[k]; return __o;"
    }
}

Code

Complete scripts: set the UJEEBU_API_KEY environment variable and run them as they are. Each one calls the recipe by name (the Go SDK has no recipe field, so the Go script sends the recipe's rules and settings itself), prints the extracted JSON, and prints the credits the request cost (the Ujb-Credits response header) on stderr. A non-200 answer stops the script with the API's error message.

Public pages

Runs the recipe on the two pages it was validated on, one after the other.

tradingview_page_sdk.py pip install ujeebu-python==0.1.5
# Scrape TradingView public pages with the Ujeebu Scrape API.
# Calls the recipe tradingview: the API applies its extract rules and validated settings (validated 2026-11-14). Send extract_rules or any setting to override them.
# Uses the official SDK ujeebu-python 0.1.5: pip install ujeebu-python==0.1.5
# Run: UJEEBU_API_KEY=your_key python3 tradingview_page_sdk.py

import json
import os
import sys
import time

import requests
from ujeebu_python import UjeebuClient

API_KEY = os.environ.get("UJEEBU_API_KEY")
URLS = [
    "https://www.tradingview.com/symbols/NASDAQ-TSLA/",
    "https://www.tradingview.com/symbols/NYSE-JPM/",
]
RECIPE = "tradingview"  # rules and settings come from the recipe; add your own to override them


def scrape(client, url):
    # a GET with recipe=: the API applies the recipe and answers {"result": {...}}
    try:
        response = client.scrape(url, params={"recipe": RECIPE})
    except requests.RequestException as error:
        sys.exit(f"Request failed for {url}: {error}")
    if response.status_code != 200:
        try:
            message = response.json().get("message", response.text)
        except ValueError:
            message = response.text
        sys.exit(f"HTTP {response.status_code} for {url}: {str(message)[:300]}")
    print(f"Ujb-Credits: {response.headers.get('Ujb-Credits')}, Ujb-Recipe: {response.headers.get('Ujb-Recipe')}", file=sys.stderr)
    return response.json()["result"]


if not API_KEY:
    sys.exit("Set the UJEEBU_API_KEY environment variable.")

client = UjeebuClient(api_key=API_KEY)

for i, url in enumerate(URLS):
    if i:
        time.sleep(2)  # be polite: one page at a time
    result = scrape(client, url)
    quote = result.get("quote") or {}
    print(quote.get("symbol"), quote.get("price"), quote.get("market_cap"), quote.get("pe_ratio"))
    # Example output: TSLA 359.63 1.52 T USD 444.20
    # every field: print(json.dumps(result, indent=2, ensure_ascii=False))

SDK tabs use the official Ujeebu SDKs (ujeebu-python 0.1.5, @ujeebu-org/ujeebu-sdk 0.1.2, github.com/ujeebu/ujeebu-go v0.1.8); there is no PHP SDK, so the PHP tab calls the API with curl. For agents and scripts, the same status and settings are at /scrape/tradingview.json.

Try it yourself

Run this on TradingView with your own key

Get a free API key, set UJEEBU_API_KEY and run any script above as it is. 5,000 free credits for 7 days, no card.

URL patterns and pagination

What the URLs look like, read from the pages our checks fetched.

Public pages

Pattern
https://www.tradingview.com/symbols/{slug}/
Validated on
https://www.tradingview.com/symbols/NASDAQ-TSLA/https://www.tradingview.com/symbols/NYSE-JPM/

Settings that work today

From our health checks over the last 7 days: the cheapest settings that return the real page most of the time.

Endpoint/scrape
jstrue
Costup to 5 credits a request

Each public page is one request: change the path in the URL to fetch another one. Our checks run with JavaScript rendering on (js=true): keep it on.

Try it in the Playground

What people build with TradingView data

  • Media monitoringTrack the articles published on the topics and companies you follow.More on this use case
  • Content for AI and RAGCollect headlines, dates and summaries as structured input for search and LLM pipelines.More on this use case

Limits and etiquette

  • Public pages only. Pages behind a login, and data shown only to signed-in users, are out of scope.
  • Keep the rate modest: fetch pages one after another or with low concurrency, and cache what you already have.
  • robots.txt of www.tradingview.com (read 2026-11-17): public pages allowed for generic crawlers; no crawl delay set.
  • Read TradingView's terms of service before you collect data at scale, and do not collect personal data you have no basis to process. This guide is not legal advice.

Questions

Can you scrape TradingView with Ujeebu?

Yes. 21 of 21 checks of public TradingView pages passed in the last 7 days with the settings on this page.

Which settings work for TradingView?

Call /scrape with js=true.

How many credits does a TradingView request cost?

With these settings a request costs up to 5 credits. Only responses with HTTP 200 or 404 are billed: a blocked or timed-out request is free.

Which fields can I extract from TradingView?

With the extraction recipes on this page, validated on real TradingView pages through our API: public pages: description, name, image, url, beta, currency, eps, exchange, market_cap, net_income, pe_ratio, price. Pass the recipe as extract_rules in a POST to /scrape and the API returns those fields as JSON.

Is it allowed to scrape TradingView?

Its robots.txt allows generic crawlers on the page types in this guide. Collect public pages only, read TradingView's terms of service, keep your request rate modest and do not collect personal data you have no basis to process. This is not legal advice.

How fresh is this page?

The status and settings come from our own health checks of tradingview.com, which run around the clock. Last check: 2026-11-22 20:31:54 UTC; last pass: 2026-11-22 20:31:54 UTC.