Capture inpage metadata

We have a web application that gets data from a third party web service dynamically when a user visits a page. For example, the person clicks on a home for sale link and it takes them to a details page of the home. When the page is being rendered we fetch some external data (in JSON format) like Price, Bedrooms, Bathrooms, etc.

What would be the best way to capture this data and store along with the page analytics?

You can use up to 5 custom variables per visit, and 5 per page view: Custom Variables Analytics - Analytics Platform - Matomo

To clarify, would I be able create a variable for say “Price” and be able to add that data element to the tracking? Basically Price is an html element in the web page.

You must call a bit of javascript, see in the custom variable documentation for some basic example, you could deifnitely set variable name=price value=65