# Yahoo Finance Analysis Data Scraper (`axesso_data/yahoo-finance-analysis-data-scraper`) Actor

Scrape up-to-date stock analysis data from Yahoo Finance including recommendation trends, earnings and revenue, EPS, upgrades and downgrades. Ideal for investors seeking comprehensive real-time stock insights in a structured JSON format.

- **URL**: https://apify.com/axesso\_data/yahoo-finance-analysis-data-scraper.md
- **Developed by:** [AxCrawler](https://apify.com/axesso_data) (community)
- **Categories:** News
- **Stats:** 7 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

### How does Yahoo Finance Stock Analysis Scraper work?

The Yahoo Finance Stock Analysis Scraper extracts up-to-date stock analysis data from Yahoo Finance. This includes recommendation trends, earnings history, financial metrics, and investment ratings. The data provided can be used to evaluate the financial health and analyst sentiment around specified stock symbols.

The Actor works in real-time, fetching live data at the moment of execution without relying on cached or stale information. This ensures that users receive the most current stock analysis data available.

Extraction begins by processing a JSON input object containing an array of requests. Each request specifies stock symbols and associated market regions for which the analysis data is retrieved. The Actor then fetches and returns structured data reflecting the latest analysis data for each requested symbol.

### Input data

The input must be a JSON object that contains one mandatory field named "input", which is an array of request objects. Each item in "input" corresponds to a separate request to fetch analysis data for a stock.

The fields for each element in the array are:

- `symbol` (Required): The stock symbol identifier for which to retrieve analysis data.
- `region` (Optional): The market region code; allowed values include US, BR, AU, CA, FR, DE, HK, IN, IT, ES, GB, SG.

Multiple requests can be processed in a single run by including multiple objects in the "input" array.

#### Example input
```json
{
  "input": [
    {
      "symbol": "AAPL",
      "region": "US"
    },
    {
      "symbol": "TSLA",
      "region": "US"
    }
  ]
}
````

### Output data

The output is a JSON object containing detailed stock analysis information per requested symbol. This includes recommendation trends, earnings history, financial data like margins and ratios, summary details, upgrade and downgrade history, and other relevant stock insights.

Sample output (with limited response fields for brevity):

```json
{
  "recommendationTrend": {
    "trend": [
      {"period": "0m", "strongBuy": 2, "buy": 3, "hold": 0, "sell": 0, "strongSell": 0},
      {"period": "-1m", "strongBuy": 0, "buy": 1, "hold": 1, "sell": 2, "strongSell": 0}
    ],
    "maxAge": 86400
  },
  "financialsTemplate": {"code": "N", "maxAge": 1},
  "price": {
    "quoteSourceName": "Delayed Quote",
    "regularMarketPrice": {"raw": 0.7844, "fmt": "0.7844"},
    "shortName": "Amarin Corporation plc",
    "currencySymbol": "$",
    "market": "us_market"
  },
  "earningsHistory": {
    "history": [
      {"epsActual": {"raw": -0.04}, "epsEstimate": {"raw": -0.03}, "quarter": {"raw": 1688083200}},
      {"epsActual": {"raw": -0.05}, "epsEstimate": {"raw": -0.04}, "quarter": {"raw": 1696032000}}
    ],
    "maxAge": 86400
  },
  "financialData": {
    "ebitdaMargins": {"raw": -0.08262},
    "profitMargins": {"raw": -0.1896},
    "grossMargins": {"raw": 0.6361},
    "recommendationKey": "hold",
    "currentPrice": {"raw": 0.7844},
    "marketCap": {"raw": 322285632},
    "currency": "USD"
  },
  "upgradeDowngradeHistory": {
    "history": [
      {"epochGradeDate": 1718904034, "firm": "Cantor Fitzgerald", "toGrade": "Overweight", "fromGrade": "", "action": "reit"}
    ],
    "maxAge": 86400
  },
  "symbol": "AMRN"
}
```

### How much does Yahoo Finance Stock Analysis Scraper cost?

The cost depends on the number and complexity of the requests executed during a run. It is recommended to perform an initial test run with a limited number of stock symbols to evaluate resource usage and potential expense. This helps in accurate cost estimation for larger or more frequent data extractions.

### What to consider when using this Actor?

We have over a decade of experience in web crawling included in this Actor, which means users do not need to manage common web scraping challenges such as:

- **Proxy Rotation:** The Actor automatically rotates proxies to prevent IP blocking, ensuring consistent access to data.
- **Geo Targeting:** Requests are routed through region-appropriate proxies to simulate valid market locations and avoid geo-restrictions.
- **Captcha / Blocking Handling:** The Actor manages captcha challenges and temporary blocks transparently to the user.
- **Stability and Reliability:** Designed with extensive lifecycle management to reduce failures and the need for user intervention, providing stable extraction performance.

### Where else you can find Axesso - Data Service solutions?

Axesso offers APIs and Actors via its official [API Portal](https://axesso.developer.azure-api.net/apis) and is also accessible through [RapidAPI](https://rapidapi.com/search?term=axesso\&sortBy=ByRelevance). These platforms have a proven track record of delivering reliable and stable financial data services to thousands of users over several years.

### Use cases for our Axesso Actors

1. Market Research: Extract structured market data for financial analysis, valuation models, and research workflows.
2. Price Monitoring: Track real-time and intraday price movements to detect market changes.
3. Historical Price Analysis: Access historical time-series data for backtesting, trend analysis, and technical indicators.
4. Portfolio Tracking: Monitor asset performance, returns, and exposure across multiple financial instruments.
5. Trading and Automation: Use market data as input for algorithmic trading systems and automated workflows.
6. Financial Data Aggregation: Collect and store market data in databases or data warehouses for analytics and reporting.
7. Market Dashboards and Websites: Provide current and historical price data for dashboards, screeners, and financial websites.
8. Event-based Analysis: Analyze price movements around earnings, dividends, splits, and other corporate actions.
9. Instrument Discovery: Detect relevant stocks, ETFs, or cryptocurrencies based on market activity and predefined thresholds.

# Actor input Schema

## `input` (type: `array`):

List of inputs, each entry refers to one request to be executed. Full list of valid parameters can be found in the README tab.

## Actor input object example

```json
{
  "input": [
    {
      "symbol": "AAPL",
      "region": "US"
    },
    {
      "symbol": "TSLA",
      "region": "US"
    }
  ]
}
```

# 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 = {
    "input": [
        {
            "symbol": "AAPL",
            "region": "US"
        },
        {
            "symbol": "TSLA",
            "region": "US"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("axesso_data/yahoo-finance-analysis-data-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 = { "input": [
        {
            "symbol": "AAPL",
            "region": "US",
        },
        {
            "symbol": "TSLA",
            "region": "US",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("axesso_data/yahoo-finance-analysis-data-scraper").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 '{
  "input": [
    {
      "symbol": "AAPL",
      "region": "US"
    },
    {
      "symbol": "TSLA",
      "region": "US"
    }
  ]
}' |
apify call axesso_data/yahoo-finance-analysis-data-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Yahoo Finance Analysis Data Scraper",
        "description": "Scrape up-to-date stock analysis data from Yahoo Finance including recommendation trends, earnings and revenue, EPS, upgrades and downgrades. Ideal for investors seeking comprehensive real-time stock insights in a structured JSON format.",
        "version": "1.0",
        "x-build-id": "VcEALwCHeaVdW83Zl"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/axesso_data~yahoo-finance-analysis-data-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-axesso_data-yahoo-finance-analysis-data-scraper",
                "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/axesso_data~yahoo-finance-analysis-data-scraper/runs": {
            "post": {
                "operationId": "runs-sync-axesso_data-yahoo-finance-analysis-data-scraper",
                "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/axesso_data~yahoo-finance-analysis-data-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-axesso_data-yahoo-finance-analysis-data-scraper",
                "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": [
                    "input"
                ],
                "properties": {
                    "input": {
                        "title": "Input data",
                        "type": "array",
                        "description": "List of inputs, each entry refers to one request to be executed. Full list of valid parameters can be found in the README tab."
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
