Welcome to the Airtable community!
When using the Airtable REST API, you need to make a new api call for each table. Then you need to match up the parent and child records by record_id.
As the code can get a bit lengthy, I recommend setting up a development environment on your local computer. You will then be able to separate things into different files and use version control software.