Search API Connector Documentation


Create API Request Based on a Cell

One of the advantages of using the API Connector add-on for Google Sheets is that API requests can be based on dynamic or fixed values within your spreadsheet. This is a very flexible function that enables you to, for example, use an automatically updated date in a spreadsheet as the start or end date of a query.

You may reference cells in the API URL path, Headers, and POST body fields.


Reference cell containing full value

To use this function, wrap your cell reference in 3 plus signs on either side. (The plus signs tell API Connector that this is a cell reference and not part of the original URL.) So a reference to cell B2 in a tab called QuerySheet would be written like this: +++QuerySheet!B2+++


You can also reference cells in your Header fields and POST request bodies:


Combine fixed values and cell references

Your request field can contain a combination of fixed values and cell references. Just wrap the cell reference piece in 3 plus signs as described above, like this:


Reference Multiple Cells

You can both reference cells and stack multiple requests together (paid feature). This is useful for running through a list of requests, like this:!A1:A10+++ 


  • When referencing dates in cells, make sure you match your API’s format requirements. If your API requires a date format like ‘2020-08-28’, it may not work if you use a formula like =today()-1 and set the display format in the toolbar. Instead, set your date explicitly with a function like =text(today()-1,"yyyy-mm-dd").
  • The ImportAPI() Custom Sheets Function is an alternate method of running API requests based on a cell.

27 thoughts on “Create API Request Based on a Cell”

  1. So, linking to cells for a POST is now possible? If so, can the body of a request be dynamic based with fields tied to cells?

  2. Hello Ana, firstly I would like to thank you for your contribution, this add-on is simply a great work!

    Quick question – would it be possible to Trigger the API call when there is a change in the Cell Value? There are few scenarios where this would be helpful.

  3. Can you reference a cell in the required headers? APIs often require authentication tokens in the header, which then require an API POST to get that token for their temporary period of time (usually 5min). Great add-on by the way, makes writing APIs super easy!

    • You would add that entire URL into the API URL Path input field, making sure to include your API key in the empty space where it reads ?key= (the API documentation should tell you how to get your API key). The documentation will also tell you if that API requires headers; if not, you’d just leave that section blank. I suggest checking out the Quick Start article for a complete example of how to set up and run an API request.

  4. This is a great tool. Is there a way to stack cells in body as well? I tried with +++Sheet1!A2:A5+++ but returns only A2.

      • when i use reference cell function on jmespath like this

        “data[*].{account_name:account_name,date:date_start,currency:account_currency,device:impression_device,spend:spend,impressions:impressions,clicks:clicks,conversion:actions[*] |[?action_type==’+++Remark!C22+++’] | [0].value,conversion_value:action_values[*] |[?action_type==’+++Remark!C22+++’] | [0].value}”

        it does’t work. can you help me to fix this problem?

      • Oh, I apologize, I misread your earlier question. The JMESPath field does not currently accept cell references, cell references can only be used in the request URL, headers, and POST body fields. Sorry for the inconvenience, I’ll try to add that in the future.

Leave a Comment