TASK_API allows you to integrate external APIs directly within your Google Sheets. It enables you to call any API from your spreadsheet, pass parameters from cell values, and display results where you need them. This function simplifies API connectivity without requiring complex coding.
=TASK_API(api_name, api_params, celladdress)
Parameter | Data Type | Required | Description |
---|---|---|---|
api_name |
|
Required | The name of the API template to use. This references an API template previously imported using the Sheet Workflows sidebar. |
api_params |
|
Optional | A parameter string formatted as "key1:value1;key2:value2". Cell values can be referenced using curly braces (e.g., "name:{A2};age:30"). |
celladdress |
|
Optional | The cell address where the result should be placed. If omitted, the result appears in the cell to the right of the function cell. |
You can populate parameter values dynamically by using curly braces
{...}
"key1:{A2};key2:{B5}"
"product:{product};price:{price}"
Example:
=TASK_API("WeatherAPI", "city:{A2};units:metric", "C2")
For APIs requiring array parameters, format them as JSON arrays. For example:
=TASK_API("ProductAPI", "product_ids:[123,456,789];format:json")
After running TASK_API, a dropdown is automatically created in the adjacent column to help you extract specific fields from the JSON response.
JSON_EXTRACT
You can copy the dropdown to additional columns to extract multiple values from the same API response.
This example calls the Weather API template with "New York" as the location and uses metric units.
=TASK_API("WeatherAPI", "location:New York;units:metric", "C2")
This example looks up a stock quote for the ticker symbol specified in cell A2.
=TASK_API("StockQuoteAPI", "symbol:{A2}", "B2")
This example converts an amount from a base currency to a target currency using dynamic cell references.
=TASK_API("CurrencyAPI", "from:{base_currency};to:{target_currency};amount:{C3}")
This example looks up customer data based on the customer ID from the current row.
=TASK_API("CustomerAPI", "customer_id:{customer_id}")
Use the Import API form in the Sheet Workflows sidebar. Provide the API documentation, and the system automatically creates the template without any coding required.
Yes, you can update existing API templates through the Import API form. The system manages the template structure automatically.
Pass values by referencing cells or column headers in your parameter string using curly braces. For example: "customer_id:{A2};status:active".
Yes, as long as the API accepts HTTP requests and returns data in a parsable format (such as JSON), you can use it with TASK_API.
A dropdown automatically appears in the adjacent column after running TASK_API, allowing you to select and extract specific fields from the JSON response.
TASK_API recalculates based on your sheet's calculation settings. You can also manually execute it using the "Run" button in the sidebar.
Google Sheets imposes quotas and limitations on API calls. For high-volume usage, consider implementing caching or batching strategies.
For APIs requiring complex authentication, set up authentication separately and incorporate the tokens into your API template.
1 month ago
1 month ago
1 month ago