### Webhook post_created payload example
Source: https://docs.fxstreet.com/api/news/webhooks
Example of the JSON payload sent when a post is created, containing the post ID and associated metadata.
```json
{
"type": "post_created",
"postId": "5e5f6e2f-7e6f-404e-bd1a-456558f0de11",
"feedId": "5e5f6e2f-7e6f-404e-bd1a-456558f0de11",
"languageId": "5e5f6e2f-7e6f-404e-bd1a-456558f0de11"
}
```
--------------------------------
### Configure timezone-offset parameter
Source: https://docs.fxstreet.com/widgets/calendar/charts/actual-and-deviation
Examples of setting the timezone-offset parameter for different time zones or the user's browser.
```html
timezone-offset="-60"
timezone-offset="300"
timezone-offset="new Date().getTimezoneOffset()"
```
--------------------------------
### Javascript Calendar Subscription
Source: https://docs.fxstreet.com/api/calendar/v4/notifications
Example of subscribing to calendar notifications using the Javascript client.
```javascript
```
--------------------------------
### API Request with Authorization Header via cURL
Source: https://docs.fxstreet.com/api/authentication/oauth2/v2
Example of including the Bearer token in an API request header.
```bash
curl -X GET -H "Authorization: {token_type} {access_token}" https://calendar-api.fxstreet.com/en/api/v1/marketImpact/assets
```
--------------------------------
### Obtain Access Token JSON Response
Source: https://docs.fxstreet.com/api/authentication/oauth2/v2
Example of the JSON response received from the authorization server upon successful authentication.
```json
{
"access_token": "pkxvMZk7eRoHT5H3hl8qXwUYt0wDcUlQr4NOpK3vLsUnMzC76h0koyxwKF8N",
"token_type": "Bearer",
"expires_in": 86399
}
```
--------------------------------
### GET /xml, /rss, /json
Source: https://docs.fxstreet.com/api/news/metatrader/parameters
Retrieves the news feed in the specified format. Requires a client key and an item identifier.
```APIDOC
## GET https://subscriptions.fxstreet.com/{format}
### Description
Retrieves the news feed in XML, RSS, or JSON format based on the endpoint path.
### Method
GET
### Endpoint
https://subscriptions.fxstreet.com/xml
https://subscriptions.fxstreet.com/rss
https://subscriptions.fxstreet.com/json
### Parameters
#### Query Parameters
- **key** (string) - Required - A 20-digit unique client key containing [0-9] and [A-F] characters.
- **item** (string) - Required - The identifier for the specific news feed (e.g., 'englishnewscharts', 'spanishnewscharts').
### Response
#### Success Response (200)
- Returns the news feed in the requested format (XML, RSS, or JSON).
#### Error Handling
- **must specify client key**: Returned if the 'key' parameter is missing.
- **must specify item**: Returned if the 'item' parameter is missing.
- **not authorized**: Returned if the client key is invalid or the requested item is not included in the contract.
```
--------------------------------
### GET /xml/news.aspx
Source: https://docs.fxstreet.com/api/news/metatrader/usage
Retrieves the news feed in XML format.
```APIDOC
## GET /xml/news.aspx
### Description
Retrieves the news feed in XML format.
### Method
GET
### Endpoint
https://subscriptions.fxstreet.com/xml/news.aspx
### Parameters
#### Query Parameters
- **c** (string) - Required - The client key.
- **i** (string) - Required - The item identifier.
```
--------------------------------
### GET /rss/news.aspx
Source: https://docs.fxstreet.com/api/news/metatrader/usage
Retrieves the news feed in RSS format.
```APIDOC
## GET /rss/news.aspx
### Description
Retrieves the news feed in RSS format.
### Method
GET
### Endpoint
https://subscriptions.fxstreet.com/rss/news.aspx
### Parameters
#### Query Parameters
- **c** (string) - Required - The client key.
- **i** (string) - Required - The item identifier.
```
--------------------------------
### Webhook Notification Payload
Source: https://docs.fxstreet.com/api/news/webhooks
Example of the payload sent to your webhook endpoint when a post is created.
```APIDOC
## Webhook Notification Payload
### Description
When a subscribed event occurs, the server sends a POST request to your configured endpoint. You must respond with a `200 OK` or `204 No Content` status code.
### Request Example
{
"type": "post_created",
"postId": "5e5f6e2f-7e6f-404e-bd1a-456558f0de11",
"feedId": "5e5f6e2f-7e6f-404e-bd1a-456558f0de11",
"languageId": "5e5f6e2f-7e6f-404e-bd1a-456558f0de11"
}
```
--------------------------------
### GET /json/news.aspx
Source: https://docs.fxstreet.com/api/news/metatrader/usage
Retrieves the news feed in JSON format.
```APIDOC
## GET /json/news.aspx
### Description
Retrieves the news feed in JSON format.
### Method
GET
### Endpoint
https://subscriptions.fxstreet.com/json/news.aspx
### Parameters
#### Query Parameters
- **c** (string) - Required - The client key.
- **i** (string) - Required - The item identifier.
```
--------------------------------
### Insecure dynamic parameter injection
Source: https://docs.fxstreet.com/widgets/calendar/utilities
Example of an insecure implementation susceptible to XSS when evaluating query string parameters directly.
```html
```
--------------------------------
### GET /v4/{culture}/institutionalhtmlGenerator/default/{date}/
Source: https://docs.fxstreet.com/widgets/dailymarket-analysis
Retrieves a daily market analysis report for a specific date.
```APIDOC
## GET /v4/{culture}/institutionalhtmlGenerator/default/{date}/
### Description
Retrieves the daily market analysis report for a specific date in YYYY-MM-DD format.
### Method
GET
### Endpoint
https://subscriptions.fxstreet.com/v4/{culture}/institutionalhtmlGenerator/default/{date}/
### Parameters
#### Path Parameters
- **culture** (string) - Required - The language code (e.g., en-US, es-ES, zh-CN).
- **date** (string) - Required - The specific date in YYYY-MM-DD format.
#### Query Parameters
- **c** (string) - Required - The client secret key provided by the sales department.
```
--------------------------------
### GET /evendate/{IdEcoCalendarDate}
Source: https://docs.fxstreet.com/api/calendar/v4/introduction
Retrieves details for a specific event date using its unique identifier.
```APIDOC
## GET /evendate/{IdEcoCalendarDate}
### Description
Retrieves information for a specific event date. This endpoint is intended to be polled until a result is returned.
### Method
GET
### Endpoint
/evendate/{IdEcoCalendarDate}
### Parameters
#### Path Parameters
- **IdEcoCalendarDate** (string) - Required - The unique identifier for the event date.
```
--------------------------------
### Webhook Payload: event_created
Source: https://docs.fxstreet.com/api/calendar/webhooks
Example JSON payload received when a new event is created, containing only the event ID.
```json
{
"type": "event_created",
"eventId": "5e5f6e2f-7e6f-404e-bd1a-456558f0de11"
}
```
--------------------------------
### Initialize with options
Source: https://docs.fxstreet.com/api/signalr
Configure the push notification instance with specific options such as culture settings.
```javascript
```
--------------------------------
### fxsWidgets.loadAll
Source: https://docs.fxstreet.com/widgets/calendar/utilities
Triggers the loading of all available widgets on the page.
```APIDOC
## fxsWidgets.loadAll(force?: boolean)
### Description
Triggers a load of all widgets of any name. By default, only uninitialized widgets are loaded unless forced.
### Parameters
- **force** (boolean) - Optional - If true, all widgets are completely re-rendered. Default: false.
### Usage Example
```javascript
fxsWidgets.loadAll();
fxsWidgets.loadAll(true);
```
```
--------------------------------
### Initialize Interest Rates Widget
Source: https://docs.fxstreet.com/widgets/calendar/v1/interest-rates
Basic HTML structure and script initialization for the Interest Rates widget.
```html
```
--------------------------------
### Initialize OneSignal Protocol
Source: https://docs.fxstreet.com/widgets/calendar/widget
Specifies the protocol or subdomain for OneSignal communication.
```html
init-one-signal="https"
init-one-signal="subdomainName"
```
--------------------------------
### Calendar Lite Implementation
Source: https://docs.fxstreet.com/widgets/calendar/v1/lite
This snippet demonstrates how to initialize the Calendar Lite widget by defining the fxcalendar_config object and including the widget script.
```APIDOC
## Calendar Lite Widget Integration
### Description
Embeds a lightweight version of the FXStreet calendar into a webpage. Note: This widget is deprecated.
### Configuration Object (fxcalendar_config)
- **host** (string) - Required - The base URL for the calendar service (e.g., "https://calendar.fxstreet.com").
- **eventurl** (string) - Required - The URL to the main calendar page.
- **culture** (string) - Required - The locale code for display (e.g., "es-ES").
### Implementation Example
```html
```
```
--------------------------------
### Webhook Payload: eventDate_updated
Source: https://docs.fxstreet.com/api/calendar/webhooks
Example JSON payload received when an event occurrence is updated.
```json
{
"type": "eventDate_updated",
"eventDateId": "4fe1bd69-acce-4b24-9d54-f45c81708d29",
"eventId": "5e5f6e2f-7e6f-404e-bd1a-456558f0de11",
"lastUpdated": 1628063061,
"changes": [
{
"key": "dateUtc",
"value": "2019-03-21T10:30:00Z"
},
{
"key": "actual",
"value": 0.2
},
{
"key": "revised",
"value": 0.4
}
]
}
```
--------------------------------
### Connect to SignalR Hub in C#
Source: https://docs.fxstreet.com/api/news/notifications
Establishes a connection to the PostHub and subscribes to post events using an access token.
```csharp
var token = getTokenApi();
var queryStringToken = string.Format("?access_token={0}", token.AccessToken);
var hubConnection = new HubConnection("https://httppush.fxstreet.com/", queryStringToken);
var hubProxy = hubConnection.CreateHubProxy("PostHub");
hubProxy.On("postCreated", data =>
{
var post = data;
});
hubProxy.On("postDeleted", data =>
{
var postId = data;
});
hubConnection.Start().ContinueWith(x =>
{
hubProxy.Invoke("subscribe", "en-US", "NewsPushNotification");
}).Wait();
```
--------------------------------
### Implement Calendar Widget (v1)
Source: https://docs.fxstreet.com/widgets/calendar/v1/main
Basic HTML structure and configuration script for embedding the calendar widget. Ensure the grid and filter selectors match the IDs defined in the HTML body.
```html
```
--------------------------------
### GET /v4/{culture}/institutionalhtmlGenerator/default/
Source: https://docs.fxstreet.com/widgets/dailymarket-analysis
Retrieves the latest daily market analysis report for a specified culture.
```APIDOC
## GET /v4/{culture}/institutionalhtmlGenerator/default/
### Description
Retrieves the latest daily market analysis report in HTML format for the specified culture.
### Method
GET
### Endpoint
https://subscriptions.fxstreet.com/v4/{culture}/institutionalhtmlGenerator/default/
### Parameters
#### Path Parameters
- **culture** (string) - Required - The language code (e.g., en-US, es-ES, zh-CN).
#### Query Parameters
- **c** (string) - Required - The client secret key provided by the sales department.
```
--------------------------------
### Load all widgets
Source: https://docs.fxstreet.com/widgets/calendar/utilities
Triggers the loading of all available widgets. Use the force parameter to re-render all widgets.
```javascript
fxsWidgets.loadAll();
fxsWidgets.loadAll(true);
```
--------------------------------
### Initialize FXStreetPush instance
Source: https://docs.fxstreet.com/api/signalr
Retrieve the singleton instance of the PushNotification class to begin using the library.
```javascript
```
--------------------------------
### Handle library loading state
Source: https://docs.fxstreet.com/widgets/calendar/utilities
Checks the library load status and either executes logic immediately or attaches an event listener for future loading.
```javascript
if (fxsWidgets && fxsWidgets.loaded) { /* Library already loaded */
console.log('FXS Widgets loaded');
// DO SOMETHING
} else { /* Widgets not loaded yet */
window.addEventListener('fxsWidgetsLoaded', () => {
console.log('FXS Widgets loaded');
// DO SOMETHING
})
}
```
--------------------------------
### Embed the Event Timer Widget
Source: https://docs.fxstreet.com/widgets/calendar/v1/event-timer
Include the configuration script, the widget container div, and the core widget library script to render the timer.
```html
```
--------------------------------
### Widget Configuration Parameters
Source: https://docs.fxstreet.com/widgets/calendar/widget
The following parameters can be used to configure the behavior and display of the Economic Calendar widget.
```APIDOC
## Widget Parameters
### culture
- **Type**: String (Optional)
- **Description**: Sets the language in which the widget should be displayed. Default is 'en'.
### timezone-offset
- **Type**: Integer (Optional)
- **Description**: Sets the timezone offset in minutes from UTC. Positive values indicate timezones behind UTC, negative values indicate timezones ahead of UTC. Default is 0.
### country-code
- **Type**: String (Optional)
- **Description**: A comma-separated list of ISO 3166-1 alpha-2 country codes to filter events. 'EMU' is supported for the European Monetary Union.
### notification-sound-url
- **Type**: String (Optional)
- **Description**: The URL of an MP3 file to play when an update notification occurs.
### dashboard-url
- **Type**: String (Optional)
- **Description**: A custom URL template for event details. Use '{eventId}' as a placeholder for the event ID.
### one-signal-app-id
- **Type**: String (Optional)
- **Description**: The OneSignal App ID to enable push notification subscriptions for events.
### init-one-signal
- **Type**: String (Optional)
- **Description**: Configures OneSignal protocol. Use 'https' for HTTPS or a subdomain name for HTTP.
### safari-web-id
- **Type**: String (Optional)
- **Description**: Required for enabling OneSignal push notifications in Safari.
### has-posts
- **Type**: Boolean (Optional)
- **Description**: Enables the display of news related to calendar events. Requires a news service subscription.
### custom-post-url
- **Type**: String (Optional)
- **Description**: A custom URL template for news publications. Use '{postId}' as a placeholder.
```
--------------------------------
### POST /webhooks
Source: https://docs.fxstreet.com/api/calendar/webhooks
Documentation for the webhook registration endpoint, which allows users to subscribe to specific calendar events.
```APIDOC
## POST /webhooks
### Description
Registers a new webhook URL to receive notifications for specific calendar events. The server will send POST requests to the registered URL when subscribed events occur.
### Method
POST
### Endpoint
/webhooks
### Notes
- Limit: Maximum of two URLs for new webhook registrations.
- Error: Returns 444 if the registration limit is reached.
- Requirement: Your server must respond with a 200 OK or 204 No Content status code to acknowledge receipt of the notification.
```
--------------------------------
### Include fxspush.js library
Source: https://docs.fxstreet.com/api/signalr
Include the fxspush.js script tag in your HTML to enable push notifications.
```html
```
--------------------------------
### fxstreet.interestRates()
Source: https://docs.fxstreet.com/widgets/calendar/v1/interest-rates
Initializes and renders the Interest Rates widget within a specified HTML element.
```APIDOC
## fxstreet.interestRates(options)
### Description
Initializes the Interest Rates widget and renders it into the DOM element specified by the `id` parameter.
### Parameters
- **id** (string) - Required - The ID of the HTML element where the widget will be rendered.
- **culture** (string) - Optional - The display culture (e.g., "en-us").
- **timezone** (string) - Optional - The timezone for the widget (e.g., "UTC").
- **zone** (string) - Optional - The geographical zone or country code to display (e.g., "all").
- **chart** (number) - Optional - Toggle for charts (1 for on).
### Usage Example
```javascript
fxstreet.interestRates({
id: "your-id-here",
culture: "en-us",
timezone: "UTC",
zone: "all",
chart: 1
});
```
```
--------------------------------
### Volatility Ratio Chart Widget Configuration
Source: https://docs.fxstreet.com/widgets/calendar/charts/volatility
The widget is configured using HTML attributes to define the event, display language, timezone, available assets, and chart behavior.
```APIDOC
## Volatility Ratio Chart Widget Configuration
### Description
Configure the Volatility Ratio Chart Widget by setting attributes on the widget element.
### Parameters
- **event-id** (string) - Required - The recurrent event ID (retrieved via Economic Calendar API).
- **culture** (string) - Optional - Language code for the widget display (Default: 'en').
- **timezone-offset** (number) - Optional - Timezone difference in minutes from UTC (Default: 0).
- **assets** (string) - Optional - Comma-separated list of asset IDs for the picker.
- **take** (number) - Optional - Maximum number of data points to show by default (Default: 60).
- **zoomable** (boolean) - Optional - Enables mouse-scroll and zoom buttons (Default: true).
- **allow-download** (boolean) - Optional - Enables SVG/PNG image download (Default: true).
```
--------------------------------
### Listen for fxsWidgetsLoaded event
Source: https://docs.fxstreet.com/widgets/calendar/utilities
Registers a listener on the Window interface to detect when the library has finished loading. Note that this listener will not execute if the library is already loaded.
```javascript
window.addEventListener('fxsWidgetsLoaded', () => {
console.log('FXS Widgets have been loaded');
});
```
--------------------------------
### MetaTrader News JSON Sample
Source: https://docs.fxstreet.com/api/news/metatrader/json
A sample JSON response containing news metadata, content, and technical analysis indicators.
```json
{
"Id":"397eab9f-8579-4d01-bb33-ad5dcbd86640",
"PubDate":"\/Date(1394439925000)\/",
"Title":"EUR/GBP broke above 0.83 on pound weakness",
"Market":"Foreign Exchange",
"Provider":"FXStreet",
"Summary":"EUR/GBP broke above 0.83 resistance area and reached 0.8325 by the moment.",
"Content":"FXStreet (Moscow) - \u003cstrong\u003eEUR/GBP\u003c/strong\u003e broke above 0.83 resistance area and reached 0.8325 by the moment.\u003cbr /\u003e\t\u003cbr /\u003e\u003cstrong\u003e\u003cbr /\u003eConsolidation mode is OFF\u003c/strong\u003e\u003cbr /\u003e\u003cbr /\u003eAfter a several days of rising, EUR/GBP looked like already reached the upper limit around 0.83 resistance area, and given the absence of key reports from the EMU and UK for today, we could expect mild consolidation around the mentioned area. Nevertheless, the pair broke above 0.83 on barren calendar in the European open, and reached monthly high at 0.8325 by the moment. The move is rooted from the sudden pound weakness not explained by any fundamental reasons. Most probably, it’s the case of profit-taking by some institutional investor. The upside is limited by 0.8338, and the downside – by 0.8278 support level.\u003cbr /\u003e\u003cbr /\u003e\u003cstrong\u003eWhat are today’s key EUR/GBP levels?\u003c/strong\u003e\u003cbr /\u003e\u003cbr /\u003eToday's central pivot point can be found at 0.8290 with support below at 0.8278, 0.8260 and 0.8248, with resistance above at 0.8308, 0.8320, and 0.8338. Hourly Moving Averages are bullish, with the 200SMA at 0.8239 and the daily 20EMA bullish at 0.8249. Hourly RSI is neutral at 59.",
"Pair":"EUR/GBP",
"HasCharts":true,
"HasTechnicals":true,
"IsHeadline":false,
"Charts":[
"null",
"null",
"null",
"null"
],
"TechAnalysis":{
"UpdatedAt":"\/Date(1394442000000)\/",
"Open":"0",
"Close":"0",
"High":"0",
"Low":"0",
"Bid":"0",
"Ask":0.834,
"Pct":-0.0480653689017063,
"PivotPoints":{
"S1":0.83360000451405836,
"S2":0.83320001761118567,
"S3":0.83270003398259473,
"R1":0.834499975045522,
"R2":0.83499995867411292,
"R3":0.8353999455769856
},
"TrendIndex":{
"Recommandation":"Bullish",
"Strength":3
},
"OBOSIndex":{
"Recommandation":"Extremely Overbought"
}
}
}
```
--------------------------------
### Historical Table Widget Configuration
Source: https://docs.fxstreet.com/widgets/calendar/info/historical-table
Configuration parameters used to initialize and customize the Historical Table widget.
```APIDOC
## Historical Table Widget Parameters
### Parameters
- **event-id** (string) - Required - The recurrent event ID. It can be retrieved using the Economic Calendar API.
- **culture** (string) - Optional - Sets the language in which the widget should be displayed. Default: 'en'.
- **timezone-offset** (number) - Optional - Sets the timezone in which the dates and times should be displayed, represented as the time zone difference (in minutes) from UTC. Default: 0.
- **height** (string) - Optional - Sets the height of the widget. Default: '100%'.
```
--------------------------------
### Timezone Configuration Objects
Source: https://docs.fxstreet.com/widgets/calendar/v1/configuration
A collection of JSON objects defining various global timezones and their associated offsets.
```json
"DisplayName":"(UTC+05:30) Sri Jayawardenepura",
"StandardName":"Sri Lanka Standard Time",
"FXSstandardName":"Sri+Lanka+Standard+Time"
},
{
"BaseUtcOffset":"05:45:00",
"DisplayName":"(UTC+05:45) Kathmandu",
"StandardName":"Nepal Standard Time",
"FXSstandardName":"Nepal+Standard+Time"
},
{
"BaseUtcOffset":"06:00:00",
"DisplayName":"(UTC+06:00) Astana",
"StandardName":"Central Asia Standard Time",
"FXSstandardName":"Central+Asia+Standard+Time"
},
{
"BaseUtcOffset":"06:00:00",
"DisplayName":"(UTC+06:00) Dhaka",
"StandardName":"Bangladesh Standard Time",
"FXSstandardName":"Bangladesh+Standard+Time"
},
{
"BaseUtcOffset":"06:00:00",
"DisplayName":"(UTC+06:00) Omsk",
"StandardName":"Omsk Standard Time",
"FXSstandardName":"Omsk+Standard+Time"
},
{
"BaseUtcOffset":"06:30:00",
"DisplayName":"(UTC+06:30) Yangon (Rangoon)",
"StandardName":"Myanmar Standard Time",
"FXSstandardName":"Myanmar+Standard+Time"
},
{
"BaseUtcOffset":"07:00:00",
"DisplayName":"(UTC+07:00) Bangkok, Hanoi, Jakarta",
"StandardName":"SE Asia Standard Time",
"FXSstandardName":"SE+Asia+Standard+Time"
},
{
"BaseUtcOffset":"07:00:00",
"DisplayName":"(UTC+07:00) Barnaul, Gorno-Altaysk",
"StandardName":"Altai Standard Time",
"FXSstandardName":"Altai+Standard+Time"
},
{
"BaseUtcOffset":"07:00:00",
"DisplayName":"(UTC+07:00) Hovd",
"StandardName":"W. Mongolia Standard Time",
"FXSstandardName":"W.+Mongolia+Standard+Time"
},
{
"BaseUtcOffset":"07:00:00",
"DisplayName":"(UTC+07:00) Krasnoyarsk",
"StandardName":"Russia TZ 6 Standard Time",
"FXSstandardName":"North+Asia+Standard+Time"
},
{
"BaseUtcOffset":"07:00:00",
"DisplayName":"(UTC+07:00) Novosibirsk",
"StandardName":"Novosibirsk Standard Time",
"FXSstandardName":"N.+Central+Asia+Standard+Time"
},
{
"BaseUtcOffset":"07:00:00",
"DisplayName":"(UTC+07:00) Tomsk",
"StandardName":"Tomsk Standard Time",
"FXSstandardName":"Tomsk+Standard+Time"
},
{
"BaseUtcOffset":"08:00:00",
"DisplayName":"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",
"StandardName":"China Standard Time",
"FXSstandardName":"China+Standard+Time"
},
{
"BaseUtcOffset":"08:00:00",
"DisplayName":"(UTC+08:00) Irkutsk",
"StandardName":"Russia TZ 7 Standard Time",
"FXSstandardName":"North+Asia+East+Standard+Time"
},
{
"BaseUtcOffset":"08:00:00",
"DisplayName":"(UTC+08:00) Kuala Lumpur, Singapore",
"StandardName":"Malay Peninsula Standard Time",
"FXSstandardName":"Singapore+Standard+Time"
},
{
"BaseUtcOffset":"08:00:00",
"DisplayName":"(UTC+08:00) Perth",
"StandardName":"W. Australia Standard Time",
"FXSstandardName":"W.+Australia+Standard+Time"
},
{
"BaseUtcOffset":"08:00:00",
"DisplayName":"(UTC+08:00) Taipei",
"StandardName":"Taipei Standard Time",
"FXSstandardName":"Taipei+Standard+Time"
},
{
"BaseUtcOffset":"08:00:00",
"DisplayName":"(UTC+08:00) Ulaanbaatar",
"StandardName":"Ulaanbaatar Standard Time",
"FXSstandardName":"Ulaanbaatar+Standard+Time"
},
{
"BaseUtcOffset":"08:30:00",
"DisplayName":"(UTC+08:30) Pyongyang",
"StandardName":"North Korea Standard Time",
"FXSstandardName":"North+Korea+Standard+Time"
},
{
"BaseUtcOffset":"08:45:00",
"DisplayName":"(UTC+08:45) Eucla",
"StandardName":"Aus Central W. Standard Time",
"FXSstandardName":"Aus+Central+W.+Standard+Time"
},
{
"BaseUtcOffset":"09:00:00",
"DisplayName":"(UTC+09:00) Chita",
"StandardName":"Transbaikal Standard Time",
"FXSstandardName":"Transbaikal+Standard+Time"
},
{
"BaseUtcOffset":"09:00:00",
"DisplayName":"(UTC+09:00) Osaka, Sapporo, Tokyo",
"StandardName":"Tokyo Standard Time",
"FXSstandardName":"Tokyo+Standard+Time"
},
{
"BaseUtcOffset":"09:00:00",
"DisplayName":"(UTC+09:00) Seoul",
"StandardName":"Korea Standard Time",
"FXSstandardName":"Korea+Standard+Time"
},
{
"BaseUtcOffset":"09:00:00",
"DisplayName":"(UTC+09:00) Yakutsk",
"StandardName":"Russia TZ 8 Standard Time",
"FXSstandardName":"Yakutsk+Standard+Time"
},
{
"BaseUtcOffset":"09:30:00",
"DisplayName":"(UTC+09:30) Adelaide",
"StandardName":"Cen. Australia Standard Time",
"FXSstandardName":"Cen.+Australia+Standard+Time"
},
{
"BaseUtcOffset":"09:30:00",
"DisplayName":"(UTC+09:30) Darwin",
"StandardName":"AUS Central Standard Time",
"FXSstandardName":"AUS+Central+Standard+Time"
},
{
"BaseUtcOffset":"10:00:00",
"DisplayName":"(UTC+10:00) Brisbane",
"StandardName":"E. Australia Standard Time",
"FXSstandardName":"E.+Australia+Standard+Time"
},
{
"BaseUtcOffset":"10:00:00",
"DisplayName":"(UTC+10:00) Canberra, Melbourne, Sydney",
"StandardName":"AUS Eastern Standard Time",
"FXSstandardName":"AUS+Eastern+Standard+Time"
},
{
"BaseUtcOffset":"10:00:00",
"DisplayName":"(UTC+10:00) Guam, Port Moresby",
"StandardName":"West Pacific Standard Time",
"FXSstandardName":"West+Pacific+Standard+Time"
},
{
"BaseUtcOffset":"10:00:00",
"DisplayName":"(UTC+10:00) Hobart",
"StandardName":"Tasmania Standard Time",
"FXSstandardName":"Tasmania+Standard+Time"
},
{
"BaseUtcOffset":"10:00:00",
"DisplayName":"(UTC+10:00) Vladivostok",
"StandardName":"Russia TZ 9 Standard Time",
"FXSstandardName":"Vladivostok+Standard+Time"
}
```
--------------------------------
### Load the FXStreet JS library
Source: https://docs.fxstreet.com/widgets/calendar/getting-started
Include this script tag in your page's head or at the end of the body to load the widget library.
```html
```
--------------------------------
### Obtain Access Token via cURL
Source: https://docs.fxstreet.com/api/authentication/oauth2/v2
Request an access token by sending client credentials to the authorization server.
```bash
curl -d "grant_type=client_credentials" -d "client_id={public_key}" -d "client_secret={private_key}" -d "scope=calendar" https://authorization.fxstreet.com/v2/token
```
--------------------------------
### Embed Forecast Widget
Source: https://docs.fxstreet.com/widgets/market-tools/forecast
Standard implementation requiring a configuration object in the head, a container div with widget attributes, and the external script reference at the end of the body.
```html
```
--------------------------------
### Generate Authentication Hash in C#
Source: https://docs.fxstreet.com/api/authentication/api-key
Computes a SHA1 hash using the client's private key and a formatted UTC timestamp.
```csharp
public string GenerateHash(System.DateTime dt, string input)
{
var hasher = System.Security.Cryptography.SHA1.Create();
string res = string.Empty;
byte[] data = hasher.ComputeHash(System.Text.Encoding.ASCII.GetBytes(string.Concat(input, dt.ToString("yyyyMMddHHmm"))));
foreach (byte b in data)
{
res += string.Format("{0:x2}", b);
}
return res;
}
```
--------------------------------
### Define widget with static parameter
Source: https://docs.fxstreet.com/widgets/calendar/utilities
Standard implementation of a widget using a fixed event-id attribute.
```html
```
--------------------------------
### Load specific widgets
Source: https://docs.fxstreet.com/widgets/calendar/utilities
Triggers the loading of widgets by name. Use the force parameter to re-render existing widgets.
```javascript
fxsWidgets.load('calendar-historical');
fxsWidgets.load('calendar-historical', true);
```
--------------------------------
### fxsWidgets.load
Source: https://docs.fxstreet.com/widgets/calendar/utilities
Triggers the loading of specific widgets by name. By default, it only loads widgets that have not been loaded yet, but can be forced to re-render.
```APIDOC
## fxsWidgets.load(widgetName: string, force?: boolean)
### Description
Triggers a load of widgets matching the provided `widgetName`. Useful for loading widgets after the initial page load.
### Parameters
- **widgetName** (string) - Required - The name of the type of widgets to load.
- **force** (boolean) - Optional - If true, all matching widgets are completely re-rendered. Default: false.
### Usage Example
```javascript
fxsWidgets.load('calendar-historical');
fxsWidgets.load('calendar-historical', true);
```
```
--------------------------------
### Configure Initial Countries
Source: https://docs.fxstreet.com/widgets/calendar/v1/interest-rates
Use the fxcalendar_config object to specify a comma-separated list of country codes to display on initial load.
```javascript
```
--------------------------------
### Configure Widget Attributes
Source: https://docs.fxstreet.com/widgets/market-tools/sentiment
List of available attributes for the fxs_widget div element.
```text
fxs_name="marketthemessentiment"
fxs_onlyHighlighted = ["true"|"false"]
fxs_groups = (groupId,[bullish|bearish];)+
fxs_rows = ([0-9]+)?
```
--------------------------------
### Event Historical Chart Widget Parameters
Source: https://docs.fxstreet.com/widgets/calendar/info/historical-chart
Configuration parameters for the Event Historical Chart Widget.
```APIDOC
## Widget Parameters
### event-id
- **Required**
- The recurrent event ID. It can be retrieved using the Economic Calendar API.
### culture
- **Optional**
- Sets the language in which the widget should be displayed.
- Default: `en`
### timezone-offset
- **Optional**
- Sets the timezone in which the dates and times should be displayed, represented as the time zone difference (in minutes), from the desired timezone to UTC.
- Default: `0`
### zoomable
- **Optional**
- Defines whether the chart should be zoomable (mouse-scroll and zoom-in & zoom-out buttons). If the window width is less than 768 pixels, it is always `false`.
- Default: `true`
### allow-download
- **Optional**
- Defines whether the widget should allow the download of an SVG or PNG image of the chart. If the window width is less than 768 pixels, it is always `false`.
- Default: `true`
```
--------------------------------
### Available Timezones List
Source: https://docs.fxstreet.com/widgets/calendar/v1/configuration
A JSON array containing supported timezones with their respective offsets and display names.
```json
[
{
"BaseUtcOffset":"-12:00:00",
"DisplayName":"(UTC-12:00) International Date Line West",
"StandardName":"Dateline Standard Time",
"FXSstandardName":"Dateline+Standard+Time"
},
{
"BaseUtcOffset":"-11:00:00",
"DisplayName":"(UTC-11:00) Coordinated Universal Time-11",
"StandardName":"UTC-11",
"FXSstandardName":"UTC-11"
},
{
"BaseUtcOffset":"-10:00:00",
"DisplayName":"(UTC-10:00) Aleutian Islands",
"StandardName":"Aleutian Standard Time",
"FXSstandardName":"Aleutian+Standard+Time"
},
{
"BaseUtcOffset":"-10:00:00",
"DisplayName":"(UTC-10:00) Hawaii",
"StandardName":"Hawaiian Standard Time",
"FXSstandardName":"Hawaiian+Standard+Time"
},
{
"BaseUtcOffset":"-09:30:00",
"DisplayName":"(UTC-09:30) Marquesas Islands",
"StandardName":"Marquesas Standard Time",
"FXSstandardName":"Marquesas+Standard+Time"
},
{
"BaseUtcOffset":"-09:00:00",
"DisplayName":"(UTC-09:00) Alaska",
"StandardName":"Alaskan Standard Time",
"FXSstandardName":"Alaskan+Standard+Time"
},
{
"BaseUtcOffset":"-09:00:00",
"DisplayName":"(UTC-09:00) Coordinated Universal Time-09",
"StandardName":"UTC-09",
"FXSstandardName":"UTC-09"
},
{
"BaseUtcOffset":"-08:00:00",
"DisplayName":"(UTC-08:00) Baja California",
"StandardName":"Pacific Standard Time (Mexico)",
"FXSstandardName":"Pacific+Standard+Time+(Mexico)"
},
{
"BaseUtcOffset":"-08:00:00",
"DisplayName":"(UTC-08:00) Coordinated Universal Time-08",
"StandardName":"UTC-08",
"FXSstandardName":"UTC-08"
},
{
"BaseUtcOffset":"-08:00:00",
"DisplayName":"(UTC-08:00) Pacific Time (US & Canada)",
"StandardName":"Pacific Standard Time",
"FXSstandardName":"Pacific+Standard+Time"
},
{
"BaseUtcOffset":"-07:00:00",
"DisplayName":"(UTC-07:00) Arizona",
"StandardName":"US Mountain Standard Time",
"FXSstandardName":"US+Mountain+Standard+Time"
},
{
"BaseUtcOffset":"-07:00:00",
"DisplayName":"(UTC-07:00) Chihuahua, La Paz, Mazatlan",
"StandardName":"Mountain Standard Time (Mexico)",
"FXSstandardName":"Mountain+Standard+Time+(Mexico)"
},
{
"BaseUtcOffset":"-07:00:00",
"DisplayName":"(UTC-07:00) Mountain Time (US & Canada)",
"StandardName":"Mountain Standard Time",
"FXSstandardName":"Mountain+Standard+Time"
},
{
"BaseUtcOffset":"-06:00:00",
"DisplayName":"(UTC-06:00) Central America",
"StandardName":"Central America Standard Time",
"FXSstandardName":"Central+America+Standard+Time"
},
{
"BaseUtcOffset":"-06:00:00",
"DisplayName":"(UTC-06:00) Central Time (US & Canada)",
"StandardName":"Central Standard Time",
"FXSstandardName":"Central+Standard+Time"
},
{
"BaseUtcOffset":"-06:00:00",
"DisplayName":"(UTC-06:00) Easter Island",
"StandardName":"Easter Island Standard Time",
"FXSstandardName":"Easter+Island+Standard+Time"
},
{
"BaseUtcOffset":"-06:00:00",
"DisplayName":"(UTC-06:00) Guadalajara, Mexico City, Monterrey",
"StandardName":"Central Standard Time (Mexico)",
"FXSstandardName":"Central+Standard+Time+(Mexico)"
},
{
"BaseUtcOffset":"-06:00:00",
"DisplayName":"(UTC-06:00) Saskatchewan",
"StandardName":"Canada Central Standard Time",
"FXSstandardName":"Canada+Central+Standard+Time"
},
{
"BaseUtcOffset":"-05:00:00",
"DisplayName":"(UTC-05:00) Bogota, Lima, Quito, Rio Branco",
"StandardName":"SA Pacific Standard Time",
"FXSstandardName":"SA+Pacific+Standard+Time"
},
{
"BaseUtcOffset":"-05:00:00",
"DisplayName":"(UTC-05:00) Chetumal",
"StandardName":"Eastern Standard Time (Mexico)",
"FXSstandardName":"Eastern+Standard+Time+(Mexico)"
},
{
"BaseUtcOffset":"-05:00:00",
"DisplayName":"(UTC-05:00) Eastern Time (US & Canada)",
"StandardName":"Eastern Standard Time",
"FXSstandardName":"Eastern+Standard+Time"
},
{
"BaseUtcOffset":"-05:00:00",
"DisplayName":"(UTC-05:00) Haiti",
"StandardName":"Haiti Standard Time",
"FXSstandardName":"Haiti+Standard+Time"
},
{
"BaseUtcOffset":"-05:00:00",
"DisplayName":"(UTC-05:00) Havana",
"StandardName":"Cuba Standard Time",
"FXSstandardName":"Cuba+Standard+Time"
},
{
"BaseUtcOffset":"-05:00:00",
"DisplayName":"(UTC-05:00) Indiana (East)",
"StandardName":"US Eastern Standard Time",
"FXSstandardName":"US+Eastern+Standard+Time"
},
{
"BaseUtcOffset":"-04:00:00",
"DisplayName":"(UTC-04:00) Asuncion",
"StandardName":"Paraguay Standard Time",
"FXSstandardName":"Paraguay+Standard+Time"
},
{
"BaseUtcOffset":"-04:00:00",
"DisplayName":"(UTC-04:00) Atlantic Time (Canada)",
"StandardName":"Atlantic Standard Time",
"FXSstandardName":"Atlantic+Standard+Time"
},
{
"BaseUtcOffset":"-04:00:00",
"DisplayName":"(UTC-04:00) Caracas",
"StandardName":"Venezuela Standard Time",
"FXSstandardName":"Venezuela+Standard+Time"
},
{
"BaseUtcOffset":"-04:00:00",
"DisplayName":"(UTC-04:00) Cuiaba",
"StandardName":"Central Brazilian Standard Time",
"FXSstandardName":"Central+Brazilian+Standard+Time"
}
]
```
--------------------------------
### fxsWidgetsLoaded Event
Source: https://docs.fxstreet.com/widgets/calendar/utilities
An event fired on the Window interface when the fxsWidgets library has finished loading. This ensures the library is ready for use.
```APIDOC
## Event: fxsWidgetsLoaded
### Description
Fired on the `Window` interface when the `fxsWidgets` library has been completely loaded. This event is useful for initializing widgets in dynamic environments where the library might load after the initial DOM content.
### Usage
```javascript
window.addEventListener('fxsWidgetsLoaded', () => {
console.log('FXS Widgets have been loaded');
});
```
```
--------------------------------
### API Request Parameter Format
Source: https://docs.fxstreet.com/api/authentication/api-key
The required query string parameters for API authentication.
```text
&k={YOUR_CLIENT_KEY}&s={HASH}&t={TIMESTAMP}
```
--------------------------------
### Configure Calendar Widget with OneSignal
Source: https://docs.fxstreet.com/widgets/calendar/notifications
Use this HTML structure to initialize the calendar widget with your OneSignal application ID and initialization parameter.
```html
```
--------------------------------
### List Available Cultures
Source: https://docs.fxstreet.com/api/news/notifications
A JSON array of supported culture codes for notification subscriptions.
```json
[
{ "Name": "en-US" },
{ "Name": "zh-CHT" },
{ "Name": "es-ES" },
{ "Name": "zh-CN" },
{ "Name": "ja-JP" },
{ "Name": "ru-RU" },
{ "Name": "ca-ES" },
{ "Name": "ar-AE" },
{ "Name": "id-ID" },
{ "Name": "tr-TR" },
{ "Name": "hu-HU" },
{ "Name": "fr-FR" },
{ "Name": "de-DE" },
{ "Name": "hi-IN" },
{ "Name": "pt-PT" },
{ "Name": "it-IT" },
{ "Name": "ko-KR" },
{ "Name": "pl-PL" },
{ "Name": "vi-VN" },
{ "Name": "fa-IR" }
]
```
--------------------------------
### Enable Event Posts
Source: https://docs.fxstreet.com/widgets/calendar/widget
Toggles the display of news related to calendar events.
```html
has-posts="true"
```
--------------------------------
### Embed Calendar Lite Widget
Source: https://docs.fxstreet.com/widgets/calendar/v1/lite
Basic HTML implementation for the Calendar Lite widget. Requires defining the fxcalendar_config object before loading the script.
```html
```
--------------------------------
### Embed Key Technical Levels Table Widget
Source: https://docs.fxstreet.com/widgets/market-tools/ktl
Full HTML implementation including configuration, container div, and script source.
```html
```