Logo de «2Captcha»Para a página inicial
Tutoriais de Captcha Bypass

Isso foi útil?

How to scrape TipRanks

Gregory Fisher
Gregory Fisher

Technical engineer

TipRanks (tipranks.com) collects what Wall Street analysts, insiders, hedge funds, bloggers and retail investors think about a stock and boils it down to one page per ticker. That page shows the Smart Score from 1 to 10, the analyst consensus (Buy, Hold or Sell), the average, high and low price targets, and a lot more: dividends, upcoming earnings, insider and hedge fund activity, news sentiment. If you follow a watchlist, it's a convenient way to see how sentiment and targets change over time.

The page itself is guarded. Cloudflare sits in front of tipranks.com, and on 2026-10-19 it challenged the ticker page with "Just a moment…" from a home IP, a VPN and a residential proxy alike. But the page loads its data from a JSON file at the same address, and that file answered 200 from all three. That's the whole trick of this scraper: it never opens the page and reads the JSON directly.

This guide uses the open-source TipRanks scraper from the 2scraper project. It takes a list of tickers and writes one row per ticker to JSON or CSV, with no account or login. The figures below come from the project's README, changelog and testing notes, each with the date it was measured.

What you get

One row per ticker, 63 columns. The main groups:

Group Fields
Smart Score smart_score (1 to 10), smart_score_updated
Analyst consensus consensus_rating_id (e.g. moderateBuy), consensus_rating_label (Moderate Buy), analyst_count, buy_count, hold_count, sell_count
Price targets price_target_average, price_target_high, price_target_low, price_target_upside (a fraction: -0.018 is -1.8%)
Best Performing Analysts The same set with a best_ prefix, for TipRanks' smaller group of top-rated analysts. Never mixed with the main figures
Price current_price, current_price_asof, current_price_source. Usually the last trading day's close, not a live quote
Dividends Latest dividend amount, dates, frequency, yield and payout ratio, plus the next one once it's declared
Earnings Last earnings date, EPS and estimate; next earnings date, time (PreMarket, AfterHours) and estimates
Insiders and hedge funds Sentiment, signal (0 to 1), insider net dollars, hedge funds' net change in shares
Retail investors Sentiment and the 7-day and 30-day change in TipRanks portfolios holding the stock
News and bloggers News sentiment and score, bullish ratio, article counts; blogger sentiment, bullish ratio and number of opinions
Other ticker, company_name, currency, source_url, scraped_at

Sentiment values are TipRanks' own: veryNegative, negative, neutral, positive, veryPositive. Fractions stay fractions (0.025 is 2.5%), and dates are the site's ISO strings. On the whole S&P 500 on 2026-10-20, dividends were filled for 414 of 503 tickers, earnings dates for 502, hedge funds for 502, insiders for 268, news sentiment for 491 and bloggers for 503.

Any of the analyst fields can be empty. Some tickers have a price target with no buy, hold or sell breakdown, and some have no analyst coverage at all (GME, for one). That's how the site publishes them, not a parser bug.

What you need

  • Python 3.9 or newer.
  • Playwright with Chromium, the recommended engine. Selenium and pyppeteer versions give identical output with the same flags.
  • One virtual environment per engine; their pinned versions don't all fit together.
  • Nothing paid for a normal run. A proxy, the 2Captcha Browser API and the Scraper API are opt-in fallbacks if Cloudflare starts refusing you.

Installation

bash Copy
git clone https://github.com/2scraper/tipranks-scraper.git
cd tipranks-scraper
python3 -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

pip install -r requirements-playwright.txt
playwright install chromium

cp .env.example .env

Leave .env empty for a first run. TWOCAPTCHA_KEY, TIPRANKS_PROXY and TIPRANKS_CDP_ENDPOINT go there later if you need them, never on the command line.

First run

bash Copy
# One ticker
python3 playwright_scraper.py --ticker AAPL --out results.json

# Several tickers, CSV
python3 playwright_scraper.py --ticker AAPL --ticker MSFT --ticker TSLA --format csv --out stocks.csv

# A watchlist file: one ticker per line, blank lines and # comments are skipped
python3 playwright_scraper.py --tickers-file watchlist.txt --out watchlist.json

Defaults are --format json and an output file called tipranks_results.json. Tickers with a dot work (BRK.B was checked live); a dash in a symbol and non-USD tickers haven't been tested. --headed opens a visible browser if you want to watch what happens.

How the scraper works

Straight to payload.json

The ticker page, www.tipranks.com/stocks/{ticker}/stock-analysis, is rendered in the browser from a JSON file at .../stock-analysis/payload.json. Every engine goes straight to that file and reads the same data the page would show, with no CSS selectors anywhere.

This matters because the two addresses are treated differently. Up to version 0.3, the scraper opened the ticker page first, and on 2026-10-19 Cloudflare challenged it from a home IP behind a VPN, from a residential proxy, with or without a browser fingerprint. After version 0.4.0 switched to payload.json, the same "burnt" VPN address collected all tickers on all three engines, and Playwright fetched 30 of 30 tickers in 11 seconds.

What's in front of the site

The response headers show two layers. Fastly caches the HTML page for up to 24 hours and payload.json for up to 5 minutes, which is why a price can lag a little behind what you see on the site. Cloudflare handles bot management: its fingerprinting script loads on every page, and a Google reCAPTCHA script is present too, though it isn't rendered. No other bot-protection vendor was found.

In the project's early research, about 20 tickers and 35 requests all came back as clean 200s. Later, an audit run got a real Cloudflare JS challenge on the ticker page after an earlier run from the same machine had worked, so it reacts to behaviour, not just to the first request. And GitHub Actions' datacenter addresses were refused on every scheduled run from 2026-10-01 to 2026-10-15. The project's canary still tries the runner's own IP and treats a refusal there as expected.

No rate limits seen

On 2026-10-20 the whole S&P 500, 503 tickers, was scraped three times back to back from one home IP with Playwright: about 1,500 requests in 8 minutes, one ticker after another with no pause. All three runs returned 503 of 503 with exit 0 and no 403 or 429, each in 125 to 165 seconds. Running several engines or machines in parallel wasn't tested.

Blocks and paid options

For a normal run from a home connection you don't need anything paid. If Cloudflare starts refusing you, or you run from a server, there are four opt-in tools.

Proxies

Pass --proxy, --proxy-file or TIPRANKS_PROXY. A run uses one proxy for all tickers; a per-ticker JSON fetch doesn't carry the volume that rotation is built for. The exception is a dead proxy: then the browser restarts on the next proxy in the file and fetches the same ticker again. 2Captcha residential proxies work here, and the Proxy API generates lists.

Proxies are billed by traffic, so the scraper saves where it can. Before starting a browser it sends one test request through the proxy, and a 407 or 402 (wrong credentials or no balance) ends the run in seconds with exit 5 instead of a string of timeouts. Through a proxy it doesn't download images, video or fonts (--load-media turns them back on). And it stops at 10 MB of proxy traffic by default (--proxy-budget-mb, 0 for no cap), keeping what it has and exiting with 6. Selenium can't use a proxy with a password and strips the credentials with a warning.

2Captcha Browser API

Browser API (--cdp-endpoint) gives you a remote browser with its own IP and device identity, and turns on its built-in captcha auto-solve. On 2026-10-19 Playwright and pyppeteer over the Browser API completed runs for AAPL, MSFT, NVDA, GME, LUV and BRK.B. Selenium can't connect to an endpoint with credentials.

A stored connection string doesn't last forever: one was accepted on October 19 and 20 and refused with 401 deny_no_user on October 21. The repository's tools/browser_endpoint.py fetches a fresh one from your account and writes it into .env:

bash Copy
python3 tools/browser_endpoint.py --account-id 1581

It reads TWOCAPTCHA_KEY from .env, never from the command line, and prints only the host and port. Setup is in the Browser API docs.

Scraper API

--scraper-api sends one browserless request per ticker to the 2Captcha Scraper API instead of launching a browser. It also fetches payload.json, and on 2026-10-19 its result matched what the browsers read. It needs a 2Captcha key. With --scraper-api-cdp the request goes through your own Browser API session instead of the shared pool, with --scraper-api-country and --scraper-api-profile-id to choose the country and profile.

Captcha and fingerprints

No captcha widget has ever been seen on TipRanks. The one real block was Cloudflare's "Just a moment…" page, a browser check rather than a puzzle, and the scraper doesn't solve it; it avoids it by going to payload.json. The captcha code is there in case that changes, with at most one paid solve per ticker. --fingerprint applies a profile from the Fingerprint API, but in the October 19 test it didn't get past the ticker page reliably, which is part of why the scraper switched to payload.json.

Output files and exit codes

Each run writes the results and a .meta.json sidecar with the status, stop reason, failed tickers and the number of escaped CSV cells. Files are replaced atomically, and the sidecar carries a checksum of the output that diff_runs.py checks. A run where every ticker came back empty writes nothing unless you pass --allow-empty, so it can't overwrite a good file. In the CSV, cells starting with =, +, -, @, a tab or a line break get a leading apostrophe.

Code Meaning
0 Complete
1 Crash
2 Bad usage, e.g. no tickers given
3 Blocked: every failure was a real 403 or 429 or Cloudflare's challenge page
4 Zero results: every ticker answered "not found"
5 No rows obtained: a network failure, a refused proxy or balance, the traffic cap spent before any row, or a payload the parser couldn't read
6 Partial: some tickers failed, or the traffic cap stopped the run

When a run fails completely, the code tells you why. 3 means the site actively refused you. 5 means the network or the engine broke. 4 means the site was reachable and had nothing for those tickers.

Traps that look like bugs

  • An unknown ticker isn't a failure. TipRanks answers it with a real 404 or 400, and the scraper records it as a completed ticker with zero rows. On 2026-10-19 ZZZZINVALID completed this way.
  • A payload without the ticker is a failure. If the JSON arrives but no longer contains the ticker's record, it's listed under parser_failed_tickers. A change in the page's shape is never reported as "this ticker doesn't exist".
  • Analyst fields are empty for some stocks. Some tickers have no analyst coverage or no buy/hold/sell breakdown. GME is one.
  • current_price isn't live. It's usually the last trading day's close, the same price TipRanks uses for price_target_upside. Fastly's 5-minute cache can add a small lag.
  • best_ fields differ from the main ones. They cover TipRanks' smaller group of top-rated analysts, so their counts and averages are different by design.
  • A suspended dividend keeps its last values. GME still shows its 2019 dividend with an empty yield. Check dividend_ex_date before you treat a stock as a payer.
  • pyppeteer crashes on Apple Silicon. Its bundled Chromium segfaults there. The engine now finds an installed Chrome on its own, or pass --executable-path.

Comparing runs

bash Copy
python3 diff_runs.py monday.json tuesday.json

diff_runs.py compares two complete runs and lists added and removed tickers and, per ticker, changes in rating, price target and Smart Score. It refuses files whose checksum doesn't match their sidecar. Small price target moves between runs a few minutes apart are normal, because of Fastly's cache. --fail-on-change makes it exit with an error when something changed, for a cron job that should only alert you then.

A sample row

The repository's sample_output.json, captured on 2026-10-20 (selected fields out of 63):

json Copy
{
  "ticker": "AAPL",
  "source_url": "https://www.tipranks.com/stocks/aapl/stock-analysis",
  "scraped_at": "2026-10-20T12:14:21.858402+00:00",
  "company_name": "Apple",
  "currency": "USD",
  "smart_score": 7,
  "consensus_rating_id": "moderateBuy",
  "consensus_rating_label": "Moderate Buy",
  "analyst_count": 32,
  "buy_count": 16,
  "hold_count": 12,
  "sell_count": 4,
  "price_target_average": 337.17923076923074,
  "price_target_high": 400,
  "price_target_low": 245,
  "price_target_upside": -0.016798184028602673,
  "best_analyst_count": 24,
  "best_price_target_average": 336.718947368421,
  "current_price": 342.94,
  "current_price_asof": "2026-10-19T00:00:00.000Z",
  "current_price_source": "daily",
  "dividend_yield": 0.0031529322563209417,
  "next_earnings_date": "2026-11-02T00:00:00.000Z",
  "next_earnings_time": "AfterHours",
  "hedge_fund_sentiment": "negative",
  "hedge_fund_net_shares": -3422392,
  "news_sentiment": "positive",
  "news_bullish_ratio": 0.7764094143404489,
  "blogger_opinion_count": 369
}

A Moderate Buy from 32 analysts, yet the average target of $337.18 sat below the last close of $342.94, which is the -1.7% in price_target_upside. Hedge funds were selling while news coverage was mostly positive. That kind of disagreement between groups is what the extra columns are for.

Using the results: screen a watchlist

A simple screen: stocks with a high Smart Score, enough analysts, real upside to the target and positive news.

python Copy
import json

rows = json.load(open("watchlist.json", encoding="utf-8"))

picks = []
for r in rows:
    if (r.get("smart_score") or 0) < 8:
        continue
    if (r.get("analyst_count") or 0) < 10:
        continue
    if (r.get("price_target_upside") or 0) < 0.05:
        continue
    if r.get("news_sentiment") not in ("positive", "veryPositive"):
        continue
    picks.append(r)

picks.sort(key=lambda r: r["price_target_upside"], reverse=True)
for r in picks:
    best = r.get("best_price_target_average")
    best_note = f", top analysts ${best:,.2f}" if best else ""
    print(f"{r['ticker']:<6} score {r['smart_score']}, {r['consensus_rating_label']}, "
          f"{r['analyst_count']} analysts, upside {r['price_target_upside']:.1%}, "
          f"target ${r['price_target_average']:,.2f}{best_note}")

The output file is always a list of rows, even for one ticker. The analyst_count filter matters: a target from two analysts says much less than one from thirty. And comparing the main target with the best_ one shows whether TipRanks' top-rated analysts are more or less optimistic than everyone else.

Limitations

  • Only the ticker forecast page. No screeners, stock lists, options chains or per-transaction insider and hedge fund lists.
  • current_price is the last close, not a real-time quote.
  • Cloudflare challenges the ticker page; if it ever puts payload.json behind the same check, local runs will exit 3 and you'll need the Browser API.
  • No captcha widget has been seen, so the captcha code is untested on this site.
  • Non-USD tickers and symbols with a dash haven't been tested.
  • Parallel runs from several machines weren't tested.

Common questions

Do I need a TipRanks account?
No. The scraper reads the free, public forecast data with no login.

Do I need a proxy?
Not from a home connection. Datacenter addresses were refused, so on a server use a residential proxy or the Browser API.

How many tickers can I scrape?
The whole S&P 500 ran three times in a row from one home IP with no errors, about 2 to 3 minutes per run.

Why is the price slightly different from the site?
current_price is the last trading day's close, and Fastly caches the data for up to 5 minutes.

What are the best_ fields?
The same consensus and price target, but only for TipRanks' Best Performing Analysts, a smaller group than all analysts.

Is it legal to scrape TipRanks?
The scraper reads public pages without logging in, and the path it uses isn't disallowed in TipRanks' robots.txt, which it re-checks at runtime. Whether your use is allowed depends on your jurisdiction and TipRanks' terms, so check both. This isn't legal advice, and the data isn't investment advice either.

Wrapping up

TipRanks guards its page and leaves the data behind it open. Read payload.json, as this scraper does, and a watchlist of hundreds of tickers takes a couple of minutes. Just remember that the price is yesterday's close and that a target from a handful of analysts is worth less than it looks.

Getting started: clone the repository and run it from your own computer with no setup. For a server, sign up for 2Captcha and add residential proxies or the 2Captcha Browser API.

Source code

Documentation