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:
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):
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):
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.)
How Our API Works
Python
PHP
Ruby
Perl
ASP.NET
Java
Applescript
iPhone C