Get Yahoo Finance data through an API

Pull stock quotes, historical prices, company profiles, earnings data and more from publicly available Yahoo Finance pages straight via API into your app, spreadsheet, or AI agent. This is an unofficial tool built and run on Apify. It is not affiliated with, endorsed by, or sponsored by Yahoo.

POWERING THE WORLD'S TOP DATA-DRIVEN TEAM

Integrate with your stack

Call the Actor from Python, JavaScript, CLI, cURL, OpenAPI, or MCP. Pick your preferred option and start extracting Yahoo Finance data in minutes.

Python

Python

JavaScript

JavaScript

HTTP

MCP

1from apify_client import ApifyClient
2
3# Initialize the ApifyClient with your Apify API token
4# Replace '<YOUR_API_TOKEN>' with your token.
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7# Prepare the Actor input
8run_input = {
9 "tickers": [
10 "MSFT",
11 "AMZN",
12 ],
13 "proxy": { "useApifyProxy": True },
14}
15
16# Run the Actor and wait for it to finish
17run = client.actor("canadesk/yahoo-finance").call(run_input=run_input)
18
19# Fetch and print Actor results from the run's dataset (if there are any)
20print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
21for item in client.dataset(run["defaultDatasetId"]).iterate_items():
22 print(item)
23
24# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

How to get Yahoo Finance data via API

Provide ticker symbols and set your filters and parameters. The Actor API returns structured JSON with historical stock prices, company information, news articles, analyst recommendations, earnings dates, and more.

Input

{
"delay": 3,
"proxy": {
"useApifyProxy": true
},
"period": "1y",
"process": "gh",
"tickers": [
"MSFT"
],
"interval": "1d",
"rounding": "max",
"storecsv": "no"
}

Output

[
{
"data": [
{
"low": "312.55394893846466",
"Date": "2023-10-05",
"high": "317.59611925564633",
"open": "316.7127353294032",
"close": "316.980712890625",
"volume": "16965600"
}
],
"type": "history",
"ticker": "MSFT"
}
]

How to use the API to get Yahoo Finance data

Sign up for Apify account

Creating an account is quick and free. No credit card required. Your account gives you access to more than 97,000+ tools and APIs.

Get started for free
Get your Apify API token

Go to settings in the Apify console and navigate to the “API & Integrations” tab. There, create a new token and save it for later.

Open the Actor's API panel

Open the Actor page and click the API dropdown in the top right corner. You’ll find API clients, endpoints, and more.

Open the Actor
Start pulling data

Use the API to get the financial data you need from Yahoo Finance.

Why use Apify?

Never get blocked

Every plan (free included) comes with Apify Proxy, which is great for avoiding blocking and giving you access to geo-specific content.

Customers love us

We truly care about the satisfaction of our users, and it shows. Apify is the no.1 data extraction tool on G2.

Monitor your runs

With our latest monitoring features, you always have immediate access to valuable insights on the status of your Actor runs.

Export to various formats

Your datasets can be exported to any format that suits your data workflow, including Excel, CSV, JSON, XML, HTML table, JSONL, and RSS.

Integrate Apify to your workflow

You can integrate your Apify runs with platforms such as Zapier, Make, Keboola, Google Drive, or GitHub. Connect with practically any cloud service or web app.

Large developer community

Apify is built by developers, so you'll be in good hands if you have any technical questions. Our Discord server is always here to help!

Frequently asked questions

Yahoo doesn't offer an official public API for Yahoo Finance data. This Actor is an unofficial alternative. It extracts publicly available data from Yahoo Finance pages and returns it in a structured format you can use in your projects and applications.

No. This tool is built by a developer in the Apify community and runs on the Apify platform. It is not affiliated with, endorsed by, or sponsored by Yahoo.

Yes. Create an Apify account and you get $5 of free monthly usage. No credit card required. Get your API token and start making requests.

Our Actors allows you to get data from Yahoo Finance such as stock quotes with open/high/low/close prices, historical data with customizable periods and intervals, company information and profiles, analyst recommendations and price targets, earnings dates and schedules, fund and ETF data, dividend information, financial news articles, and volume data with formatted dates for comprehensive financial analysis.

Create a free Apify account, get your API token, and call the Actor from Python, JavaScript, CLI, cURL, OpenAPI, or MCP.

Get Yahoo Finance data today

Get your first Yahoo Finance data in less than 5 minutes. No credit card required. No commitment. Cancel anytime.