How do the JSON and Object and description table of currency conversion API created by Fixer function?
In this article, I will be clarifying the object table and JSON output specifically of Fixer currency conversion API. For those with programming knowledge, understanding the structure and content of the data returned by an API is critical for leveraging the data effectively. Fixer currency conversion API provides an object table and JSON output which may require a bit of explanation to fully comprehend. I will provide a clear and concise breakdown of these data structures, highlighting their differences and what kind of information can be obtained from each. With this knowledge, you will have a better understanding of how to parse and utilize the data returned by Fixer currency conversion API to suit your specific needs.
Object and Description of API
Objects | Description |
success | Returns true or false depending on whether or not your API request has succeeded. |
query > from | Returns the three-letter currency code of the currency converted from. |
query > to | Returns the three-letter currency code of the currency converted to. |
query > amount | Returns the amount that is converted. |
info > timestamp | Returns the exact date and time (UNIX time stamp) the given exchange rate was collected. |
info > rate | Returns the exchange rate used for your conversion. |
historical | Returns true if historical rates are used for this conversion. |
date | Returns the date (format YYYY-MM-DD) the given exchange rate data was collected. |
result | Returns your conversion result. |
success
: A boolean value that indicates whether the API request was successful. A value oftrue
indicates success, while a value offalse
indicates failure. This object is present in all API requests and is used to determine whether the data in the response can be relied upon.query > from
: A string that represents the three-letter currency code of the currency being converted from. This object is used to specify the currency that you are converting from.query > to
: A string that represents the three-letter currency code of the currency being converted to. This object is used to specify the currency that you are converting to.query > amount
: A number that represents the amount being converted. This object is used to specify the amount of the currency being converted.info > timestamp
: A number that represents the Unix timestamp of the exchange rate data used in the conversion. This object is used to specify the exact time and date that the exchange rate data was collected.info > rate
: A number that represents the exchange rate used in the conversion. This object is used to specify the exchange rate that was used to calculate the conversion.historical
: A boolean value that indicates whether the conversion used historical exchange rate data. A value oftrue
indicates that historical exchange rate data was used, while a value offalse
indicates that current exchange rate data was used.date
: A string that represents the date that the exchange rate data was collected. This object is used to specify the exact date that the exchange rate data was collected.result
: A number that represents the result of the currency conversion. This object is used to specify the final converted amount of the currency being converted.
The given JSON output represents the result of a currency conversion using the Fixer API, converting 25 British Pounds (GBP) to Japanese Yen (JPY) as of February 22nd, 2018. The object contains several key-value pairs, with each key representing a different piece of information about the conversion. The "success" key indicates whether the API request was successful, with a value of "true" indicating success. The "query" key provides information about the source currency ("from"), the target currency ("to"), and the amount being converted. The "info" key provides additional information about the exchange rate used in the conversion, including the timestamp of the exchange rate data and the actual exchange rate ("rate"). The "historical" key indicates whether historical rates were used for the conversion, while the "date" key provides the date on which the exchange rate data was collected. Finally, the "result" key provides the final converted amount of JPY that corresponds to the original 25 GBP amount.
JSON output explained
{
"success": true,
"query": {
"from": "GBP",
"to": "JPY",
"amount": 25
},
"info": {
"timestamp": 1519328414,
"rate": 148.972231
},
"historical": ""
"date": "2018-02-22"
"result": 3724.305775
}
Conclusion
Today, we have discussed the Fixer currency conversion API and the information that it provides in both table and JSON formats. The table describes the various objects that are returned by the API and their corresponding descriptions, while the JSON output shows a specific example of a currency conversion and its associated data. The information provided by the Fixer API is incredibly useful for developers who need to perform currency conversions in their applications, and the clear and concise breakdown of each object in the table, as well as the detailed data provided in the JSON output, can help developers to integrate the API into their applications more effectively and troubleshoot any issues that may arise. By understanding the information provided by the Fixer API, developers can create more accurate and reliable currency conversion tools for their users.
Endnote
You can gain access to the Fixer currency conversion API through the third-party data marketplace of Worldindata. Worldindata provides a platform for accessing and downloading various data sets, including the Fixer API. Users can gain access to a range of data sources, including the Fixer API. Once you have access, you can start using the API to perform currency conversions in your applications. The use of the API is subject to the terms and conditions set out by Worldindata and Fixer, including any usage limitations or fees. It's worth noting that while Worldindata provides access to the API, they do not control or manage the API themselves, and any issues or support queries should be directed to Fixer directly.