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

url

Yes

String

Target endpoint URL. Must include the protocol (http:// or https://).

method

Yes

String

HTTP method for the request (e.g., GET, POST, PUT, DELETE).

body

No

String

Raw text request payload. Used primarily with methods such as POST and PUT. Supports JSON, XML, or form-encoded data.

headers

No

String

Raw text of HTTP headers in the format "Header-Name: value". Multiple headers can be separated by line breaks (``).

output_cell

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:


Notes & Best Practices

  1. Escaping quotes:

Double quotes inside strings must be escaped by doubling them (""key"":""value"").

  1. Line breaks in headers:

When specifying multiple headers, separate them with CHAR(10) or \n.

  1. Output targeting:

Use the output_cell parameter if the HTTP response is large or if you want to avoid overwriting the formula cell.

  1. Security:

Avoid placing sensitive API keys or tokens directly in cells without adequate workbook protection.

Updated on: 15/08/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!