Search API Connector Documentation
Multi-query requests let you stack multiple requests together and run them one after the other as a unified block. Often this involves referencing a list of values from an existing table in your sheet.
When you run a multi-query request, API Connector will cycle through the requests and print out the results one after another in a single sheet. There are three ways to run multi-query requests:
- Run requests for a list of URLs, e.g.
GETdata for each campaign ID in a list
- Run requests for a list of request bodies, e.g. create new project tasks by sending multiple
POSTrequest bodies to the same URL
- Run requests for a list of URLs and request bodies, e.g. update inventory by running down a list of product URLs and sending a different
PUTrequest body for each one.
For simplicity, the examples below show how to run multi-query requests by entering values directly, but all multi-query requests can reference cell values instead.
- Before you begin
- Run requests for a list of URLs
- Run requests for a list of request bodies
- Run requests for a list of URLs and request bodies
- Use cell values in requests
Before you begin
Click here to install the API Connector add-on from the Google Marketplace.
Run requests for a list of URLs
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. In this example, 3 requests to the iTunes API were run in a row, with just the "term" parameter changed for each one.
The above method will work for
GET requests as well as
PUT requests that send the same request body to different URLs.
Run requests for a list of request bodies
In some cases, you may want to cycle through a list of
PATCH requests, sending a different request body for each API call while the request URL stays the same.
Multiple request bodies should be entered one by one, with each request body separated by the word
:::BREAK::: and the "Multiple request bodies" option ticked.
Run requests for a list of URLs and request bodies
In this type of request, you'll want to cycle through a list of request URLs, where each request URL also has its own request body. As above, each URL should be on the same line, and each request body should be separated by the word
:::BREAK::: with the "Multiple request bodies" option ticked.
The first URL will be associated with the first request body, the second with the second, and so on. In this example screenshot, the list of request URLs is represented by a cell reference.
In these requests, the count of request URLs must match the count of request bodies.
Use cell values in requests
Instead of directly entering values into the request input fields, you can instead reference values from the cells in your sheet: Use Cell Values in Requests
- A 2 second delay is automatically inserted between requests to avoid rate limits.
- To easily identify where each request starts, tick the "Add request URL" or "Add timestamp" boxes under Output options (leave the "Each row?" option unticked). This will print out the URL and/or timestamp at the start of each new request.
- Each request in a multi-query request block will consume one of your monthly runs. This is in addition to any monthly runs consumed through pagination.