# Stock Earnings (`pintostudio/stock-earnings`) Actor

The Stock Earnings (investing.com) actor is a specialized web scraper designed to fetch comprehensive earnings data for publicly traded stocks from Investing.com.

- **URL**: https://apify.com/pintostudio/stock-earnings.md
- **Developed by:** [Pinto Studio](https://apify.com/pintostudio) (community)
- **Categories:** Developer tools, Automation, Other
- **Features:** Limited permissions
- **Stats:** 25 total users, 1 monthly users, 84.9% runs succeeded, 1 bookmarks
- **User rating**: 4.00 out of 5 stars

## Pricing

$4.70 / 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 Earnings (investing.com) - Actor Documentation

### Overview

The **Stock Earnings (investing.com)** actor is a specialized web scraper designed to fetch comprehensive earnings data for publicly traded stocks from Investing.com. This actor provides historical earnings information including actual vs. forecasted earnings per share (EPS), revenue data, surprise percentages, and price change metrics.

### Features

- **Comprehensive Earnings Data**: Retrieves historical earnings records with actual and forecasted metrics
- **Multi-Country Support**: Supports 45+ countries and major stock exchanges worldwide
- **Financial Metrics**: Includes EPS, revenue, surprise percentages, and price change data
- **Historical Analysis**: Provides multiple quarters/years of earnings history
- **Summary Statistics**: Calculates average surprise rates and positive surprise counts
- **JSON Output**: Clean, structured data format for easy integration

### Input Parameters

#### Required Parameters

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

#### Optional Parameters

| Parameter | Type | Description | Default |
|-----------|------|-------------|---------|
| `country` | string | Country where the stock is listed | `"united states"` |

#### Supported Countries

The actor supports stocks from 45+ countries including:

**Major Markets:**

- United States
- United Kingdom
- Germany
- France
- Japan
- China
- Canada
- Australia

**European Markets:**

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

**Asian Markets:**

- South Korea, India, Malaysia, Singapore, Thailand
- Indonesia, Philippines, Vietnam, Taiwan, Hong Kong

**Other Markets:**

- Brazil, Mexico, Argentina, Chile, Colombia, Peru
- South Africa, Israel, Saudi Arabia, UAE, New Zealand

### Output Data Structure

The actor returns an array of earnings records, each containing:

```json
[
  {
    "currencyId": 12,
    "date": "2025-07-23T00:00:00.000Z",
    "epsActual": 0.52,
    "epsForecast": 0.61,
    "epsSurprisePercent": -14.75,
    "priceChangePercent": -14.12,
    "reportMonth": 6,
    "reportYear": 2025,
    "revenueActual": 25500000000,
    "revenueForecast": 24330000000,
    "revenueSurprisePercent": 4.81
  }
]
```

#### Field Descriptions

| Field | Type | Description |
|-------|------|-------------|
| `currencyId` | number | Currency identifier for the stock |
| `date` | string | Earnings announcement date (ISO format) |
| `epsActual` | number/null | Actual earnings per share reported |
| `epsForecast` | number | Forecasted earnings per share |
| `epsSurprisePercent` | number/null | EPS surprise percentage (actual vs forecast) |
| `priceChangePercent` | number/null | Stock price change percentage after earnings |
| `reportMonth` | number | Month of the reporting period (1-12) |
| `reportYear` | number | Year of the reporting period |
| `revenueActual` | number/null | Actual revenue reported |
| `revenueForecast` | number | Forecasted revenue |
| `revenueSurprisePercent` | number/null | Revenue surprise percentage |

### Usage Examples

#### Basic Usage

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

#### With Country Specification

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

#### Multiple Examples

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

### Summary Data

The actor also generates a comprehensive summary stored in the key-value store:

```json
{
  "stock": "AAPL",
  "country": "united states",
  "stock_symbol": "AAPL",
  "has_data": true,
  "retrieved_at": "2025-07-08T10:30:00.000Z",
  "total_records": 10,
  "latest_earnings_date": "2025-07-23T00:00:00.000Z",
  "latest_report_quarter": 6,
  "latest_report_year": 2025,
  "latest_eps_actual": 0.52,
  "latest_eps_forecast": 0.61,
  "latest_eps_surprise_percent": -14.75,
  "latest_revenue_actual": 25500000000,
  "latest_revenue_forecast": 24330000000,
  "latest_revenue_surprise_percent": 4.81,
  "latest_price_change_percent": -14.12,
  "avg_eps_surprise_percent": -2.35,
  "positive_eps_surprises": 4,
  "avg_revenue_surprise_percent": 1.23,
  "positive_revenue_surprises": 6
}
```

### Error Handling

The actor includes comprehensive error handling for:

- **Validation Errors**: Invalid stock symbols or parameters
- **IO Errors**: Network connectivity issues
- **Runtime Errors**: Unexpected processing errors
- **Connection Errors**: Failed requests to Investing.com
- **File Not Found Errors**: Missing resources

### Performance Considerations

- **Rate Limiting**: Respects Investing.com's rate limits
- **Efficient Processing**: Optimized for bulk data retrieval
- **Memory Management**: Handles large datasets efficiently
- **Retry Logic**: Built-in retry mechanism for failed requests

### Integration Tips

1. **Data Analysis**: Use the summary statistics for quick insights
2. **Historical Trends**: Analyze surprise percentages over time
3. **Comparative Analysis**: Compare earnings across different stocks
4. **Alert Systems**: Monitor for earnings surprises
5. **Financial Modeling**: Use actual vs. forecast data for model validation

### Limitations

- Data availability depends on Investing.com's coverage
- Historical data depth may vary by stock and country
- Some fields may be `null` for upcoming earnings (forecasts only)
- Currency conversion not performed (use `currencyId` for reference)

### 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:

- Verify input parameters match the schema requirements
- Check the Apify platform documentation
- Review the actor logs for detailed error messages

* **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

## `earnings` (type: `string`):

No description

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

// Run the Actor and wait for it to finish
const run = await client.actor("pintostudio/stock-earnings").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-earnings").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-earnings --silent --output-dataset

```

## MCP server setup

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

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/EoXpUcCO7vRk3gdDl/builds/a2obY5UVn9aPoN7Vc/openapi.json
