Adding Currencies and other Securities - lindenstruth/ExchangeRatesWiki GitHub Wiki

Adding new data sources for currencies and other securities

The app supports wide range of world currencies, but only with a basic set of data which is being updated with a significant delay. Besides not all supported currencies are updated as regularly as the major world currencies such as USD, EUR, CHF, JPY, etc., so you might like to load specific exchange rates from another source.

The same goes for the cryptocurrency selection which can change over time as currencies disappear and new become popuplar, so you might want to add these new currencies to Exchange Rates in order to keep track of their development as well.

Exchange Rates allows you to add new or otherwise unsupported data sources for currencies and other kinds of assets by adding a custom "Cryptocurrency" and/or a "Crypto Exchange" for an existing one to loade its ticker feed. There are a few requirements in place in terms of which feeds are supported such as...

  • the feed has to be publicly available via http or https, preferably the latter (no http auth or 2-staged loading yet)
  • the feed has to be in plain JSON (i.e. no XML feeds yet)
  • the desired data (exchange rates value, change, ...) have to be accessible by specifying valid key paths (see the examples below)

The easiest way to learn to know this feature better is to create a new data source for an existing cryptocurrency, say bitcoin, by copying an existing datasource such as Yahooo using the arrow button next to the "+" button below the list and play around with its configuration values to see it in action.

Please note that it is not yet possible to add new data sources to existing fiat currencies such as USD or EUR, or the 4 precious metals supported out of the box for that matter. To use a different data source for these - the spot price for Gold for instance - you first have to create a new "cryptocurrency" to which you can then add the new "exchange", which is just another word for "data source". I'll might even rename them some time in the future...

Even though the naming in this documentation suggests this feature is limited to cryptocurrencies, it it actually not. You can add whichever asset you'd which to be listed in Exchange Rates, as long as there is a publicly available JSON ticker feed around which can be loaded and processed by the app.

One more thing: the "name" is the string which will be used throughout the app to identify the currency/commodity/whatever, so it shouldn't be too long...

Ah and one last thing: leaving the "date format" field empty will cause the app try a few more things besides the default format string, UNIX timestamps for example. So if the feed uses them you can leve this field empty.

Needless to say that the availability of these feeds as well as their structure and thus the configuration values listed here can change over time without further notice. That's why they are not officially supported by Exchange Rates in any way and are merely an illustration as to how the app can be extended to support more data sources.

Neither do their documentation consitute trading advice of any kind. All what goes up will sooner or later come down again, so please trade accordingly ;-)

Here we go...

Feed definitions

The parameters for these feeds may change over time, and their content is usually copyrighted. Please check the linked websites for more information about the legal terms for using this data. The following information is meant for instructive and descriptive purposes, i.e. to illustrate, how extending the Exchange Rates app works for any kind of JSON feed. Making sure that the usage of the respective feed meets its legal terms of service is your responsibility.

Please note: Exchange Rates is a research tool, it cannot trade foreign exchanges or other secuurities on your behalf. It is merely a tool to keep an eye on the market, so all exchange rates and precious metal prices are provided for informational purposes only, and do not constitute financial advice of any kind.

Currencies

Source Description requires API key Feed URL HTTP headers Currency Value (key path) Change (key path) Date (key path) Date format

Cryptocurrencies

Source Description requires API key Feed URL HTTP headers Currency Value (key path) Change (key path) Date (key path) Date format
finance.yahoo.com Dogecoin https://query1.finance.yahoo.com/v7/finance/spark?symbols=DOGE-USD&range=1d&interval=1d&indicators=close&includeTimestamps=false&includePrePost=false&corsDomain=finance.yahoo.com&.tsrc=finance USD spark.result[0].response[0].meta.regularMarketPrice spark.result[0].response[0].meta.regularMarketChange spark.result[0].response[0].meta.regularMarketTime (timestamp, can be omitted)

Commodities

Source Description requires API key Feed URL HTTP headers Currency Value (key path) Change (key path) Date (key path) Date format
finance.yahoo.com Crude Oil Futures Contract (CL=F) https://query1.finance.yahoo.com/v7/finance/spark?symbols=CL=F&range=1d&interval=1d&indicators=close&includeTimestamps=false&includePrePost=false&corsDomain=finance.yahoo.com&.tsrc=finance USD spark.result[0].response[0].meta.regularMarketPrice spark.result[0].response[0].meta.regularMarketChange spark.result[0].response[0].meta.regularMarketTime (timestamp, can be omitted)

Precious Metals

Source Description requires API key Feed URL HTTP headers Currency Value (key path) Change (key path) Date (key path) Date format
goldprice.org1) gold, silver (spot) https://data-asg.goldprice.org/dbXRates/USD USD items[0].xauPrice items[0].xagPrice items[0].chgXau items[0].chgXag ts (timestamp, can be omitted)
lbma.org2) gold, silver, platiun, palladium (am/pm price fixing) https://prices.lbma.org.uk/json/today.json USD, GBP, EUR [gold|silver|platinum|palladium].[am|pm].[usd|gbp|eur] for example gold.pm.usd gold.[am|pm].timestamp for example gold.pm.timestamp dd/mm hh:ii:ss
finance.yahoo.com Xetra Gold (4GLD.DE) https://query1.finance.yahoo.com/v7/finance/spark?symbols=4GLD.DE&range=1d&interval=1d&indicators=close&includeTimestamps=false&includePrePost=false&corsDomain=finance.yahoo.com&.tsrc=finance USD spark.result[0].response[0].meta.regularMarketPrice spark.result[0].response[0].meta.regularMarketChange spark.result[0].response[0].meta.regularMarketTime (timestamp, can be omitted)

1) See goldprice.org for the website's terms of service

2) The LBMA Gold and Silver Price benchmarks are the global benchmark prices for unallocated gold and silver delivered in London, and are administered by ICE Benchmark Administration Limited (IBA). Please contact [email protected] for details on how to obtain the requisite licence to receive and use the data. The LBMA Platinum and Palladium Price is administered independently by the London Metal Exchange (LME). Particular uses of the LBMA Platinum and Palladium prices require a usage licence. For information on licensing arrangements relating to these prices, please refer to the LME website.

⚠️ **GitHub.com Fallback** ⚠️