Skip to main content

Exchange Rates API Data Source

The Exchange Rates API connector enables you to ingest real-time and historical foreign exchange rate data for 170+ world currencies directly into Nexla. Follow the instructions below to create a new data flow that ingests data from an Exchange Rates API source in Nexla.
exchange_rates_api.png

Exchange Rates API

Create a New Data Flow

  1. To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Then, select the desired flow type from the list, and click the Create button.

  2. Select the Exchange Rates API connector tile from the list of available connectors. Then, select the credential that will be used to connect to the Exchange Rates API service, and click Next; or, create a new Exchange Rates API credential for use in this flow.

  3. In Nexla, Exchange Rates API data sources can be created using pre-built endpoint templates, which expedite source setup for common Exchange Rates API endpoints. Each template is designed specifically for the corresponding Exchange Rates API endpoint, making source configuration easy and efficient.
    • To configure this source using a template, follow the instructions in Configure Using a Template.

    Exchange Rates API sources can also be configured manually, allowing you to ingest data from Exchange Rates API endpoints not included in the pre-built templates or apply further customizations to exactly suit your needs.
    • To configure this source manually, follow the instructions in Configure Manually.

Configure Using a Template

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Exchange Rates API endpoints. Each template is designed specifically for the corresponding Exchange Rates API endpoint, making data source setup easy and efficient.

Endpoint Settings

  • Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below. Click on an endpoint to see more information about it and how to configure your data source for this endpoint.

Returns real-time exchange rate data updated every 60 minutes, every 10 minutes, or every 60 seconds.

This endpoint retrieves the latest (real-time) exchange rates for one or more target currencies relative to a chosen base currency. Use this endpoint when you need current exchange rate data for currency conversion, financial dashboards, or pricing applications. Data freshness depends on your APILayer subscription plan — rates are refreshed as frequently as every 60 seconds on the Business plan.

  • In the Base field, enter the three-letter ISO 4217 currency code for the base currency you want rates expressed against. For example, enter USD to get rates relative to the US Dollar, or EUR for the Euro. The default value is EUR. All returned rates represent how many units of each target currency equal one unit of this base currency.

  • In the Symbols field, enter a comma-separated list of target currency codes for which you want exchange rates returned. For example, USD,GBP returns rates for the US Dollar and British Pound. The default value is USD,GBP. To retrieve rates for all supported currencies, leave this field empty.

The Exchange Rates Data API supports 170+ currencies including standard ISO 4217 codes and precious metals (XAU for Gold, XAG for Silver). Use the Get Supported Currency Symbols endpoint to retrieve the full list of supported currency codes.

Get Historical Exchange Rates

This endpoint returns exchange rate data for all available or a specific set of currencies for a single historical date. Use this endpoint when you need to look up what exchange rates were on a specific past date — for example, to reconcile financial transactions, generate historical reports, or backfill currency data. Historical data is available back to 1999-01-01.

  • In the Date field, enter the historical date for which you want to retrieve exchange rates, in YYYY-MM-DD format (for example, 2024-01-15). This field is required for the endpoint to function correctly.

  • In the Base Currency field, optionally enter the three-letter ISO 4217 currency code for the base currency (for example, USD or EUR). If left blank, the API will use EUR as the default base currency.

  • In the Target Currencies field, optionally enter a comma-separated list of currency codes to limit the response to specific currencies (for example, GBP,JPY,CHF). If left blank, the API returns rates for all supported currencies.

Historical rate data is sourced from multiple commercial sources and banks. For the most complete historical coverage, use a date in YYYY-MM-DD format. Dates prior to 1999-01-01 are not supported.

Convert Currency

This endpoint converts a specified amount from one currency to another using real-time or historical exchange rates. Use this endpoint when you need to calculate converted values for financial transactions, billing systems, or any application that requires on-the-fly currency conversion. The result includes the conversion rate used and the converted amount.

  • In the From Currency field, enter the three-letter ISO 4217 code of the source currency — the currency you are converting from (for example, USD).

  • In the To Currency field, enter the three-letter ISO 4217 code of the target currency — the currency you are converting to (for example, EUR).

  • In the Amount field, enter the numeric amount to convert (for example, 100 to convert 100 units of the source currency).

  • In the Date field, optionally enter a historical date in YYYY-MM-DD format to perform the conversion using the exchange rate that was in effect on that date. Leave this field blank to use the current (real-time) exchange rate.

When a historical date is specified, the API uses the closing exchange rate for that date. This is useful for reconciling past transactions at the rate that was in effect at the time.

Get Timeseries Exchange Rates

This endpoint returns daily historical exchange rate data for all or a specific set of currencies between two dates, with a maximum range of 365 days. Use this endpoint to build time-series datasets for trend analysis, financial modeling, backtesting currency strategies, or populating data warehouses with historical rate data.

  • In the Start Date field, enter the start date of the date range in YYYY-MM-DD format (for example, 2024-01-01). This is the earliest date for which exchange rate data will be returned.

  • In the End Date field, enter the end date of the date range in YYYY-MM-DD format (for example, 2024-03-31). The total date range between Start Date and End Date must not exceed 365 days.

  • In the Base Currency field, optionally enter the three-letter ISO 4217 currency code for the base currency (for example, USD). If left blank, EUR is used as the default base currency.

  • In the Target Currencies field, optionally enter a comma-separated list of currency codes to limit the response to specific currencies (for example, USD,GBP,JPY). If left blank, data for all supported currencies is returned for each day in the range.

The timeseries endpoint returns one record per date in the specified range. For large date ranges with many currencies, the response payload can be significant. Filtering to specific target currencies reduces response size and improves performance.

Get Currency Fluctuation Data

This endpoint returns fluctuation data — specifically the absolute change and percentage change — for currencies between two specified dates, with a maximum range of 365 days. Use this endpoint when you need to measure how much a currency has appreciated or depreciated over a period, such as for risk assessments, financial reporting, or alerting workflows.

  • In the Start Date field, enter the start date of the analysis period in YYYY-MM-DD format (for example, 2024-01-01). This is the date from which fluctuation is measured.

  • In the End Date field, enter the end date of the analysis period in YYYY-MM-DD format (for example, 2024-06-30). The total date range between Start Date and End Date must not exceed 365 days.

  • In the Base Currency field, optionally enter the three-letter ISO 4217 currency code for the base currency (for example, EUR). If left blank, EUR is used as the default base currency.

  • In the Target Currencies field, optionally enter a comma-separated list of currency codes to limit results to specific currencies (for example, USD,GBP). If left blank, fluctuation data for all supported currencies is returned.

The fluctuation response includes both the absolute change (difference between start and end rates) and the relative change percentage for each currency. This makes it straightforward to identify the most and least volatile currencies in a given period.

Get Supported Currency Symbols

This endpoint returns the full list of all currency symbols supported by the Exchange Rates Data API, along with each currency's full name. Use this endpoint to populate dropdown menus, validate currency codes, or discover the complete set of currencies available for use in other endpoints.

  • No configuration parameters are required for this endpoint. Selecting it is sufficient — Nexla will automatically retrieve all supported currency symbols and their names from the API.
  • The response data path is $.symbols, which contains an object where each key is a currency code (for example, USD) and each value is the currency's full name (for example, United States Dollar).

This endpoint is useful for building reference datasets or enriching other currency data with human-readable currency names. The list of supported symbols reflects all 170+ currencies available through the Exchange Rates Data API.

Endpoint Testing

Once the selected endpoint template has been configured, Nexla can retrieve a sample of the data that will be fetched according to the current settings. This allows users to verify that the source is configured correctly before saving.

  • To test the current endpoint configuration, click the Test button to the right of the endpoint selection menu. Sample data will be fetched & displayed in the Endpoint Test Result panel on the right.

  • If the sample data is not as expected, review the selected endpoint and associated settings, and make any necessary adjustments. Then, click the Test button again, and check the sample data to ensure that the correct information is displayed.

Configure Manually

Exchange Rates API data sources can be manually configured to ingest data from any valid Exchange Rates API endpoint. Manual configuration provides maximum flexibility for accessing endpoints not covered by pre-built templates or when you need custom API configurations.

With manual configuration, you can also create more complex Exchange Rates API sources, such as sources that use chained API calls to fetch data from multiple endpoints or sources that require custom request parameters.

API Method

  1. To manually configure this source, select the Advanced tab at the top of the configuration screen.

  2. Select the API method that will be used for calls to the Exchange Rates API from the Method pulldown menu. All Exchange Rates Data API endpoints use:

    • GET: The only method required for all Exchange Rates Data API endpoints. All data retrieval operations are performed via GET requests.

API Endpoint URL

  1. Enter the URL of the Exchange Rates API endpoint from which this source will fetch data in the Set API URL field. The base URL is https://api.apilayer.com/exchangerates_data/ followed by the endpoint path and any required query parameters. For example:

    • Latest rates: https://api.apilayer.com/exchangerates_data/latest?base=USD&symbols=EUR,GBP
    • Historical rates: https://api.apilayer.com/exchangerates_data/2024-01-15?base=USD
    • Currency conversion: https://api.apilayer.com/exchangerates_data/convert?from=USD&to=EUR&amount=100
    • Timeseries: https://api.apilayer.com/exchangerates_data/timeseries?start_date=2024-01-01&end_date=2024-03-31&base=USD
    • Fluctuation: https://api.apilayer.com/exchangerates_data/fluctuation?start_date=2024-01-01&end_date=2024-06-30
    • Symbols: https://api.apilayer.com/exchangerates_data/symbols

Ensure the API endpoint URL is correct and accessible with your current credentials. You can test the endpoint using the Test button after configuring the URL. The apikey authentication header is added automatically by Nexla from your stored credential — do not include it in the URL.

Date/Time Macros (API URL)

Optional

Optionally, the API URL can be customized using macros—all macros added to the API URL will be converted into values when Nexla executes the API call. Macros are dynamic placeholders that allow you to create flexible API endpoints that can adapt to different time periods or data requirements.

Date/time macros are particularly valuable for the Exchange Rates Data API's historical, timeseries, and fluctuation endpoints, which require date parameters. Using macros such as {now} and {now-1} allows Nexla to automatically supply the correct dates on each scheduled run, eliminating the need to manually update date parameters.

  1. To add a macro, type { at the appropriate position in the API URL (within the Set API URL field), and select the desired macro from the dropdown list.

    • {now} – The current datetime
    • {now-1} – The datetime one time unit before the current datetime
    • {now+1} – The datetime one time unit after the current datetime
    • custom – Datetime macros can reference any number of time units before or after the current datetime—for example, enter (now-4) to indicate the datetime four time units before the current datetime
  2. Select the format that will be applied to datetime macros from the Date Format for Date/Time Macro pulldown menu. For Exchange Rates API endpoints, select the yyyy-MM-dd format to match the YYYY-MM-DD date format required by the API. This format will be applied to the base datetime value of the macro—i.e., the value of {now} in {now-1}.

  3. Select the datetime unit that will be used to perform mathematical operations in the included macro(s) from the Time Unit for Operations pulldown menu—for example, for the macro {now-1}, when Day is selected, {now-1} will be converted to the datetime one day before the current datetime.

Lookup-Based Macros (API URL)

Optional

Column values from existing lookups can also be included as macros in the API URL. Lookup-based macros allow you to reference data from previously configured data sources or lookups, enabling dynamic API endpoints that can adapt based on existing data.

Lookup-based macros are useful when, for example, you want to dynamically supply currency codes sourced from another Nexla dataset rather than hardcoding them in the URL.

  1. To include a lookup column value macro, select the relevant lookup from the Add Lookups to Supported Macros pulldown menu.

  2. Type { at the appropriate position in the API URL, and select the lookup column-based macro from the dropdown list. Lookup-based macros are automatically populated into the macro list when a lookup is selected in the Add Lookups to Supported Macros pulldown menu.

Path to Data

Optional

If only a subset of the data returned by the API endpoint is needed, you can designate the part of the response that should be included in the Nexset(s) produced from this source by specifying the path to the relevant data within the response.

For Exchange Rates Data API responses, the exchange rate values are typically nested within the response object. For example:

  • For the latest and historical endpoints, rates are located at $.rates
  • For the timeseries endpoint, rates per date are located at $.rates
  • For the convert endpoint, the full response object at $ contains conversion details
  • For the symbols endpoint, the currency list is located at $.symbols

Path to Data is essential for Exchange Rates Data API responses, which contain metadata fields (success, timestamp, base, date) alongside the actual rate data. Specifying the correct path ensures Nexla extracts only the exchange rate records rather than the entire response envelope.

  • To specify which data should be treated as relevant in responses from this source, enter the path to the relevant data in the Set Path to Data in Response field.

    • For responses in JSON format, enter the JSON path that points to the object or array that should be treated as relevant data. JSON paths use dot notation (for example, $.rates to access the rates object in most Exchange Rates API responses).
    Path to Data Example:

    For the Exchange Rates Data API latest endpoint, the JSON response contains a top-level rates object with currency codes as keys and exchange rate values as values. Enter $.rates as the path to extract just the rate data.

Autogenerate Path Suggestions

Nexla can also autogenerate data path suggestions based on the response from the API endpoint. These suggested paths can be used as-is or modified to exactly suit your needs.

  • To use this feature, click the Test button next to the Set API URL field to fetch a sample response from the API endpoint. Suggested data paths generated based on the content & format of the response will be displayed in the Suggestions box below the Set Path to Data in Response field.

  • Click on a suggestion to automatically populate the Set Path to Data in Response field with the corresponding path. The populated path can be modified directly within the field if further customization is needed.

    PathSuggestions.png

Metadata

If metadata is included in the response but is located outside of the defined path to relevant data, you can configure Nexla to include this data as common metadata in each record. This is useful when you want to preserve important contextual information that applies to all records but is not part of the main data object.

For Exchange Rates Data API responses, metadata fields such as timestamp, base, and date are located outside the $.rates data path. Specifying a metadata path allows you to attach these fields to each rate record, preserving context such as the base currency and the timestamp when rates were fetched.

Metadata paths are particularly useful for preserving the base currency and timestamp from Exchange Rates API responses, which provide essential context for interpreting the rate values.

  • To specify the location of metadata that should be included with each record, enter the path to the relevant metadata in the Path to Metadata in Response field.

    • For responses in JSON format, enter the JSON path to the object or array that contains the metadata (for example, $ to include all top-level fields as metadata).

Request Headers

Optional
  • If Nexla should include any additional request headers in API calls to this source, enter the headers & corresponding values as comma-separated pairs in the Request Headers field (for example, header1:value1,header2:value2). Additional headers may be required for API versioning or content type specifications.

    You do not need to include the apikey authentication header here — it is automatically injected by Nexla from your stored Exchange Rates API credential. Adding it again may cause authentication errors.

Endpoint Testing

After configuring all settings for the selected endpoint, Nexla can retrieve a sample of the data that will be fetched according to the current configuration. This allows users to verify that the source is configured correctly before saving.

  • To test the current endpoint configuration, click the Test button to the right of the endpoint selection menu. Sample data will be fetched & displayed in the Endpoint Test Result panel on the right.

  • If the sample data is not as expected, review the selected endpoint and associated settings, and make any necessary adjustments. Then, click the Test button again, and check the sample data to ensure that the correct information is displayed.

Save & Activate the Source

  1. Once all of the relevant steps in the above sections have been completed, click the Create button in the upper right corner of the screen to save and create the new Exchange Rates API data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.