Integrate a third-party API
Last updated 18 November 2026
In this tutorial you call a public exchange-rate API from your site, save the rates in a database, and show them on a page. You end with a refresh endpoint that any scheduler can call, a background job that does the work, and a page that lists the latest rates.
You need a site and a codebase you can deploy. If you have not set those up yet, follow Set up your environment first. This tutorial does not repeat it.
- A scheduler calls your refresh endpointIt sends a secret key in a header
- The endpoint queues a background jobIt answers 202 at once
- The job calls the third-party APIapi_call_send, then one record per rate
- A page lists the saved ratesA records query
Step 1 of 8
Look at the API you will call
This tutorial uses Frankfurter, a free exchange-rate API that needs no key. Call it from your own computer first, so you know what the response looks like.
curl 'https://api.frankfurter.dev/v1/latest?from=AUD&to=USD,EUR,GBP'
{"amount":1.0,"base":"AUD","date":"2026-10-30","rates":{"EUR":0.62877,"GBP":0.52427,"USD":0.70246}}Your job will read two parts of this: date, and the rates object, which holds one currency code and one number per entry.
Check it worked: you see JSON with a rates object. Your numbers and date will differ.
All 8 steps done
You finished Integrate a third-party API. Pick where to go next.