Using PHP library to access Airtable data

I’m trying to access data that is stored in an Airtable base using the airtable-php client (https://github.com/sleiman/airtable-php?tab=readme-ov-file).
I can use their example with my base to retrieve the data and dump the contents of the object to my page, however I don’t know enough about PHP to access the data elements from each record so that I can do something with them.
Ultimately I’m trying to make a snippet that will grab the data from a ‘Gigs’ table for a band and will create an upcoming schedule in modx. That makes it easy for the client to update the gigs that they have without having to actually log into the back end and create/edit them.
Can anyone give me advice as to how I would access the returned data and then use it within modx.
Many thanks in advance.

So I assume you used the line var_dump( $response[ 'records' ] ); from the page you linked?
What is the type of data that gets output? Is it an associative array?
Something like this?

array(2) { ["key1"]=> string(6) "value1" ["key2"]=> string(6) "value2" } 

If it is an associative array, then you could use this array directly in the MODX function getChunk() to parse a chunk with placeholders like [[+key1]]:

$parsedChunk = $modx->getChunk('nameOfChunk', $associativeArray);

You might also want to take a look at the get() and set() functions of the MODX cache manager, so that you can cache the result of the snippet for some time and don’t have to query Airtable for every request to your website.

Thanks halftrainedharry. It seems it returns an array of objects for each record, and the fields property of the objects is an array of the Airtable fields for that record. Took a bit of learning the syntax to access elements in arrays/objects as well as casting the result to an array, but that eventually works with getChunk. Thanks for the heads up about the modx cache manager as well.