![]() ![]() The start_at and end_at parameters to set our time period as October 2020. The symbols parameter to specify that we want to see only the rates for GBP The history parameter to indicate that we are interested in historical rates To achieve this, we need to use the following parameters in the URL: In this project we are interested in extracting exchange rates to convert sales values that happened during October 2020 from Euro to GBP. All rates are quoted against Euro by default, but you can change the base currency, if needed, by using the base parameter. We can request the most recent exchange rates, rates for a particular day in the past, or for a set time period. The Foreign Exchange Rates API documentation is just one page outlining the different parameters we can use to build the request URL. Now let’s see how we can bring the exchange rates data directly into our Tableau Prep flow. ![]() In this format the data is stored in name (a field name in double quotes, e.g. In this project, the response comes in JSON format as displayed in the image below. Usually, the response comes in XML or JSON format. If our request was successful, the API server’s sends back a response with the requested data.In short, the code 200 means that the request was successful, the codes between 400 and 499 indicate an issue with the request (incorrectly structured request, issue with authentication or payment, etc.), and the codes between 500 and 599 indicate an error on the API server’s side. When the API’s server receives our request, it will send back a short message with a status code, indicating whether the request was successfully received.For example, in this project we will send a GET request to retrieve EUR to GBP exchange rates for October 2020. These requests can have several methods including GET (to retrieve data from an API server), POST (to send data to an API server), DELETE (to delete data from an API server). Once we understand the structure of the API and how to access it, we need to form and send our request specifying the data we want to retrieve. For example, the Foreign Exchange Rates API I use in this project is free and can be accessed as many times as needed without a password. When we work with APIs, we start by looking at its documentation to understand what data is available to us, if there is a maximum number of requests we can send, whether this API requires authentication or payment, etc.If you know about APIs, then feel free to scroll further to the first step. API refresherīefore we start, I wanted to note some main features of APIs to make sure the following explanation is clear for everyone. Here are the webinar’s slides and its recording. I presented this topic at the Focus on Prep webinar by The Information Lab in November 2020. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |