How To Make A Powerful Low Code Currency Conversion App
Wouldn’t it be nice to have real-time and historical currency information for your business and be able to instantly retrieve up-to-date exchange rate data for more than 168 world currencies? The currencylayer API is capable of delivering accurate exchange rate with data updates ranging from every 60 minutes down to stunning 60 seconds. In this article we will see how fast and easy it is to use RAD Studio and Delphi to create a Firemonkey multidevice application using the LowCode Wizard in addition to a REST client library to take advantage of currencylayer API API and retrieve a JSON format response for currency exchange rates in real-time. Our RAD Studio and Delphi applications will be able to call the API and request information based on the name of parameters you provide. How do I set up the Currencylayer API? Make sure you refer to Currencylayer API website (https://Currencylayer.com/) and sign up for the free Plan providing only your email and some basic information (no credit card required). Once you are in the website will redirect you to a Quickstart guide dashboard and your API Access Key will be provided. The Access Key unique, personal and is required to authenticate with the API. Keep it safe! How do I call Currencylayer API endpoints? Now all we need to do is to call the API base URL (http://api.currencylayer.com/) via a HTTP POST method with no JSON request body needed and some few requested parameters added to the URL address depending on the endpoint we choose to call. One can do that using REST Client libraries available on several programming languages. Currencylayer offers five API endpoints to choose from live endpoint: request the most recent exchange rate data historical endpoint: request historical rates for a specific day convert endpoint: convert any amount from one currency to another using real-time exchange rates timeframe endpoint: request exchange rates for a specific period of time change endpoint: request any currency’s change parameters (margin and percentage), optionally between two specified dates Our demo will focus on the Live Endpoint but all the others follow similar logic but with different parameters passed. For a complete and detailed list of endpoints and its parameters make sure you refer to Currencylayer Quickstart guide (https://currencylayer.com/quickstart) http://api.currencylayer.com/live ? access_key = YOUR_ACCESS_KEY & source = GBP & currencies = USD,AUD,CAD,PLN,MXN & format = 1 // more parameters available please refer to the API Documentation (https://currencylayer.com/documentation) http://api.currencylayer.com/live ? access_key = YOUR_ACCESS_KEY & source = GBP & currencies = USD,AUD,CAD,PLN,MXN & format = 1 // more parameters available please refer to the API Documentation (https://currencylayer.com/documentation) What does the Currencylayer API endpoint return? After the call the main results will be as shown below. The currencylayer API’s live endpoint is used to get the latest rates for all available or a specific set of currencies. { “success”: true, “terms”: “https://currencylayer.com/terms”, “privacy”: “https://currencylayer.com/privacy”, “timestamp”: 1630324396, “source”: “USD”, “quotes”: { “USDUSD”: 1, “USDAUD”: 1.370567, “USDCAD”: 1.260385, “USDPLN”: 3.87164, “USDMXN”: 20.2166 } { “success”: true, “terms”: “https://currencylayer.com/terms”, “privacy”: “https://currencylayer.com/privacy”, “timestamp”: 1630324396, “source”: “USD”, “quotes”: { “USDUSD”: 1, “USDAUD”: 1.370567, “USDCAD”: 1.260385, “USDPLN”: 3.87164, “USDMXN”: 20.2166 } How do I connect my Delphi applications to Currencylayer API? Once you have followed basic steps to set up the Currencylayer API we need to make sure we are able to connect and […]
