# CNN Business Stock Earnings Per Share (`pintostudio/cnn-business-stock-earnings-per-share`) Actor

The CNN Business Stock Earnings Per Share Actor is an Apify actor that retrieves comprehensive earnings per share (EPS) data for US stock tickers from CNN Business.

- **URL**: https://apify.com/pintostudio/cnn-business-stock-earnings-per-share.md
- **Developed by:** [Pinto Studio](https://apify.com/pintostudio) (community)
- **Categories:** Other, Developer tools, Automation
- **Stats:** 3 total users, 3 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $7.00 / 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

## CNN Business Stock Earnings Per Share Actor

### Overview

The CNN Business Stock Earnings Per Share Actor is an Apify actor that retrieves comprehensive earnings per share (EPS) data for US stock tickers from CNN Business. This actor provides both current and historical EPS data, including quarterly and annual comparisons, along with detailed explanations and market insights.

### Features

- Fetch real-time earnings per share data for any US stock ticker
- Compare current quarter vs. previous quarter performance
- Compare current annual vs. previous annual performance
- Get percentage changes and trend analysis
- Receive detailed explanations of what EPS means and why it's important
- Get formatted summaries suitable for financial reports or dashboards
- Automatic data validation and error handling

### Input Schema

The actor accepts the following input parameters:

#### Required Parameters

| Parameter | Type | Description | Example |
|-----------|------|-------------|---------|
| `ticker` | string | US stock ticker symbol (1-5 characters) | `"AAPL"`, `"GOOGL"`, `"TSLA"` |

#### Input Validation

- **Format**: Must be 1-5 alphabetic characters
- **Case**: Automatically converted to uppercase
- **Pattern**: Matches `^[A-Za-z]{1,5}$`
- **Default**: `"AAPL"` (if not specified)

#### Example Input

```json
{
  "ticker": "KO"
}
```

### Output Schema

The actor returns a structured JSON object containing comprehensive EPS data:

#### Main Output Structure

```json
{
  "ticker": "string",
  "results": {
    // EPS Values
    "current_quarter_value": "number",
    "prev_quarter_value": "number", 
    "current_annual_value": "number",
    "prev_annual_value": "number",
    
    // Metadata
    "quarter_index": "string",
    "company_name": "string",
    "event_date": "string",
    "last_updated": "string",
    
    // Performance Metrics
    "annual_percentage_change": "string",
    "quarter_percentage_change": "string",
    "sufficient_data_to_create_template": "boolean",
    
    // Summaries and Insights
    "list_summary": { /* Summary object */ },
    "summary": { /* Detailed summary object */ },
    "what_it_means": { /* Market analysis object */ },
    "define": { /* EPS definition object */ },
    "usage": { /* EPS importance explanation object */ }
  },
  "timestamp": "string"
}
```

#### Detailed Field Descriptions

##### EPS Values

- `current_quarter_value`: Latest quarter's EPS value
- `prev_quarter_value`: Previous quarter's EPS value
- `current_annual_value`: Current annual EPS (trailing 12 months)
- `prev_annual_value`: Previous annual EPS

##### Metadata

- `quarter_index`: Current quarter number ("1", "2", "3", or "4")
- `company_name`: Full company name
- `event_date`: Date of the earnings report (YYYY-MM-DD)
- `last_updated`: ISO timestamp of data last update

##### Performance Metrics

- `annual_percentage_change`: Year-over-year percentage change
- `quarter_percentage_change`: Quarter-over-quarter percentage change
- `sufficient_data_to_create_template`: Boolean indicating data completeness

##### Summary Objects

Each summary object contains:

- `title`: Summary headline
- `plain_text`: Unformatted text description
- `formatted_text`: HTML-formatted text with styling classes

#### Example Output

```json
{
  "ticker": "KO",
  "results": {
    "current_quarter_value": 0.883,
    "prev_quarter_value": 0.7721,
    "quarter_index": "2",
    "current_annual_value": 2.4609,
    "prev_annual_value": 2.4692,
    "company_name": "Coca-Cola Company",
    "event_date": "2025-06-30",
    "last_updated": "2025-08-12T08:09:11.472000+00:00",
    "annual_percentage_change": "-0.34",
    "quarter_percentage_change": "14.36",
    "sufficient_data_to_create_template": true,
    "list_summary": {
      "title": "Earnings per share: $2.46 (1Y), $0.88 (Q2)",
      "plain_text": "EPS held flat since last year and increased 14.36% since last quarter.",
      "formatted_text": "EPS <span class=neutral>held flat</span> since last year and <span class=inc>increased 14.36% </span> since last quarter."
    },
    "summary": {
      "title": "KO EPS: $2.46 annual, $0.88 (Q2)",
      "plain_text": "EPS held flat since last year and increased 14.36% since last quarter.",
      "formatted_text": "EPS <span class=neutral>held flat</span> since last year and <span class=inc>increased 14.36% </span> since last quarter.",
      "a": "remained at",
      "b": "increased"
    },
    "what_it_means": {
      "title": "What does this mean?",
      "plain_text": "Flat EPS year-over-year, combined with increasing EPS quarter-over-quarter is an indication the company has taken a hit to its long-term profitability but has started to turn things around. This is an encouraging sign and could positively impact the stock's value.",
      "formatted_text": "<span class=neutral>Flat</span> EPS year-over-year, combined with <span class=inc>increased</span> EPS quarter-over-quarter is an indication the company has taken a hit to its long-term profitability but has started to turn things around. This is an encouraging sign and could <span class=inc>positively</span> impact the stock's value.",
      "a": "Flat",
      "b": "flat", 
      "c": "has taken a hit to its long-term profitability but has started to turn things around. This is an encouraging sign and could positively impact the stock's value."
    },
    "define": {
      "title": "What is earnings per share?",
      "formatted_text": "Earnings Per Share (EPS) divides the most recent 12 months of earnings or profits by the total number of common shares outstanding. <br><br> Annual Earnings / Number of Shares Outstanding = Earnings Per Share (EPS)",
      "plain_text": "Earnings Per Share (EPS) divides the most recent 12 months of earnings or profits by the total number of common shares outstanding. Annual Earnings / Number of Shares Outstanding = Earnings Per Share (EPS)"
    },
    "usage": {
      "title": "Why is earnings per share important?",
      "formatted_text": "Investors focus on Earnings Per Share (EPS) because it gives them a sense of how profits are trending. <br><br> Companies report EPS four times per year. Before each quarterly report, investment analysts publish estimates of what they expect those earnings to be. <br><br> If a company reports earnings much lower than the average analyst estimate, the stock price may drop. Similarly, if a company reports EPS much higher than expected, the stock price may increase. <br><br> Investors typically look for stocks where EPS is consistently increasing compared to previous quarters and years.",
      "plain_text": "Investors focus on Earnings Per Share (EPS) because it gives them a sense of how profits are trending. Companies report EPS four times per year. Before each quarterly report, investment analysts publish estimates of what they expect those earnings to be. If a company reports earnings much lower than the average analyst estimate, the stock price may drop. Similarly, if a company reports EPS much higher than expected, the stock price may increase. Investors typically look for stocks where EPS is consistently increasing compared to previous quarters and years."
    }
  },
  "timestamp": "2025-08-12T08:33:39.423Z"
}
```

### Usage Examples

#### Basic Usage

```javascript
const input = {
  "ticker": "AAPL"
};

// Run the actor
const run = await Actor.call('your-actor-name', input);

// Access the results
const data = run.dataset.items[0];
console.log(`${data.results.company_name} EPS: $${data.results.current_annual_value}`);
```

#### Multiple Stock Analysis

```javascript
const tickers = ['AAPL', 'GOOGL', 'MSFT', 'TSLA'];

for (const ticker of tickers) {
  const run = await Actor.call('the-actor-name', { ticker });
  const data = run.dataset.items[0];
  
  console.log(`${ticker}: Annual EPS $${data.results.current_annual_value}, Change: ${data.results.annual_percentage_change}%`);
}
```

### Error Handling

The actor includes comprehensive error handling:

#### Input Validation Errors

- **Missing ticker**: Returns error if no ticker provided
- **Invalid format**: Warns about non-standard ticker formats
- **Case normalization**: Automatically converts to uppercase

#### Runtime Errors

- **Data not found**: Returns structured error response
- **Network issues**: Logs error and returns error response
- **Parsing failures**: Captures and reports parsing errors

#### Error Response Format

```json
{
  "ticker": "INVALID",
  "timestamp": "2025-08-12T08:33:39.423Z",
  "error": "No total earnings per share data available",
  "revenueData": null
}
```

### Data Storage

The actor stores data in multiple formats:

#### Dataset Storage

All results are automatically pushed to the actor's dataset, making them accessible via:

- Apify Console
- API endpoints
- Download formats (JSON, CSV, Excel)

#### Key-Value Store

Summary data is stored in the key-value store under `NET_INCOME_SUMMARY` for quick access:

```json
{
  "ticker": "KO",
  "results": { /* Full results object */ },
  "completedAt": "2025-08-12T08:33:39.423Z"
}
```

### Rate Limits and Considerations

- **Source**: Data is fetched from CNN Business
- **Frequency**: Real-time data with timestamps
- **Limits**: Respect CNN's terms of service
- **Caching**: Consider implementing caching for frequently requested tickers

### Use Cases

#### Financial Analysis

- Portfolio performance tracking
- Earnings trend analysis
- Investment research
- Comparative stock analysis

#### Business Intelligence

- Competitor analysis
- Market research
- Financial reporting
- Dashboard creation

#### Educational Purposes

- Learning about EPS metrics
- Understanding financial ratios
- Stock market education
- Investment learning

### Troubleshooting

#### Common Issues

1. **"Stock ticker is required" error**
   - Ensure the `ticker` parameter is provided in the input

2. **"No total earnings per share data available"**
   - Verify the ticker symbol is correct and actively traded
   - Check if the company reports to US exchanges

3. **Invalid ticker format warning**
   - Use standard US stock ticker symbols (1-5 characters)
   - Avoid special characters or numbers

#### Debug Tips

- Check actor logs for detailed error messages
- Verify input format matches the schema
- Ensure ticker symbols are valid US stocks

### API Integration

#### REST API Example

```bash
curl -X POST \
  https://api.apify.com/v2/acts/the-actor-id/runs \
  -H 'Authorization: Bearer YOUR_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"ticker": "AAPL"}'
```

#### JavaScript SDK Example

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

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

const input = { ticker: 'GOOGL' };
const run = await client.actor('the-actor-id').call(input);

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items[0]);
```

### Important

For issues, questions, or feature requests:

- Check the actor logs for error details
- Verify input parameters match the schema
- Ensure ticker symbols are valid US stocks
- Contact support with specific error messages and input data

***

### 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)
- **Email**: <pintoflowpt@gmail.com>
- **Apify Platform**: You can also contact us directly through this platform.

***

# Actor input Schema

## `ticker` (type: `string`):

The stock ticker symbol to lookup (e.g., AAPL, GOOGL, TSLA). Must be a valid US stock ticker.

## Actor input object example

```json
{
  "ticker": "AAPL"
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("pintostudio/cnn-business-stock-earnings-per-share").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 = { "ticker": "AAPL" }

# Run the Actor and wait for it to finish
run = client.actor("pintostudio/cnn-business-stock-earnings-per-share").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 '{
  "ticker": "AAPL"
}' |
apify call pintostudio/cnn-business-stock-earnings-per-share --silent --output-dataset

```

## MCP server setup

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

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/eNiKoUZfvJsLsZ0ST/builds/wYGjGqMlvBfbmf5OW/openapi.json
