# Google Finance Scraper (`searchapi/google-finance-scraper`) Actor

Scrapes source-backed Google Finance quote pages for exchange-qualified or bare symbols. Extracts display and numeric prices, quote statistics, company profiles, related stocks, news, analyst ratings, 12-month targets, analyst actions, URLs, and retrieval provenance.

- **URL**: https://apify.com/searchapi/google-finance-scraper.md
- **Developed by:** [Search API](https://apify.com/searchapi) (community)
- **Categories:** Developer tools, Automation, News
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.99 / 1,000 search results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Google Finance Scraper

Collect fast, structured stock quotes and public company data from Google Finance. The Actor uses Google Finance's server-rendered quote pages, so representative runs finish in seconds without launching a browser.

### What it extracts

Every valid quote includes a stable `SYMBOL:EXCHANGE` ID, company name, canonical URL, numeric price, displayed price, currency, absolute and percentage change, direction, market status, quote time, localization, and scrape time.

When Google displays the values, the Actor also extracts:

- After-hours price and percentage change
- Open, high, low, volume, and average volume
- Market capitalization, P/E ratio, EPS, and beta
- Dividend yield, quarterly dividend, and ex-dividend date
- 52-week high and low
- Shares outstanding and employee count
- Company description, CEO, headquarters, founding date, and sector
- Related stocks with typed prices and percentage changes

Numeric values are returned as numbers, while matching `...Text` fields preserve Google's displayed values. Optional fields are omitted instead of stored as null, blank, or fabricated values.

### Input modes

#### Single quote

```json
{
  "mode": "single",
  "query": "AAPL:NASDAQ",
  "maxItems": 1
}
```

#### Multiple quotes

```json
{
  "mode": "batch",
  "queries": ["AAPL:NASDAQ", "NYSE:IBM", "NSE:RELIANCE"],
  "maxItems": 3,
  "maxConcurrency": 3
}
```

Supported query forms are:

- `AAPL` — uses `defaultExchange`
- `AAPL:NASDAQ` — Google's canonical ticker-first form
- `NASDAQ:AAPL` — exchange-first convenience form
- A public `google.com/finance/quote/...` URL

Google Finance does not reliably resolve a ticker without an exchange. Bare tickers remain supported for backward compatibility and use `defaultExchange` (`NASDAQ` by default); specify an exchange whenever the ticker is ambiguous.

### Input reference

| Field | Description | Default |
|---|---|---|
| `mode` | `single` or `batch` | `single` |
| `query` | Primary quote | `AAPL:NASDAQ` |
| `queries` | Additional quotes in batch mode | `[]` |
| `defaultExchange` | Exchange applied to bare tickers | `NASDAQ` |
| `maxItems` | Maximum unique records, 1–50 | mode-dependent |
| `gl` | Two-letter Google country code | `us` |
| `hl` | Google interface language | `en` |
| `maxConcurrency` | Concurrent HTTP requests, 1–10 | `5` |
| `maxRequestRetries` | Temporary-failure retries, 0–3 | `1` |
| `requestTimeoutSecs` | Per-request timeout, 10–120 seconds | `30` |
| `proxyConfiguration` | Standard Apify, Residential, or custom proxy settings | direct |

English (`hl: "en"`) is recommended because public market-statistic labels are localized on the source page.

### Proxy guidance

Direct HTTP is the fastest default and currently works for public Google Finance quote pages. Standard Apify Proxy, Residential proxies, and custom proxy URLs are supported when a different network route is needed.

`GOOGLE_SERP` is intentionally rejected: it is designed for Google Search result pages and does not transport `google.com/finance/quote/...` pages. The Actor does not solve or bypass CAPTCHAs. Explicit challenges fail closed and are never stored as quote records.

### Output and API use

Results are stored in the default dataset and are available as JSON, CSV, Excel, XML, RSS, or through the Apify API. The `OUTPUT` key-value-store record contains the run status, query count, record count, empty queries, failures, transport, and application duration.

Example record (prices change over time):

```json
{
  "id": "AAPL:NASDAQ",
  "name": "Apple Inc",
  "symbol": "AAPL",
  "exchange": "NASDAQ",
  "price": 319.7,
  "priceText": "$319.70",
  "currency": "USD",
  "change": 5.12,
  "changePercent": 1.63,
  "marketCap": 4670000000000,
  "marketCapText": "4.67T",
  "url": "https://www.google.com/finance/quote/AAPL:NASDAQ?hl=en&gl=us",
  "source": "Google Finance"
}
```

### Reliability and performance

- Server-rendered HTML extraction; no browser startup
- Bounded parallel batch requests
- Status-code and content-type validation before parsing
- Explicit CAPTCHA/block detection with fail-closed behavior
- Bounded retries for temporary failures only
- Stable deduplication by symbol and exchange
- No raw response storage and no secrets in logs or datasets
- Clean empty dataset for a valid but unknown quote

Use conservative concurrency and comply with the target website's terms and applicable laws.

# Actor input Schema

## `mode` (type: `string`):

Use Single for one quote or Batch for several quotes in one run.

## `query` (type: `string`):

Ticker (AAPL), ticker and exchange (AAPL:NASDAQ), exchange-prefixed ticker (NSE:RELIANCE), or a public Google Finance quote URL.

## `queries` (type: `array`):

Quotes processed in Batch mode. Duplicate symbol/exchange pairs are removed.

## `defaultExchange` (type: `string`):

Applied only when a query omits its exchange. Google Finance does not reliably resolve bare tickers, so specify the exchange when unsure.

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

Maximum number of unique quote records to store.

## `gl` (type: `string`):

Two-letter Google country code used for localization.

## `hl` (type: `string`):

Google interface language. English is recommended because statistic labels are parsed from the public page.

## `maxConcurrency` (type: `integer`):

Concurrent quote requests.

## `maxRequestRetries` (type: `integer`):

Retries temporary network and server failures. Explicit challenges fail closed.

## `requestTimeoutSecs` (type: `integer`):

Maximum time allowed for each Google Finance HTTP request.

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

Direct HTTP is fastest and is the default. Standard Apify, Residential, or custom proxies are supported. GOOGLE\_SERP is not compatible with Google Finance quote URLs.

## Actor input object example

```json
{
  "mode": "single",
  "query": "AAPL:NASDAQ",
  "queries": [
    "AAPL:NASDAQ",
    "IBM:NYSE",
    "NSE:RELIANCE"
  ],
  "defaultExchange": "NASDAQ",
  "maxItems": 20,
  "gl": "us",
  "hl": "en",
  "maxConcurrency": 5,
  "maxRequestRetries": 1,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

# 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 = {
    "query": "AAPL:NASDAQ",
    "queries": [
        "AAPL:NASDAQ",
        "IBM:NYSE",
        "NSE:RELIANCE"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("searchapi/google-finance-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 = {
    "query": "AAPL:NASDAQ",
    "queries": [
        "AAPL:NASDAQ",
        "IBM:NYSE",
        "NSE:RELIANCE",
    ],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("searchapi/google-finance-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 '{
  "query": "AAPL:NASDAQ",
  "queries": [
    "AAPL:NASDAQ",
    "IBM:NYSE",
    "NSE:RELIANCE"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call searchapi/google-finance-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,searchapi/google-finance-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/elTNv3D16VmfXN2BO/builds/5NhxJ6WIsJWxf6G7D/openapi.json
