# Stock Data Scraper — Stats, Financials, History & IPOs (`yugenox/stockanalysis-scraper`) Actor

Scrape stock data from StockAnalysis.com, no login: 100+ key statistics, quote overview, company profile, income statement, balance sheet, cash flow and ratios (annual or quarterly), daily price history, dividends, plus earnings and IPO calendars. US, Canadian and global tickers and ETFs.

- **URL**: https://apify.com/yugenox/stockanalysis-scraper.md
- **Developed by:** [Yugenox Corp](https://apify.com/yugenox) (community)
- **Categories:** Business, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.80 / 1,000 stock data rows

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

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

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Stock Data Scraper — Stats, Financials, History & IPOs

Get clean, structured stock data from [StockAnalysis.com](https://stockanalysis.com) for any list of tickers: **100+ key statistics**, a **quote overview**, the **company profile**, the **income statement, balance sheet, cash flow statement and financial ratios** (annual or quarterly), **daily price history (OHLCV)** and **dividend history**. Add the market-wide **earnings calendar**, **upcoming IPOs** and **recent IPOs** in the same run.

US stocks and ETFs (AAPL, MSFT, BRK.B, SPY), Canadian and other markets (TSX:RY, LON:SHEL). No login, no API key, no browser — runs are fast and cheap.

### What you can do with it

- **Replace a rate-limited finance API** in your screener, dashboard or spreadsheet: one run returns fundamentals for hundreds of tickers.
- **Build a fundamentals database**: 5 fiscal years (plus trailing twelve months) or 20 quarters of statements per company, with readable column names.
- **Track valuations**: P/E, forward P/E, EV/EBITDA, PEG, margins, ROE/ROIC, short interest, institutional ownership, analyst targets — refreshed on a schedule.
- **Plan around earnings**: every company reporting in the next days with time (before open / after close), EPS and revenue estimates and market cap; filter to large caps only.
- **Follow the IPO market**: upcoming deals with price range, shares and deal size; the last 200 IPOs with their return since listing.
- **Backtest and chart**: daily open / high / low / close / adjusted close / volume for the latest ~6 months.

### Input

| Field | What it does |
|---|---|
| **Tickers** | Symbols, one per line: `AAPL`, `MSFT`, `BRK.B`, `SPY`. Other markets as `EXCHANGE:SYMBOL` the way stockanalysis.com writes them (`TSX:RY`, `LON:SHEL`). Stock page URLs work too. |
| **Data per ticker** | Any of: Overview & quote · Key statistics · Company profile · Income statement · Balance sheet · Cash flow statement · Financial ratios · Daily price history · Dividend history. Default: overview + statistics. |
| **Statements period** | Annual (TTM + 5 fiscal years) or Quarterly (20 quarters). |
| **Price history: days per ticker** | Keep only the newest N trading days (0 = everything shown, about 6 months). |
| **Calendars** | Earnings calendar · Upcoming IPOs · Recent IPOs. No tickers needed. |
| **Calendar from / to** | Date range for calendar entries. Without dates the earnings calendar covers the next 7 days. |
| **Minimum market cap (USD)** | Only calendar entries of companies at least this large. |
| **Max rows** | Cap for the whole run (tickers first, then calendars). |

Example:

```json
{
  "tickers": ["AAPL", "MSFT", "TSX:RY"],
  "sections": ["statistics", "income-statement", "history"],
  "period": "annual",
  "calendars": ["earnings-calendar"],
  "minMarketCap": 10000000000,
  "maxItems": 1000
}
```

### Output

One dataset row per item. The `dataType` column says what the row is: `overview`, `statistics`, `profile`, `income-statement`, `balance-sheet`, `cash-flow-statement`, `ratios`, `price-history`, `dividend`, `earnings-calendar`, `ipo-calendar` or `recent-ipo`. Every row has `ticker`, `name`, `date` and `url`, so you can filter and join easily. Export to JSON, CSV, Excel or straight into your app via the API.

A **statistics** row (trimmed — the real row has 120+ fields):

```json
{
  "dataType": "statistics",
  "ticker": "AAPL",
  "name": "Apple Inc.",
  "exchange": "NASDAQ",
  "currency": "USD",
  "date": "2026-10-29",
  "price": 348.09,
  "changePercent": 1.24,
  "marketCap": 5080088116200,
  "enterpriseValue": 5017915116200,
  "peRatio": 39.932,
  "forwardPeRatio": 37.968,
  "pegRatio": 3.378,
  "returnOnEquity": 148.751,
  "grossMargin": 48.653,
  "profitMargin": 27.619,
  "dividendYield": 0.31,
  "beta5y": 1.069,
  "shortPctOfFloat": 0.829,
  "ownedByInstitutionsPct": 65.7,
  "analystConsensus": "Buy",
  "priceTarget": 332.39,
  "earningsDate": "2026-11-02",
  "url": "https://stockanalysis.com/stocks/aapl/"
}
```

An **income statement** row (one per fiscal period):

```json
{
  "dataType": "income-statement",
  "ticker": "AAPL",
  "currency": "USD",
  "date": "2025-09-27",
  "period": "annual",
  "fiscalPeriod": "FY2025",
  "revenue": 416161000000,
  "costOfRevenue": 220960000000,
  "grossProfit": 195201000000,
  "operatingIncome": 133050000000,
  "netIncome": 112010000000,
  "epsDiluted": 7.46,
  "freeCashFlow": 98767000000,
  "grossMargin": 46.905,
  "operatingMargin": 31.971
}
```

A **price history** row and an **earnings calendar** row:

```json
{ "dataType": "price-history", "ticker": "TSX:RY", "name": "Royal Bank of Canada", "currency": "CAD", "date": "2026-10-28",
  "open": 285.25, "high": 286.49, "low": 283.82, "close": 286.41, "adjustedClose": 286.41, "volume": 5184051, "changePercent": 0.33 }

{ "dataType": "earnings-calendar", "ticker": "AMZN", "name": "Amazon.com", "date": "2026-10-29", "time": "after-close",
  "epsEstimate": 1.97, "revenueEstimate": 202217312808, "revenueGrowthPercent": 12.24, "marketCap": 2636336831700,
  "indexes": ["SP500", "NASDAQ100", "DOW30"] }
```

**Periods:** statement rows start with the trailing twelve months (`fiscalPeriod` "TTM"); ratios rows start with `Current` (today's market cap and price over the trailing financials, like the site's ratios table).

**Units:** money values are full numbers in the row's currency (`5080088116200`, not "5.08T"). Percentages are in percent, like the site shows them (`1.24` = 1.24%). Dates are `YYYY-MM-DD`. Outside the US, prices can be quoted in a sub-unit (London prices are in GBX = pence); overview and statistics rows tell you `priceCurrency` and `reportingCurrency` separately.

### Pricing

Pay per result: **$0.80 per 1,000 rows** ($0.0008 per row), plus **$0.002 per run**. You only pay for rows saved to your dataset — tickers that don't exist, pages a fund doesn't have and calendar entries outside your filters are free.

Examples: key statistics for 100 tickers = 100 rows ≈ $0.08. Five years of income statements for 50 companies = 300 rows ≈ $0.24. Six months of daily prices for one ticker ≈ 127 rows ≈ $0.10. A week of earnings dates for $10B+ companies ≈ 300 rows ≈ $0.24.

### Tips

- **Only need recent prices?** Set *Price history: days per ticker* (e.g. 20) — fewer rows, lower cost.
- **ETFs** have the overview (AUM, expense ratio, top holdings, returns), price history and dividends; statistics and statements are company-only.
- **Big earnings weeks** list 1,000+ companies — use *Minimum market cap* to keep the ones you care about.
- **Schedule it** (daily or weekly) and connect the dataset to Google Sheets, Make, Zapier or your database.
- Every run writes a `RUN_REPORT` in the key-value store with rows per section, tickers not found and how the run ended.

### FAQ

**Is it legal to scrape StockAnalysis?**
This actor reads only public pages that anyone can open without an account, at a modest pace, and follows the site's robots.txt. It collects market and company data — no personal data. As with any data source, check that your use (especially republishing) fits your own legal and licensing needs.

**Does it access any private data?**
No. No login, no cookies, no paid features. It returns what a logged-out visitor sees: about 6 months of daily prices, 5 fiscal years or 20 quarters of statements. Company executives appear only by name and title, as listed publicly.

**How fresh is the data?**
Quotes are as current as the page at the moment of the run (real-time or 15-minute delayed during market hours). Statistics and statements update within hours after each earnings release.

**Why did a ticker come back empty?**
The symbol must match stockanalysis.com: `BRK.B` (not BRK-B), and `EXCHANGE:SYMBOL` outside the US. The status message lists every ticker that wasn't found — those are never charged.

**Can I get longer price history?**
The actor returns the history the public page shows (about 6 months of daily bars). Run it on a schedule to build a longer series in your own storage.

**Will a run ever fail?**
Runs always finish with the rows collected so far and a plain-English status message — also when the site is slow, a ticker is wrong or the timeout is short.

# Actor input Schema

## `tickers` (type: `array`):

Stock or ETF symbols, one per line: AAPL, MSFT, BRK.B, SPY. For markets outside the US use EXCHANGE:SYMBOL as shown on stockanalysis.com (TSX:RY, LON:SHEL, ASX:BHP). StockAnalysis stock page URLs work too.

## `sections` (type: `array`):

Which pages to read for every ticker. Each row in the dataset is one item (one statistics row, one fiscal period, one daily price, one dividend). ETFs have overview, price history and dividends.

## `period` (type: `string`):

Annual: the trailing twelve months + the last 5 fiscal years. Quarterly: the last 20 quarters. Applies to the income statement, balance sheet, cash flow and ratios.

## `historyLimit` (type: `integer`):

Newest daily prices to keep per ticker. 0 = everything the page shows (about 6 months of trading days).

## `calendars` (type: `array`):

Market-wide lists, no tickers needed: the earnings calendar (date, before open / after close, EPS and revenue estimates, market cap), upcoming IPOs (date, price range, shares, deal size) and the 200 most recent IPOs (IPO price, current price, return).

## `calendarFrom` (type: `string`):

Only calendar entries on or after this date. If both dates are empty, the earnings calendar covers the next 7 days and the IPO lists are returned in full.

## `calendarTo` (type: `string`):

Only calendar entries on or before this date (the earnings calendar reaches about 6 weeks ahead).

## `minMarketCap` (type: `integer`):

Only calendar entries of companies at least this large, e.g. 10000000000 for $10B+. Entries without a market cap are left out when this is set.

## `maxItems` (type: `integer`):

Maximum number of rows for the whole run (tickers first, then calendars). 0 = no limit.

## `proxyConfiguration` (type: `object`):

Apify Proxy (datacenter) is the default and comes with every Apify plan. If StockAnalysis refuses datacenter IPs for a while, the run switches to residential proxies when your account has them.

## Actor input object example

```json
{
  "tickers": [
    "AAPL"
  ],
  "sections": [
    "statistics",
    "income-statement"
  ],
  "period": "annual",
  "historyLimit": 0,
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

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

All scraped rows (the dataType column says what each row is).

## `run` (type: `string`):

Status and statistics for this run.

## `report` (type: `string`):

RUN_REPORT: how the run ended, rows per section, tickers not found, requests and proxy use.

# 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 = {
    "tickers": [
        "AAPL"
    ],
    "sections": [
        "statistics",
        "income-statement"
    ],
    "maxItems": 20,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("yugenox/stockanalysis-scraper").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 = {
    "tickers": ["AAPL"],
    "sections": [
        "statistics",
        "income-statement",
    ],
    "maxItems": 20,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("yugenox/stockanalysis-scraper").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 '{
  "tickers": [
    "AAPL"
  ],
  "sections": [
    "statistics",
    "income-statement"
  ],
  "maxItems": 20,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call yugenox/stockanalysis-scraper --silent --output-dataset

```

## MCP server setup

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

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/Qkx4xboxAjk0lAU9n/builds/daaoiV0irOXra9Aph/openapi.json
