# TradingView News & Calendar Digest (`saffron_discussion/tradingview-news-calendar`) Actor

Pull market news and earnings/IPO/economic calendar events into a dataset for digests and bots.

- **URL**: https://apify.com/saffron\_discussion/tradingview-news-calendar.md
- **Developed by:** [barry Alan](https://apify.com/saffron_discussion) (community)
- **Categories:** News, Developer tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 news items

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

## TradingView News & Calendar Digest

Pull **market news** and/or **earnings / IPO / economic calendar** events into a Dataset for digests, bots, and research agents.

Powered by [TradingView Data API](https://www.tradingviewapi.com) (`GET /api/news/…` and `GET /api/calendar/…`). **Not** official TradingView. Each run is a snapshot of the feed, not a live firehose.

### What you get

One run can fetch news, calendar, or **both**. Each item becomes its own Dataset row with `kind` = `news` or `calendar`.

**News** — headlines with ids, titles, timestamps, related symbols, and story paths. Categories: `general`, `stock`, `crypto`, `forex`, `futures`, `index`, `bond`, `etf`, `economic`. Optionally filter with `symbol`.

**Calendar** — dated events:

| `calendarType` | Typical content |
|----------------|-----------------|
| `earnings` | Earnings releases (default) |
| `economic` | Macro / economic calendar |
| `ipo` | IPO calendar |
| `revenue` | Revenue-related events |

`from` / `to` are Unix seconds. If omitted, the Actor uses roughly **the last 7 days through the next 14 days**. Upstream windows are typically **≤ ~40 days** — split long ranges into several runs.

`limit` is **per kind** (default 30, max **100**). `mode=both` with `limit=20` can write up to 40 rows (20 news + 20 calendar). It is **not** stuck at 5 rows; 5 was only a test input. A full earnings window can contain thousands of events upstream — raise `limit` or page `from`/`to` if you need more than 100.

### How to use

1. Set `mode` to `news`, `calendar`, or `both`.
2. Pick `newsCategory` and/or `calendarType`.
3. Set `limit` to how many items you want **per kind** (1–100).
4. For calendar, optionally pass `from` and `to` (Unix seconds).
5. Run or schedule. Export JSON / CSV / Excel.

#### Example — stock news + earnings

```json
{
  "mode": "both",
  "newsCategory": "stock",
  "calendarType": "earnings",
  "limit": 20
}
```

#### Example — custom calendar window

```json
{
  "mode": "calendar",
  "calendarType": "earnings",
  "from": 1755129600,
  "to": 1757808000,
  "limit": 100
}
```

### Input

| Field | Required | Description |
|-------|----------|-------------|
| `mode` | yes | `news` | `calendar` | `both` |
| `newsCategory` | no | Default `stock` |
| `calendarType` | no | `earnings` | `economic` | `ipo` | `revenue` |
| `symbol` | no | Optional news symbol filter |
| `limit` | no | Max items **per kind** (default 30, max 100) |
| `from` / `to` | no | Calendar window as Unix seconds |

No user API key is required.

### Output

| Field | Meaning |
|-------|---------|
| `kind` | `news` or `calendar` |
| `newsCategory` / `calendarType` | Echo of the input used |
| `scrapedAt` | ISO timestamp for the run |
| *(plus upstream fields)* | Headline, dates, symbols, forecasts, … |

### Pricing (pay per event)

| Event | When |
|-------|------|
| `digest-run` | Once per news fetch and once per calendar fetch |
| `news-item` | Per news row |
| `calendar-event` | Per calendar row |

`mode=both`, 20 + 20 items ⇒ 2× `digest-run` + 20× `news-item` + 20× `calendar-event`.

### Limits and notes

- News feeds move quickly; two runs a minute apart can differ by a few headlines.
- Calendar `limit` caps rows billed; it does not download an entire 2,000-event window.
- Not investment advice. Unofficial wrapper around [TradingView Data API](https://www.tradingviewapi.com).

### Related Actors

- [Leaderboard Snapshot](https://apify.com/saffron_discussion/tradingview-leaderboard)
- [Fundamentals Card](https://apify.com/saffron_discussion/tradingview-fundamentals)
- [Screener Export](https://apify.com/saffron_discussion/tradingview-screener)
- [Quote + TA Batch](https://apify.com/saffron_discussion/tradingview-quote-ta)

# Actor input Schema

## `mode` (type: `string`):

Mode

## `newsCategory` (type: `string`):

News category

## `calendarType` (type: `string`):

Calendar type

## `symbol` (type: `string`):

Symbol filter (news)

## `limit` (type: `integer`):

Max items per kind

## `from` (type: `integer`):

Calendar from (unix sec)

## `to` (type: `integer`):

Calendar to (unix sec)

## `apiKey` (type: `string`):

API key override

## Actor input object example

```json
{
  "mode": "news",
  "newsCategory": "stock",
  "calendarType": "earnings",
  "limit": 30
}
```

# Actor output Schema

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

Default dataset with news and calendar records.

# 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 = {
    "mode": "news"
};

// Run the Actor and wait for it to finish
const run = await client.actor("saffron_discussion/tradingview-news-calendar").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 = { "mode": "news" }

# Run the Actor and wait for it to finish
run = client.actor("saffron_discussion/tradingview-news-calendar").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 '{
  "mode": "news"
}' |
apify call saffron_discussion/tradingview-news-calendar --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,saffron_discussion/tradingview-news-calendar"
        }
    }
}

```

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/dfrLhE0w0aPwkOEVC/builds/6NoOiwM9mOlIaxAUE/openapi.json
