Static sites can't hide an API key, which is why most currency converter tutorials end with "now set up a small server". You can skip that step: AllRatesToday's open endpoint needs no key and allows cross-origin requests, so the browser can call it directly.
Here's a complete converter for GitHub Pages, Netlify, Cloudflare Pages or a plain HTML file.
The HTML
<form id = "fx" > <input id = "amount" type = "number" value = "100" min = "0" step = "any" > <select id = "from" ></select> β <select id = "to" ></select> <output id = "result" ></output> <small id = "asof" ></small> </form> <p><a href = "https://allratestoday.com" > Exchange rates by AllRatesToday </a></p>
Enter fullscreen mode
Exit fullscreen mode
The JavaScript
const $ = ( id ) => document . getElementById ( id ) ; let table = { base : null , rates : { } , date : "" } ;
async function load ( base ) { if ( table .β¦