Exchange rate

From SubSurfWiki
Exchange rateExchange rate/AUD
Jump to navigation Jump to search

Web API for exchange rate

We can use Yahoo APIs. Codes are ISO 4217. Here is an example query, asking for USD to CAD, GBP, EUR, AUD, and INR:

Example query for exchange rates

This is the result:

<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:count="5" yahoo:created="2013-04-19T02:04:14Z" yahoo:lang="en-US">
<results>
<rate>
<Name>USD to CAD</Name>
<Rate>1.0253</Rate>
</rate>
<rate>
<Name>USD to GBP</Name>
<Rate>0.6541</Rate>
</rate>
<rate>
<Name>USD to EUR</Name>
<Rate>0.7657</Rate>
</rate>
<rate>
<Name>USD to AUD</Name>
<Rate>0.9702</Rate>
</rate>
<rate>
<Name>USD to INR</Name>
<Rate>54.0305</Rate>
</rate>
</results>
</query>
<!--  total: 107  -->
<!--  engine5.yql.bf1.yahoo.com  -->

Rates

The rates the script fetches are stored on the /Currencies/ subpage.

The rates are fetched by Pricebot.

The script places the rates on a subpage of this one:

Bugs and enhancements

  • Update the list above from the actual currencies being fetched.
  • Remove the subpages for currencies which are no longer being fetched.
  • Do some error checking on the list to only work for real currencies.
  • Add a switch or code to turn the bot off and on, and a note on the bot's page.

See also