Code Examples


PHP (CURL)

Accessing Real-time exchange rates: Find below an example for how to access the latest exchange rate data via PHP (CURL):

Performing a Currency Conversion: Converting one currency to another in PHP (CURL) is as simple as:

JavaScript (jQuery.ajax)

Echangerates can be easily accessed by using jQuery to make an AJAX call. This method is widely used and highly recommended due to its ease of integration.

Accessing Real-time exchange rates: Find below an example of how to access the latest exchange rate data via jQuery.ajax:

Performing a Currency Conversion: Converting one currency to another in jQuery.ajax is as simple as:

Java

Using a variety of Apache HTTP Components, it's relatively simple to query the API in Java. Based on the following integration methods for the API's live and convert endpoints, we will provide a general idea of how to access Exchangerate JSON data in Java.

Accessing Real-time exchange rates: Find below an example for how to access and display the latest exchange rate data using Java:

The Java Output will look like this:

 

Questions? Contact Sales .
Need help? Contact Support .
© 2026 APILayer. All rights reserved.