Javascript currency converter api8/9/2023 ![]() To enable our application to have the functionality of instantly converting the entered amount, we need to use the “onkeyup” attribute and call the function ‘currenc圜onvertor()’ when the user enters any amount. In the next row of the table, our first column has to contain a text input therefore we use the input tag and specify its type to be ‘text’. We first specify our heading inside an H2 tag and then then we insert an image. ![]() Create a mind map of what you need in your webpage: you need a heading, an image, a table with two rows and two columns – one column containing the text input and the other column containing a dropdown selection menu for your currencies. Next, we begin to write the contents of our webpage. This is how your code should look like at this point: We shall begin with creating a basic HTML Boilerplate, attach our stylesheet and specify meta tags. How to create the front end of our currency convertor? Also, I have set the default base currency as USD and to be converted to INR. I have entered the following currencies you can add as many as you want. Today we will be building a simple currency convertor using Fixer API which converts the amount entered instantly as the user types in a number. It is a good practice to keep your API keys hidden even when you are creating a resource for educational purposes. You do not have to copy the key in the screenshot as I have reset my key and the older one won’t be live anymore. The API keys basically track what and who is utilising the data. ![]() After creating an account, head over to your dashboard and copy the unique API key generated. To begin using this API, you can create an account on their official website (link to the same is provided at the end of the article). Not only this, the data that is delivered by this API is correct up to 6 decimal places which clearly signifies the ease and accuracy combo Fixer API offers, Detailed documentation serves as the cherry on the cake which allows even beginner level coders to understand the usage of this API thoroughly. Fixer API uses data from various trusted sources including the European Central Bank.įixer API is extremely easy to use and implement in one’s a website and code. ![]() It has been used by a large number of developers worldwide and has exchange rate data for 170 countries which is updated in every 60 seconds (pretty accurate, isn’t it?). Fixer API is an API which is used to retrieve current and historical foreign exchange (forex) rates. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |