The LogicSheetAPI formula

Use the =LogicSheetAPI custom function to import API directly to your worksheet using cell formulas.

How to use =LogicSheetAPI?

Call the LogicSheetAPI custom function by typing =LogicSheetAPI in any cell. Now you will see a list of parameters to fill in to use the function. You will also be able to see the documentation inside your Google Sheets. If the documentation doesn't show up, just click the question mark(?) next to the function name.

Parameters

Here are the parameters you can use to call LogicSheetAPI.

  • method: The HTTP request method for the API request. It can either be "GET" or "POST".

  • url: The URL of the API endpoint. You can also include request parameters in the URL.

  • path: [optional] A list of paths to be imported. For example: "/first_name, /email" will only import data under the "first_name" and "email" paths. If you don't want to specify the path, just use "" in the parameter to escape it.

  • header: [optional] The request header should be a comma-separated list of header items. You can use it to pass authentications. For example: "apikey=YOUR_API_KEY,content-type=application/json". No space before or after commas.

  • requetBody: [optional] For the POST method only. The request body sent to the API endpoint. Type in JSON format if you are using application/json.

Here is an example GET request

GET https://api.thecatapi.com/v1/votes?limit=3

Headers

Name
Type
Description

x-api-key

DEMO-API-KEY

content-type

application/json

This is how you can make the GET request using LogicSheetAPI.

=LogicSheetAPI("GET", "https://api.thecatapi.com/v1/votes", "", "x-api-key=f2b451ef-af64-49d4-8594-378ee24ae040,content-type=applic
ation/json")

This is an example of the LogicSheetAPI working on Google Sheets. Parameters are stored in separate cells.

This is an example result:

Here is an example POST request

POST https://api.thecatapi.com/v1/votes/

Headers

Name
Type
Description

x-api-key

DEMO-API-KEY

content-type

application/json

Request Body

Name
Type
Description

image_id

the_image_id

sub_id

my-user-1234

value

3

This is how you can make the POST request using LogicSheetAPI.

=LogicSheetAPI("POST", "https://api.thecatapi.com/v1/votes", "", "x-api-key=DEMO-API-KEY,content-type=applic
ation/json", D2)

This is an example of the LogicSheetAPI working on Google Sheets. Parameters are stored in separate cells.

Last updated

Was this helpful?