1.7.1Requesting external data (news etc)

Widgets, scripts, and UDIXes can all use standard browser features such as XMLHttpRequest, or fetch, or websockets to collect data from the internet.

However, this is subject to standard browser security:

MyTrader is hosted at an https:// address, and therefore you can only connect to https:// addresses (with the exception of localhost).

You can only make HTTP requests to services which put CORS headers on their responses.

Therefore, requests for data such news will typically need to be made via a proxy which puts CORS headers on the underlying feed response. In practice, it will often be easiest to use a service such as https://api.rss2json.com/ which adds CORS headers and also converts the feed from XML (RSS) to JSON.

However, you need to watch out for the fact that proxies are usually "freemium" services (because of the cost of running them). For example, you cannot use a count parameter when making a request to https://api.rss2json.com/. That requires a subscription and an API key.

Note: the platform can provide economic calendar data itself. It is not necessary to collect this from an external source.