API Query Builder + Google Sheets: Dynamic Single Pages based on API data

Hey @Daniele ,

Thank you for the fantastic Bricksforge plugin! It’s one of my go-to tools in the Bricks ecosystem for enhanced features. I recently started exploring the API Query Builder and encountered a problem.

I have a project that includes a list of institutions along with their individual details, all stored in a Google Sheet. I’ve integrated this sheet with the API Query Builder and created a page (i.e., domain.com/institutes/) that displays over 100 institution names and their locations. I also added custom links to each institution’s name (i.e., domain.com/institute/yale-university/) using the slug value from the API data. So far, everything is working fine.

The Google Sheet contains columns from A to P, structured as follows:

  • A - slug (yale-university)
  • B - name (Yale University)
  • C - city (New Haven)
  • D - state (…)
  • E - country
  • F - type
  • G - …
  • H - …
  • (and so on up to P)

Now, I want to set up dynamic single-institution pages that can be accessed through the custom links, which will display additional details about each institution. The API Query Builder can dynamically retrieve the {route} from the URL and output the corresponding institution’s details.

I could set up a Custom Post Type (CPT) called “institute” and create a Bricks Page Template for the dynamic data. However, I’m stuck on how to pull dynamic data from the API for a single institution.

Is this possible with the current functionality of Bricksforge? Can you guide me on how to achieve this?

Reagrds,
Saurabh

Hey :slight_smile: That’s absolutely possible. You just need a separate API Query Builder instance for your single pages.

On this individual instance, you can then use query parameters to fetch data for a specific range instead of all data. Take a look at the Google Sheets API reference for more information on how this can be done. :blush:

Then, with the :id instance, you can define a placeholder for your dynamic value.

For example, your-website.com/:letter. Doing this, an URL like your-website.com/e will grab the information from this specific url.

Google Sheets API Reference: