Run Multiple Queries in a Single Request

This advanced feature of the API Connector add-on for Google Sheets enables you to stack multiple request URLs together and run them one after the other as a unified block. API Connector will cycle through the URLs and print out the results one after another in a single sheet.

This is a paid feature, please upgrade to access.

For more robust pagination handling, try the pagination function.

Contents

Why Use the Multi-Query Function?

  1. Multi-query requests are commonly used to account for simple API pagination, in which an API limits the number of records returned in each response and requires you to make multiple requests to retrieve the full set of data. There are two common methods of pagination that can be managed via multi-query requests:

    ■ pagination parameters: www.demo.com/api?page=2
    ■ offset-based pagination: www.demo.com/api?offset=0&limit=100

  2. Multi-query requests can also be used to query the same (or similar) API endpoint multiple times, e.g. for different company IDs, different stock symbols, different time periods, etc.

Example 1: List URLs in the URL input box

To run multiple requests, list your URLs on separate lines. When you Run the request, each subsequent response will be appended to the first empty row.
multi-query-img1

Example 2: Reference Cells

You can reference cells in the input box (info). Again, make sure each separate request is on a new line, to ensure API Connector recognizes it as a new request:
multi-query-img2

Example 3: Reference a Range of Cells

As a shorthand method, instead of referencing cells one by one, you can reference them as a range, like this:
multi-query-img3

As shown in the screenshots above, when you reference a cell, you can reference the entire URL or part of the URL.

Notes

  • When you stack requests, response data from each query will be sent to a single sheet, with each subsequent request appended to the first empty row.
  • When running multiple queries, a 1.5 second delay is automatically inserted between requests to avoid rate limits.
  • There’s no specific limitation on stacking GET vs POST/PUT requests, but only the URL field accepts stacked URLs, which may limit its usefulness for POST requests.

Leave a Comment