# Stock Consensus Estimates (investing.com) (`pintostudio/stock-consensus-estimates-investing-com`) Actor

The Stock Consensus Estimates Data Actor fetches comprehensive consensus estimates and analyst price targets for stocks from Investing.com.

- **URL**: https://apify.com/pintostudio/stock-consensus-estimates-investing-com.md
- **Developed by:** [Pinto Studio](https://apify.com/pintostudio) (community)
- **Categories:** AI, Developer tools, Other
- **Stats:** 12 total users, 2 monthly users, 53.4% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$5.99 / 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.

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 Consensus Estimates Data (Investing.com)

### Overview

The **Stock Consensus Estimates Data** Actor fetches comprehensive consensus estimates and analyst price targets for stocks from Investing.com. This Actor provides valuable financial data including historical prices, forecast prices, and consensus analyst recommendations for stocks across multiple global markets.

### Features

- **Multi-Market Support**: Fetch data from 46+ countries including major markets like US, UK, Germany, Japan, China, and more
- **Comprehensive Data**: Retrieves actual historical prices, forecast prices, and analyst consensus data
- **Analyst Price Targets**: Get high, mean, and low consensus price targets from analysts
- **Error Handling**: Robust error handling with detailed logging
- **Structured Output**: Clean, structured JSON output with metadata

### Input Configuration

#### Required Parameters

| Parameter | Type | Description | Example |
|-----------|------|-------------|---------|
| `stockSymbol` | string | Stock ticker symbol (1-10 characters) | `"AAPL"`, `"MSFT"`, `"BBVA"` |

#### Optional Parameters

| Parameter | Type | Description | Default | Options |
|-----------|------|-------------|---------|---------|
| `country` | string | Country where the stock is listed | `"united states"` | See supported countries below |

#### Supported Countries

The Actor supports stocks from 46 countries:

**Major Markets:**

- United States, United Kingdom, Germany, France, Italy, Spain
- Japan, China, South Korea, India, Australia, Canada

**European Markets:**

- Netherlands, Belgium, Portugal, Austria, Switzerland
- Norway, Sweden, Denmark, Finland, Poland, Czech Republic
- Hungary, Greece, Turkey, Russia

**Emerging Markets:**

- Brazil, Mexico, Argentina, Chile, Colombia, Peru
- South Africa, Israel, Saudi Arabia, United Arab Emirates
- Malaysia, Singapore, Thailand, Indonesia, Philippines
- Vietnam, Taiwan, Hong Kong, New Zealand

### Output Data Structure

The Actor returns structured JSON data with the following format:

```json
{
  "stock": "AAPL",
  "country": "united states",
  "as_json": true,
  "retrieved_at": "2025-07-02T08:50:36.695069",
  "data_format": "consensus_estimates",
  "stock_symbol": "AAPL",
  "consensus_estimates": {
    "actualHistoryPrices": [
      {
        "date": "2022-06-12",
        "price": 129.04
      },
      {
        "date": "2022-06-19",
        "price": 133.32
      }
    ],
    "forecastHistoryPrices": [
      {
        "date": "2023-07-11",
        "price": 186.97286
      },
      {
        "date": "2023-07-16",
        "price": 187.68714
      }
    ],
    "forecastSummary": {
      "currency_id": 12,
      "target_price_consensus_high": 300,
      "target_price_consensus_mean": 228.60325,
      "target_price_consensus_low": 170.62
    }
  },
  "has_data": true
}
```

#### Output Fields Description

##### Main Fields

- **`stock`**: The requested stock symbol (uppercase)
- **`country`**: Country where the stock is listed
- **`retrieved_at`**: ISO timestamp of when the data was fetched
- **`has_data`**: Boolean indicating if consensus data was found
- **`stock_symbol`**: Normalized stock symbol
- **`data_format`**: Always "consensus_estimates"

##### Consensus Estimates Object

- **`actualHistoryPrices`**: Array of historical price data points
  - `date`: Date in YYYY-MM-DD format
  - `price`: Historical stock price

- **`forecastHistoryPrices`**: Array of forecast price data points
  - `date`: Forecast date in YYYY-MM-DD format
  - `price`: Forecasted stock price

- **`forecastSummary`**: Analyst consensus summary
  - `currency_id`: Currency identifier
  - `target_price_consensus_high`: Highest analyst price target
  - `target_price_consensus_mean`: Average analyst price target
  - `target_price_consensus_low`: Lowest analyst price target

### Usage Examples

#### Basic Usage

```json
{
  "stockSymbol": "AAPL"
}
```

#### Specify Country

```json
{
  "stockSymbol": "BBVA",
  "country": "spain"
}
```

#### Multiple International Stocks

```json
{
  "stockSymbol": "ASML",
  "country": "netherlands"
}
```

### Use Cases

#### Investment Research

- **Analyst Consensus Analysis**: Compare current stock price with analyst price targets
- **Historical vs Forecast Comparison**: Analyze how well forecasts matched actual performance
- **Multi-Market Research**: Research stocks across different global markets

#### Financial Analysis

- **Price Target Tracking**: Monitor changes in analyst price targets over time
- **Consensus Monitoring**: Track high, mean, and low consensus estimates
- **Historical Performance**: Analyze historical price trends

#### Portfolio Management

- **Investment Decision Support**: Use consensus data to inform buy/sell decisions
- **Risk Assessment**: Evaluate analyst sentiment and price target ranges
- **Market Research**: Research international stocks for portfolio diversification

### Error Handling

The Actor includes comprehensive error handling:

- **Validation Errors**: Invalid stock symbols or country parameters
- **Connection Errors**: Network issues when fetching data
- **Data Errors**: Issues with parsing or processing consensus data
- **Runtime Errors**: Unexpected errors during execution

When errors occur, the Actor will:

1. Log detailed error information
2. Return structured error data
3. Fail gracefully with descriptive error messages

### Best Practices

#### Input Validation

- Use valid stock ticker symbols (1-10 characters)
- Ensure the stock is listed in the specified country
- Check that the country is supported

#### Data Processing

- Always check the `has_data` field before processing consensus estimates
- Handle cases where historical or forecast data might be empty
- Consider the `retrieved_at` timestamp for data freshness

#### Error Handling

- Implement retry logic for connection errors
- Validate data structure before processing
- Log errors for debugging purposes

### Rate Limits and Performance

- The Actor fetches data from Investing.com, so respect their rate limits
- Processing time varies based on data availability and complexity
- Consider batching multiple requests for better efficiency

### Integration Examples

#### Python Integration

```python
from apify_client import ApifyClient

client = ApifyClient("your_api_token")

## Run the Actor
run = client.actor("the_actor_id").call(run_input={
    "stockSymbol": "AAPL",
    "country": "united states"
})

## Fetch results
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    if item["has_data"]:
        consensus = item["consensus_estimates"]
        print(f"Mean price target: {consensus['forecastSummary']['target_price_consensus_mean']}")
```

#### JavaScript Integration

```javascript
import { ApifyApi } from 'apify-client';

const client = new ApifyApi({
    token: 'your_api_token'
});

const run = await client.actor('the_actor_id').call({
    stockSymbol: 'AAPL',
    country: 'united states'
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach(item => {
    if (item.has_data) {
        const consensus = item.consensus_estimates;
        console.log(`Mean price target: ${consensus.forecastSummary.target_price_consensus_mean}`);
    }
});
```

### Troubleshooting

#### Common Issues

**No Data Retrieved**

- Verify the stock symbol is correct and active
- Ensure the stock is listed in the specified country
- Check if consensus estimates are available for the stock

**Country Mismatch**

- Confirm the stock is traded in the specified country
- Use the correct country name from the supported list
- Some stocks might be available in multiple countries

**Connection Errors**

- Check internet connectivity
- Verify Investing.com is accessible
- Consider implementing retry logic

#### Important

For technical issues or questions:

1. Check the Actor logs for detailed error information
2. Verify input parameters match the schema
3. Ensure the stock symbol exists and is actively traded
4. Contact support with specific error messages and input parameters

### Support

If you have any questions or encounter any issues, please consult the Apify documentation or reach out to us through one of the following channels:

- **Telegram**: [@pintoflow](https://t.me/pintoflow)
- **Apify Platform**: You can also contact us directly through this platform.

***

# Actor input Schema

## `stockSymbol` (type: `string`):

Stock symbol to retrieve historical data from (e.g., 'AAPL', 'BBVA', 'MSFT')

## `country` (type: `string`):

The country where the stock is listed

## Actor input object example

```json
{
  "stockSymbol": "AAPL",
  "country": "united states"
}
```

# Actor output Schema

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

One item per run with summary fields plus the full actual and forecast price history.

## `summary` (type: `string`):

Quick summary of the latest actual and forecast prices.

# 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 = {
    "stockSymbol": "AAPL"
};

// Run the Actor and wait for it to finish
const run = await client.actor("pintostudio/stock-consensus-estimates-investing-com").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 = { "stockSymbol": "AAPL" }

# Run the Actor and wait for it to finish
run = client.actor("pintostudio/stock-consensus-estimates-investing-com").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 '{
  "stockSymbol": "AAPL"
}' |
apify call pintostudio/stock-consensus-estimates-investing-com --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,pintostudio/stock-consensus-estimates-investing-com"
        }
    }
}
```

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/QFmTHZ4PdHPw6PllV/builds/aGMV9MYXYkm2xGZA7/openapi.json
