# Google Finance (`canadesk/google-finance`)

Get the latest Quotes and Historical data for Stocks, Indexes, Crypto, Exchange rates and more from Google Finance. It's fast and costs little!

- **URL**: https://beta-securitybyobscurity.apify.com/canadesk/google-finance.md
- **Developed by:** [Canadesk Support](https://beta-securitybyobscurity.apify.com/canadesk) (community)
- **Categories:** News, Social media, SEO tools
- **Stats:** 25 total users, 10 monthly users, 100.0% runs succeeded, 6 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.00/month + usage

To use this Actor, you pay a monthly rental fee to the developer. The rent is subtracted from your prepaid usage every month after the free trial period.
You also pay for the Apify platform usage, which gets cheaper the higher Apify subscription plan you have.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#rental-actors

# README

⚡ Make sure to increase the Actor's memory and timeout for long runs.

### Input

- Tickers (array)

  Returns data for the listed tickers.

  Expected format: {CODE} or {CODE}:{EXCHANGE} or {CODE}-{CODE} (for Cryptocurrency).

  Examples: GOOGL or GOOGL:NASDAQ or BTC-USD.

- Process (select)

  - **Search**

    {CODE} or {CODE}-{CODE} returns a list of potential matches with general information for each ticker.

    {CODE}:{EXCHANGE} returns general information for the exact ticker.

  - **Get Price**

    {CODE} or {CODE}-{CODE} returns a list of potential matches with price information for each ticker.

    {CODE}:{EXCHANGE} returns price information for the exact ticker.

  - **Get History**

    {CODE} first tries to find the most relevant exchange, then returns history information.

    **Recommended!** {CODE}:{EXCHANGE} or {CODE}-{CODE} returns history information without overhead.

- Batch (integer)

  Number of parallel requests to be executed - only relevant when there is more than 1 ticker.

  Default is 1. The higher the number, the more chances you have to be blocked.

- Delay (integer)

  For high-volume scraping, make sure to set a reasonable waiting time.

### Supported Exchange Codes

Original list: <https://www.google.com/googlefinance/disclaimer/>

```
[
	"BCBA", "BMV", "BVMF", "CNSX", "CVE", "NASDAQ", "NYSE", "NYSEARCA", "NYSEAMERICAN", "OPRA", "OTCMKTS", "TSE", "TSX", "TSXV",
	"AMS", "BIT", "BME", "CPH", "EBR", "ELI", "EPA", "ETR", "FRA", "HEL", "ICE", "IST", "LON", "RSE", "STO", "SWX", "VTX", "TAL", "VIE", "VSE", "WSE",
	"JSE", "TADAWUL", "TLV",
	"BKK", "BOM", "KLSE", "HKG", "IDX", "KOSDAQ", "KRX", "NSE", "SGX", "SHA", "SHE", "TPE", "TYO",
	"ASX", "NZE",
	"MUTF", "MUTF_IN",
	"INDEXBVMF", "INDEXCBOE", "INDEXCME", "INDEXDJX", "INDEXNASDAQ", "INDEXNYSEGIS", "INDEXRUSSELL", "INDEXSP", "INDEXBMV", "INDEXTSI",
	"INDEXBIT", "INDEXBME", "INDEXDB", "INDEXEURO", "INDEXFTSE", "INDEXIST", "INDEXSTOXX", "INDEXSWX", "INDEXVIE",
	"INDEXBKK", "INDEXBOM", "INDEXHANGSENG", "INDEXNIKKEI", "INDEXTYO", "INDEXTOPIX", "IDX", "SHE", "TPE",
	"INDEXASX", "INDEXNZE",
	"CBOT", "CME_EMINIS", "COMEX", "NYMEX"
]
```

### Output

For "Search" and "Get Price", using {CODE}:{EXCHANGE} returns a single entry instead.

**Search** with {CODE} returns:

```
{
	"ticker": "GOOGL",
	"data": [
		{
			"id": "GOOGL:NASDAQ",
			"code": "GOOGL",
			"name": "Alphabet Inc Class A",
			"exchange": "NASDAQ"
		},
		{
			"id": "GOOGL:BMV",
			"code": "GOOGL",
			"name": "Alphabet Inc Class A",
			"exchange": "BMV"
		},
		...
	]
}
```

**Get Price** with {CODE} returns:

```
{
	"ticker": "GOOGL",
	"data": [
		{
			"id": "/m/07zln7n",
			"ticker": "GOOGL:NASDAQ",
			"code": "GOOGL",
			"exchange": "NASDAQ",
			"name": "Alphabet Inc Class A",
			"currency": "USD",
			"price": {
				"lastPrice": 191.79,
				"change": 2.3600006,
				"changePct": 1.2458432
			},
			"previousClose": 189.43,
			"region": "US",
			"updateTimestamp": 1735954200,
			"timezone": "America/New_York",
			"timezoneOffset": -18000,
			"afterHrsTrading": {
				"lastPrice": 191.97,
				"change": 0.18000793,
				"changePct": 0.09385679
			},
			"previousTimestamp": 1735938001,
			"afterHrsTimestamp": 1735952308
		},
		{
			"id": "/g/11bbrjxcfr",
			"ticker": "GOOGL:BMV",
			"code": "GOOGL",
			"exchange": "BMV",
			"name": "Alphabet Inc Class A",
			"currency": "MXN",
			"price": {
				"lastPrice": 3953.04,
				"change": 57.66992,
				"changePct": 1.4804735
			},
			"previousClose": 3895.37,
			"region": "MX",
			"updateTimestamp": 1735939372,
			"timezone": "America/Mexico_City",
			"timezoneOffset": -21600,
			"afterHrsTrading": null,
			"previousTimestamp": 1735938000,
			"afterHrsTimestamp": null
		},
		...
	]
}
```

**Get History** returns:

```
{
	"ticker": "GOOGL:NASDAQ",
	"data": [
		{
			"dateTimeUTC": "2025-01-27T14:30:00.000Z",
			"price": {
				"lastPrice": 194.83,
				"change": 0,
				"changePct": 0
			},
			"volume": 237264
		},
		{
			"dateTimeUTC": "2025-01-27T15:00:00.000Z",
			"price": {
				"lastPrice": 193.14,
				"change": -1.6900000000000261,
				"changePct": -0.008674228814864375
			},
			"volume": 1691500
		},
		...
	]
}
```

### Support

Google Finance does not provide volume for all types (e.g., Cryptocurrency).

Open a new issue for bugs or feature requests. Please share the run URL.

Cheers!

# Actor input Schema

## `process` (type: `string`):

See Information tab.

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

Format: {CODE} or {CODE}:{EXCHANGE}.

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

Only for Get History.

## `batch` (type: `integer`):

Only relevant for Get All Reviews. See Information tab.

## `delay` (type: `integer`):

Only for API. Waiting time between requests.

## `proxy` (type: `object`):

Select proxies to be used by your crawler.

## Actor input object example

```json
{
  "process": "gh",
  "tickers": [
    ".DJI",
    "SWPPX:MUTF",
    "GOOGL:NASDAQ",
    "ETH-BTC",
    "EUR-USD"
  ],
  "period": "5d",
  "batch": 2,
  "delay": 3,
  "proxy": {
    "useApifyProxy": true
  }
}
```

# 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": [
        ".DJI",
        "SWPPX:MUTF",
        "GOOGL:NASDAQ",
        "ETH-BTC",
        "EUR-USD"
    ],
    "proxy": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("canadesk/google-finance").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": [
        ".DJI",
        "SWPPX:MUTF",
        "GOOGL:NASDAQ",
        "ETH-BTC",
        "EUR-USD",
    ],
    "proxy": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("canadesk/google-finance").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": [
    ".DJI",
    "SWPPX:MUTF",
    "GOOGL:NASDAQ",
    "ETH-BTC",
    "EUR-USD"
  ],
  "proxy": {
    "useApifyProxy": true
  }
}' |
apify call canadesk/google-finance --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=canadesk/google-finance",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Google Finance",
        "description": "Get the latest Quotes and Historical data for Stocks, Indexes, Crypto, Exchange rates and more from Google Finance. It's fast and costs little!",
        "version": "2.0",
        "x-build-id": "SdlqD5OxKOQTezgfk"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/canadesk~google-finance/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-canadesk-google-finance",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/canadesk~google-finance/runs": {
            "post": {
                "operationId": "runs-sync-canadesk-google-finance",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/canadesk~google-finance/run-sync": {
            "post": {
                "operationId": "run-sync-canadesk-google-finance",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "tickers"
                ],
                "properties": {
                    "process": {
                        "title": "Process",
                        "enum": [
                            "gs",
                            "gp",
                            "gh"
                        ],
                        "type": "string",
                        "description": "See Information tab.",
                        "default": "gh"
                    },
                    "tickers": {
                        "title": "Tickers",
                        "type": "array",
                        "description": "Format: {CODE} or {CODE}:{EXCHANGE}.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "period": {
                        "title": "Filter - Period",
                        "enum": [
                            "max",
                            "1d",
                            "5d",
                            "1m",
                            "3m",
                            "6m",
                            "1y",
                            "5y"
                        ],
                        "type": "string",
                        "description": "Only for Get History.",
                        "default": "5d"
                    },
                    "batch": {
                        "title": "Parallel processing",
                        "minimum": 1,
                        "maximum": 5,
                        "type": "integer",
                        "description": "Only relevant for Get All Reviews. See Information tab.",
                        "default": 2
                    },
                    "delay": {
                        "title": "Delay",
                        "minimum": 1,
                        "maximum": 30,
                        "type": "integer",
                        "description": "Only for API. Waiting time between requests.",
                        "default": 3
                    },
                    "proxy": {
                        "title": "Proxy configuration",
                        "type": "object",
                        "description": "Select proxies to be used by your crawler."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
