# Stock Insights (`pintostudio/stock-insights`) Actor

Fetch detailed fair value insights and key financial indicators for global stocks from Investing.com using this Apify Actor.

- **URL**: https://apify.com/pintostudio/stock-insights.md
- **Developed by:** [Pinto Studio](https://apify.com/pintostudio) (community)
- **Categories:** Developer tools, Other, Automation
- **Security:** Limited permissions
- **Stats:** 5 total users, 0 monthly users, 100.0% runs succeeded, 1 bookmarks
- **User rating**: No ratings yet

## Pricing

from $7.40 / 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 Insights Data (Investing.com) - Apify Actor

Fetch detailed fair value insights and key financial indicators for global stocks from [Investing.com](https://www.investing.com) using this Apify Actor.

***

### 🧠 What It Does

This Actor scrapes **stock fair value data** and **financial insights** (a.k.a. "finsights") from Investing.com, including sentiment analysis and relevance-weighted metrics.

It’s useful for:

- Financial research
- Building investment dashboards
- Detecting undervalued or overvalued stocks
- Tracking buybacks, dividends, and valuation metrics

***

### 📥 Input Schema

| Field        | Type     | Required | Description                                                                 |
|--------------|----------|----------|-----------------------------------------------------------------------------|
| `stockSymbol`| `string` | ✅ Yes    | The stock ticker symbol (e.g. `AAPL`, `MSFT`, `BBVA`)                      |
| `country`    | `string` | ❌ No     | Country where the stock is listed (default: `united states`)              |

#### Supported Countries

- United States
- United Kingdom
- Spain
- Germany
- France
- Italy
- Netherlands
- Belgium
- Portugal
- Austria
- Switzerland
- Sweden
- Norway
- Denmark
- Finland
- Poland
- Czech Republic
- Hungary
- Greece
- Turkey
- Russia
- China
- Japan
- South Korea
- India
- Australia
- Canada
- 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 Example

The Actor returns a JSON object containing:

- `company_name`: Full name of the company
- `finsights`: Array of financial insights (metrics + sentiment)
- `metric`: Contains:
  - `slug`: Metric name
  - `value`: Metric numeric value
  - `currency`: If applicable (e.g., `USD`)
  - `scale`: Scaling factor (e.g., `1`, `1,000,000`)
  - `percentile`: Ranking percentile vs. peers
- `sentiment`: One of `WIN`, `WARN`, or `WOE`
- `relevance`: Importance score (0–100)
- `brief`: Summary description
- `locked`: Whether the data is fully accessible or restricted

#### Example Output

```json
{
  "company_name": "Apple Inc.",
  "finsights": [
    {
      "tags": ["value"],
      "brief": "Management has been aggressively buying back shares",
      "sentiment": "WIN",
      "relevance": 92.5,
      "metric": {
        "slug": "buyback_yield",
        "value": 0.034,
        "currency": "",
        "scale": 1,
        "percentile": 0.86
      },
      "locked": false
    },
    {
      "tags": ["dividend"],
      "brief": "Has raised its dividend for 13 consecutive years",
      "sentiment": "WIN",
      "relevance": 75,
      "metric": {
        "slug": "div_growth_streak",
        "value": 13,
        "currency": "",
        "scale": 1,
        "percentile": 1
      },
      "locked": false
    }
    // ...more finsights
  ]
}
```

> 🔐 Some insights may be `locked` depending on availability or Investing.com restrictions.

***

### 🛠️ How It Works

1. Receives `stockSymbol` and `country` as input.
2. Validates inputs and logs activity.
3. make the calls to retrieve the data.
4. Pushes detailed insight records to the dataset.
5. Stores a summary in a key-value store (`insights_summary`) with:

   - `stock`, `country`, `retrieved_at`, etc.
   - Metadata like `top_finsight`, `company_name`, and `has_data`

***

### 📦 Dataset & Storage

- All results are pushed to the Actor's **default dataset**.
- A summary object is stored in the Actor's **Key-value store** as `insights_summary`.

***

### ❌ Error Handling

If the Actor fails due to bad inputs or request errors, it will:

- Log a detailed error to Apify logs
- Call `Actor.fail()` to stop gracefully
- Return an object with `has_data: false` and `error` message

***

### ▶️ Example Run

Input:

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

Output Summary (`insights_summary`):

```json
{
  "stock": "AAPL",
  "country": "united states",
  "stock_symbol": "AAPL",
  "company_name": "Apple Inc.",
  "has_data": true,
  "finsights_count": 13,
  "top_finsight": {
    "brief": "Management has been aggressively buying back shares",
    "relevance": 92.5
  },
  "retrieved_at": "2025-07-03T14:10:00Z"
}
```

***

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

## `insights` (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-insights").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-insights").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-insights --silent --output-dataset

```

## MCP server setup

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

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/QXvEljyIY4R29r9MX/builds/Es9VyANecfarhtzBb/openapi.json
