Exchange Rate API

Applescript Currency API

Our service is the easy to use, accurate and reliable currency API for Applescript that's perfect for both personal and professional use. Easily convert currencies in your Applescript project!

How to use our Applescript Currency Converter

Converting currencies using our Applescript Exchange Rate API is as easy as posting a HTTP request. Your requests would need to follow this simple pattern:

http://www.exchangerate-api.com/FROM_CURRENCY/TO_CURRENCY/AMOUNT?k=YOUR_API_KEY


Here are some examples in Applescript:

The following code works in Apple's OS X 10.5 onward, and with Safari as the browser.


To convert from 12.50 USD (US Dollar) to GBP (British Pound):

try
  set quoteUS to do shell script "curl -s 'www.exchangerate-api.com/USD/GBP/12.50?k=API_KEY'"
end try

Or to get how many Japanese Yen (JPY) there are to the South African Rand (ZAR):

try
  set quoteUS to do shell script "curl -s 'www.exchangerate-api.com/zar/jpy?k=API_KEY'"
end try

Error Codes:

The API returns the following error codes:
  -1 if an invalid amount is used (must be numeric floating point or integer numbers)
  -2 if either of the 3 letter currency codes are invalid (Check our supported currencies)
  -3 if an invalid key is used (Get an API key)
  -4 if your monthly API query limit is reached (Click here for extended usage)
  -5 if an unresolvable IP address is provided (This only applies for our "Automatic Country/Flag Information" query.)