The LogicSheetAPI formula
Use the =LogicSheetAPI custom function to import API directly to your worksheet using cell formulas.
Last updated
Use the =LogicSheetAPI custom function to import API directly to your worksheet using cell formulas.
Last updated
If you want to use the =LogicSheetAPI function in a new spreadsheet, you have to launch the Logic Sheet add-on at least once in that spreadsheet. The add-on can be found in the Add-on menu. If you haven't installed Logic Sheet yet, click here to install.
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.
Here are the parameters you can use to call LogicSheetAPI.
It's a good practice to store parameter content in separate cells for later reference. It will also help you escape quotations markets if you want to include a JSON request body.
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.
GET
https://api.thecatapi.com/v1/votes?limit=3
Name | Type | Description |
---|---|---|
This is how you can make the GET request using LogicSheetAPI.
This is an example of the LogicSheetAPI working on Google Sheets. Parameters are stored in separate cells.
This is an example result:
POST
https://api.thecatapi.com/v1/votes/
This is how you can make the POST request using LogicSheetAPI.
In this example, we use cell D2 to store the request body in order to escape the quotation marks in the JSON string.
This is an example of the LogicSheetAPI working on Google Sheets. Parameters are stored in separate cells.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
x-api-key
DEMO-API-KEY
content-type
application/json
x-api-key
DEMO-API-KEY
content-type
application/json
image_id
the_image_id
sub_id
my-user-1234
value
3