Automated Export to any API
You can combine Lido's CALLURL function and automations to export data to any API.
CALLURL Function
Syntax:
CALLURL(url, method, [body], [headers], [output_cell])
Description:
Executes an HTTP request from within Excel to a specified URL using the given method (e.g., GET
, POST
). Optionally includes a request body, custom headers, and designates an output cell to receive the response.
Parameters
Parameter | Required | Type | Description |
---|---|---|---|
| Yes | String | Target endpoint URL. Must include the protocol ( |
| Yes | String | HTTP method for the request (e.g., |
| No | String | Raw text request payload. Used primarily with methods such as |
| No | String | Raw text of HTTP headers in the format |
| No | Cell reference | The cell where the response will be written. If omitted, the response is returned to the calling cell. |
Return Value
- Returns the HTTP response body as a string.
- May return an error if:
- The URL is invalid.
- The request fails (network error, timeout, or non-2xx HTTP status without proper handling).
- The request body or headers are improperly formatted.
Example Usage
=CALLURL(
"https://jsonplaceholder.typicode.com/posts",
"POST",
"{""title"":""ab84"",""body"":""rg87"",""userId"":1}",
"Content-Type: application/json"
)
Explanation:
- Sends a
POST
request tohttps://jsonplaceholder.typicode.com/posts
. - The JSON body contains
title
,body
, anduserId
. - Sets the
Content-Type
header toapplication/json
. - Returns the JSON response from the API.
Notes & Best Practices
- Escaping quotes:
Double quotes inside strings must be escaped by doubling them (""key"":""value""
).
- Line breaks in headers:
When specifying multiple headers, separate them with CHAR(10)
or \n
.
- Output targeting:
Use the output_cell
parameter if the HTTP response is large or if you want to avoid overwriting the formula cell.
- Security:
Avoid placing sensitive API keys or tokens directly in cells without adequate workbook protection.
Updated on: 15/08/2025
Thank you!