# Economic Calendar Data Scraper (`codingfrontend/economic-calendar-data-scraper`) Actor

Extracts public Investing.com economic-calendar events with event name, country, date/time, importance, actual, forecast, previous, and evidence-backed access diagnostics. Direct requests only; access boundaries are reported and never bypassed.

- **URL**: https://apify.com/codingfrontend/economic-calendar-data-scraper.md
- **Developed by:** [Coding Frontned](https://apify.com/codingfrontend) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## Economic Calendar Data Scraper

Extract public economic-calendar events from official Investing.com calendar pages when the source exposes event state or table markup. Event rows retain published names, countries, currencies, dates, times, importance, actual/forecast/previous values, units, source URLs, and scrape time.

### Public-data boundary

Normal events contain business fields plus source provenance (`sourceId`, `sourceDomain`, `canonicalUrl`, and `sourceUrl`); they omit row-type, extraction/transport, and run instrumentation. Diagnostics use `recordType: "diagnostic"`, a specific `diagnosticType`/`errorCode`, source URL/domain, HTTP status when available, error text, and `scrapedAt`. Diagnostics never count as event rows.

Only public Investing.com HTTPS pages are requested. The Actor does not solve CAPTCHAs, use stealth, bypass access controls, or fabricate placeholder events. A blocked, redirected, empty, or failed source produces a truthful diagnostic row with exactly `url`, `error`, `errorCode`, and `scrapedAt`.

### Input

- `calendarUrl`, `startUrls`: official public Investing.com calendar URLs.
- `maxResults`, `maxEvents`, `timeoutSecs`, `userAgent`, and `acceptLanguage`: bounded source/request controls.
- `countries`, `importance`, `dateFrom`, and `dateTo`: caller-provided filter metadata accepted for compatibility.
- `proxyConfiguration`: optional standard Apify Proxy configuration for the public page request. `OUTPUT_SUMMARY` reports whether it was used; proxying does not bypass access controls.
- `publicReaderFallback`: opt-in bounded fallback after the direct/standard Proxy attempt. It reads the official mobile Investing.com calendar through the public Jina Reader representation, labels normal rows with `provenance=public-investing-reader` and `readerUrl`, and reports reader counters in `OUTPUT_SUMMARY`.
- `fixturePath` with `testMode: true`: relative local HTML fixture mode for deterministic QA.

### Output

Normal rows contain only event business fields and source provenance: `eventId`, `eventName`, `country`, `currency`, `date`, `time`, `importance`, `actual`, `forecast`, `previous`, `unit`, `sourceUrl`, `canonicalUrl`, `rawText`, and `scrapedAt`. Inventory ranks, actor/store metadata, final-request/extraction metadata, bypass flags, field-coverage objects, and internal quality metadata are not emitted to the dataset.

Run counts and failure evidence are stored separately in the `OUTPUT_SUMMARY` key-value-store record.

### Local validation

```bash
npm install --ignore-scripts --no-audit --no-fund
npm run check
npm run validate
APIFY_LOCAL_STORAGE_DIR=../.actor-batches/local-only-batch-zepto-scraper/qa/economic-calendar-fixture apify run --purge --input-file test/inputs/fixture.json
npm run validate:dataset
```

You can download the dataset from the Storage tab after a run.

# Actor input Schema

## `calendarUrl` (type: `string`):

Public Investing.com economic-calendar URL.

## `startUrls` (type: `array`):

Optional public calendar URLs.

## `countries` (type: `array`):

Reserved caller-side filter metadata.

## `importance` (type: `integer`):

Reserved caller-side importance filter metadata.

## `dateFrom` (type: `string`):

Reserved caller-side date filter metadata.

## `dateTo` (type: `string`):

Reserved caller-side date filter metadata.

## `maxResults` (type: `integer`):

Maximum calendar pages to inspect.

## `maxEvents` (type: `integer`):

Maximum economic-calendar events to emit.

## `timeoutSecs` (type: `integer`):

Maximum time for each public request.

## `maxRetries` (type: `integer`):

Bounded retries for transient public HTTP responses.

## `userAgent` (type: `string`):

Optional transparent user-agent string.

## `acceptLanguage` (type: `string`):

Optional language preference.

## `proxyConfiguration` (type: `object`):

Optional standard Apify Proxy configuration for the public Investing.com request; no access-control bypass is attempted.

## `publicReaderFallback` (type: `boolean`):

After a bounded direct/standard Proxy failure, optionally read the official mobile Investing.com calendar through the explicitly labeled public reader; no login, CAPTCHA, or access-control bypass is attempted.

## `fixturePath` (type: `string`):

Relative local HTML fixture for deterministic validation.

## `testMode` (type: `boolean`):

Run against fixturePath instead of making a live request.

## Actor input object example

```json
{
  "calendarUrl": "https://www.investing.com/economic-calendar/",
  "startUrls": [],
  "countries": [],
  "maxResults": 5,
  "maxEvents": 100,
  "timeoutSecs": 20,
  "maxRetries": 1,
  "acceptLanguage": "en-US,en;q=0.8",
  "publicReaderFallback": false,
  "testMode": false
}
```

# Actor output Schema

## `dataset` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

## `legacyRunSummary` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("codingfrontend/economic-calendar-data-scraper").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 = {}

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

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,codingfrontend/economic-calendar-data-scraper"
        }
    }
}
```

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/zQ3qZnx0D1bCkWFFq/builds/jDev2zLJbY7qVgXFv/openapi.json
