Skip to main content

Economic Calendar API Guide

The Economic Calendar API provides real-time and historical economic event data covering major global economies. Access upcoming releases, actual vs. forecast values, and detailed indicator metadata through a REST API, receive instant updates via WebSockets, and get push notifications through Webhooks.

Base URL: https://ecowing.theinvestinsight.com/api


Events​

List Events​

Retrieve a paginated list of economic calendar events with optional filters.

GET /api/events

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number (min: 1)
limitnumber50Items per page (min: 1, max: 200)
fromstring—Start date, ISO-8601 (e.g. 2026-02-01T00:00:00Z)
tostring—End date, ISO-8601 (e.g. 2026-02-28T23:59:59Z)
currenciesstring—Comma-separated currency codes (e.g. USD,EUR,JPY)
importancestring—Comma-separated levels (e.g. medium,high)
countrynumber—Numeric country code (e.g. 392 for Japan)
localestring—Locale code for translated content (see Multi-Language Support)

Example Request

GET /api/events?from=2026-02-01T00:00:00Z&to=2026-02-28T23:59:59Z&currencies=USD,EUR&importance=high&limit=10

Response

{
"data": [
{
"id": 286739,
"eventType": 0,
"eventName": "Nonfarm Payrolls",
"importance": "high",
"currencyCode": "USD",
"country": 840,
"countryName": "United States",
"forecastValue": "180K",
"previousValue": "256K",
"oldPreviousValue": null,
"actualValue": "143K",
"releaseDate": "2026-02-07T13:30:00.000Z",
"fullDate": "2026-02-07T13:30:00.000Z",
"impactDirection": 2,
"impactValue": "0.0012",
"impactValueF": ""
}
],
"meta": {
"page": 1,
"limit": 10,
"total": 87,
"totalPages": 9
}
}

Get Event​

Retrieve a single event by its ID.

GET /api/events/:id

Query Parameters

ParameterTypeRequiredDescription
localestringNoLocale code for translated content

Response — A single Event object.


Get Event Details​

Retrieve detailed metadata for an event's indicator — description, data source, sector, chart data, and upcoming release information.

Multiple events can share the same indicator (e.g. "Nonfarm Payrolls" each month is a different event, but the indicator is the same). Requesting details for any of those events returns the same data.

GET /api/events/:id/details

Query Parameters

ParameterTypeRequiredDescription
localestringNoLocale code for translated content

When locale is provided, the description, sector, and source fields are returned in the requested language (falls back to English if no translation is available).

Response

{
"data": {
"description": "Nonfarm Payrolls measures the change in the number of people employed...",
"sector": "Labor Market",
"source": "U.S. Bureau of Labor Statistics",
"nextReleaseDate": "2026-03-06T13:30:00.000Z",
"nextForecast": "170K",
"nextPrevious": "143K",
"chartData": [
{ "index": 0, "timestamp": 1706140800000, "value": 256 },
{ "index": 1, "timestamp": 1708819200000, "value": 143 }
]
},
"stale": false
}

If details haven't been fetched yet, the API triggers a background fetch and waits up to 10 seconds. If the fetch hasn't completed:

{
"data": null,
"stale": true,
"message": "Details are being fetched. Please retry shortly."
}

Get Event History​

Retrieve historical releases for an event's indicator. Like details, history is shared across all events with the same indicator.

GET /api/events/:id/history

Query Parameters

ParameterTypeDefaultDescription
pagenumber1Page number (min: 1)
limitnumber50Items per page (min: 1, max: 200)

Response

{
"data": [
{
"id": 501,
"releaseDate": "2026-02-07T13:30:00.000Z",
"period": "Jan 2026",
"actualValue": "143K",
"forecastValue": "180K",
"previousValue": "256K",
"oldPreviousValue": null,
"impactDirection": 2,
"impactValue": "0.0012",
"impactValueF": ""
}
],
"meta": {
"page": 1,
"limit": 50,
"total": 120,
"totalPages": 3
}
}

Multi-Language Support​

Pass the locale query parameter to receive translated content. The following endpoints support localization:

EndpointTranslated Fields
GET /api/eventseventName, countryName
GET /api/events/:ideventName, countryName
GET /api/events/:id/detailsdescription, sector, source

Supported Locales

CodeLanguage
enEnglish (default)
arArabic
deGerman
esSpanish
jaJapanese
ptPortuguese
ruRussian
trTurkish
zhChinese

If a translation is not available for the requested locale, the English value is returned as a fallback.

Example

GET /api/events?from=2026-03-01T00:00:00Z&to=2026-03-31T23:59:59Z&locale=es&importance=high
{
"data": [
{
"id": 286739,
"eventType": 0,
"eventName": "Discurso de la Presidenta del BCE Lagarde",
"importance": "high",
"currencyCode": "EUR",
"country": 999,
"countryName": null,
"releaseDate": "2026-03-15T09:30:00.000Z"
}
]
}

Webhooks​

Receive push notifications when economic events are created or updated. Configure a subscription with a delivery URL, choose which event types to listen for, and optionally filter by currency or importance level.

Create Subscription​

POST /api/webhooks

Request Body

{
"url": "https://example.com/webhooks/calendar",
"eventTypes": ["event.actual_released", "event.forecast_updated"],
"filters": {
"currencies": ["USD", "EUR"],
"importance": ["high"]
}
}
FieldTypeRequiredDescription
urlstringYesHTTPS endpoint to receive deliveries
eventTypesstring[]YesAt least one event type to subscribe to
filtersobjectNoNarrow deliveries by currency and/or importance

Response

{
"id": "550e8400-e29b-41d4-a716-446655440000",
"url": "https://example.com/webhooks/calendar",
"secret": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6",
"eventTypes": ["event.actual_released", "event.forecast_updated"],
"filters": {
"currencies": ["USD", "EUR"],
"importance": ["high"]
},
"active": true
}

Save the secret — it is only shown in full on creation. Use it to verify delivery signatures.


List Subscriptions​

GET /api/webhooks

Returns all subscriptions. Secrets are masked (first 8 + last 4 characters).


Get Subscription​

GET /api/webhooks/:id

Update Subscription​

PATCH /api/webhooks/:id

Request Body — All fields are optional.

{
"url": "https://example.com/webhooks/updated",
"eventTypes": ["event.created"],
"filters": {
"currencies": ["JPY"]
},
"active": false
}

Set active to false to pause deliveries without deleting the subscription.


Delete Subscription​

DELETE /api/webhooks/:id

Response

{
"deleted": true
}

Get Delivery Log​

Inspect the delivery history for a subscription.

GET /api/webhooks/:id/deliveries?page=1&limit=20

Response

{
"data": [
{
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"eventType": "event.actual_released",
"payload": { "event": { "id": 286739, "..." : "..." } },
"status": "delivered",
"attempts": 1,
"lastAttemptAt": "2026-02-07T13:31:05.000Z",
"responseStatus": 200,
"responseBody": "{\"received\":true}"
}
],
"meta": { "page": 1, "limit": 20, "total": 42, "totalPages": 3 }
}

Delivery Statuses: pending, delivered, failed


Event Types​

Event TypeTrigger
event.createdA new economic event appears on the calendar
event.actual_releasedThe actual value for an event is published
event.forecast_updatedThe forecast/consensus value changes
event.previous_revisedThe previous period's value is revised
event.details_updatedIndicator metadata (description, source, etc.) is refreshed

Delivery Format​

Each delivery is an HTTP POST to your subscription URL with the following headers:

HeaderDescription
Content-Typeapplication/json
X-Webhook-EventEvent type (e.g. event.actual_released)
X-Webhook-Delivery-IdUnique delivery ID for idempotency
X-Webhook-SignatureHMAC-SHA256 hex digest for payload verification

Payload Example (event.actual_released)

{
"event": {
"id": 286739,
"eventName": "Nonfarm Payrolls",
"currencyCode": "USD",
"importance": "high",
"actualValue": "143K",
"forecastValue": "180K",
"previousValue": "256K",
"releaseDate": "2026-02-07T13:30:00.000Z",
"country": 840,
"countryName": "United States"
},
"previousActual": null,
"newActual": "143K"
}

Retry Policy: Failed deliveries are retried up to 3 times with exponential backoff (10s, 20s, 40s). Each attempt has a 10-second timeout.


Verifying Signatures​

Every delivery includes an X-Webhook-Signature header. Verify it to ensure the request came from the Economic Calendar API and wasn't tampered with.

The signature is computed as:

HMAC-SHA256(raw_request_body, your_subscription_secret)

Node.js Example

import crypto from 'crypto';

function verifyWebhook(rawBody, signature, secret) {
const expected = crypto
.createHmac('sha256', secret)
.update(rawBody)
.digest('hex');
return crypto.timingSafeEqual(
Buffer.from(signature),
Buffer.from(expected),
);
}

Python Example

import hmac, hashlib

def verify_webhook(raw_body: bytes, signature: str, secret: str) -> bool:
expected = hmac.new(
secret.encode(), raw_body, hashlib.sha256
).hexdigest()
return hmac.compare_digest(signature, expected)

WebSocket (Real-Time)​

Receive real-time updates over a persistent connection using Socket.IO.

Connecting​

The WebSocket gateway runs on the same host as the REST API under the /events namespace.

import { io } from 'socket.io-client';

const socket = io('https://ecowing.theinvestinsight.com/events', {
transports: ['websocket'],
});

socket.on('connect', () => {
console.log('Connected:', socket.id);
});

All clients automatically join the general events room on connection and receive all broadcasts.


Subscribing to Rooms​

Send a subscribe message to receive updates filtered to specific currencies or event IDs.

socket.emit('subscribe', {
currencies: ['USD', 'EUR'],
eventIds: [286739],
}, (ack) => {
console.log(ack);
// { status: 'ok', rooms: ['events', 'events:USD', 'events:EUR', 'events:286739'] }
});
FieldTypeDescription
currenciesstring[]Subscribe to currency-specific rooms
eventIdsnumber[]Subscribe to individual event rooms

Rooms:

Room PatternExampleReceives
eventseventsAll events (joined automatically)
events:{CURRENCY}events:USDEvents for that currency only
events:{ID}events:286739Updates for a specific event only

Unsubscribing​

socket.emit('unsubscribe', {
currencies: ['EUR'],
eventIds: [286739],
}, (ack) => {
console.log(ack); // { status: 'ok' }
});

Receiving Events​

All updates arrive on the event message:

socket.on('event', (message) => {
console.log(message.type); // 'event.actual_released'
console.log(message.timestamp); // '2026-02-07T13:31:00.000Z'
console.log(message.data); // { eventId, eventName, currencyCode, actualValue, ... }
});

Message Shape

{
"type": "event.actual_released",
"timestamp": "2026-02-07T13:31:00.000Z",
"data": {
"eventId": 286739,
"eventName": "Nonfarm Payrolls",
"currencyCode": "USD",
"actualValue": "143K",
"previousActual": null
}
}

The type field matches the same event types used by webhooks.


Data Reference​

Event Object​

FieldTypeDescription
idnumberUnique event ID
eventTypenumber0 = speech/report, 1 = numeric indicator, 2 = holiday
eventNamestringHuman-readable event name (translatable)
importancestringlow, medium, high, or none (holidays)
currencyCodestringISO currency code (e.g. USD, EUR)
countrynumberNumeric country code
countryNamestringnull
forecastValuestringnull
previousValuestringnull
oldPreviousValuestringnull
actualValuestringnull
releaseDatestringScheduled release time (ISO-8601, UTC)
fullDatestringFull date/time (ISO-8601, UTC)
impactDirectionnumber0 = neutral, 1 = positive, 2 = negative
impactValuestringnull
impactValueFstringnull

Detail Object​

FieldTypeDescription
descriptionstringnull
sectorstringnull
sourcestringnull
nextReleaseDatestringnull
nextForecaststringnull
nextPreviousstringnull
chartDataarraynull

History Row Object​

FieldTypeDescription
idnumberRow ID
releaseDatestringRelease date (ISO-8601, UTC)
periodstringReporting period (e.g. "Jan 2026")
actualValuestringnull
forecastValuestringnull
previousValuestringnull
oldPreviousValuestringnull
impactDirectionnumber0 = neutral, 1 = positive, 2 = negative
impactValuestringnull
impactValueFstringnull

Pagination​

All list endpoints return paginated results:

{
"data": [],
"meta": {
"page": 1,
"limit": 50,
"total": 1200,
"totalPages": 24
}
}

Importance Levels​

ValueDescription
noneHolidays and market closures
lowMinor impact — typically market commentary
mediumModerate impact — secondary economic indicators
highMajor impact — key releases (NFP, CPI, GDP, rate decisions)

Currency Codes​

Common values: USD, EUR, GBP, JPY, AUD, CAD, CHF, NZD, CNY

The currencies filter accepts any code returned by the API. Use GET /api/events without a currency filter to discover all available codes.