The Apipheny add-on for Google Sheets comes with a built-in feature that lets you reference any cell value in your API request.
Referencing cell values in Apipheny allows you to pull data from a cell(s) on your spreadsheet and use that data in your API request.
Here’s a quick video tutorial to get you started:
Note: currently you can reference one cell at at time in your API request. We plan to release an update shortly that allows you to reference a range of cells, instead of one at a time. We will send an email out as soon as the reference a range of cells feature is ready to use.
To reference cell values in your Apipheny API request, all you have to do is wrap the sheet name (e.g., Sheet1, Sheet2, Sheet3) and cell value (e.g., A1, B2, C3) in 3 curly brackets, separate by a colon.
Like this:
{{{SheetName!CellValue}}}
You can reference a cell value in your API URL, Headers, or POST Body.
If you’re new to Apipheny, just follow the steps below and you’ll be ready to use this feature in no time.
To begin, go to your spreadsheet then click Add-ons > Apipheny – API Tool > Import API. If you don’t already have the add-on installed, you can install it here.
Before you can reference the cell, you need to know where it is. Locate the cell and record the sheet name and cell value.
In the example above, we want to reference the cell that contains “ditto”. The sheet name for that cell is “Pokemon”, and its cell value is “A1”.
The official format for referencing cell values in Apipheny is: {{{SheetName!CellValue}}}
Just take the cell’s sheet name and cell value, separate them with an exclamation point (!), and wrap everything in 3 curly braces {{{x:y}}}.
Then insert that into your API URL, header, or POST Body.
So let’s say our API URL is:
https://pokeapi.co/api/v2/pokemon/ditto
And let’s say we want to insert the last parameter, “ditto”, into our spreadsheet and reference this cell instead of including it directly in our URL.
To reference the cell containing “ditto”, here’s what we’ll use: {{{Pokemon!A1}}}
If we append that to the base URL of the API we’re using, here’s what we’ll get:
https://pokeapi.co/api/v2/pokemon/{{{Pokemon!A1}}}
which is the same as running a request with this URL:
https://pokeapi.co/api/v2/pokemon/ditto
You can even reference a cell containing an API’s base URL to make things even simpler. If we do that using the example above, here’s what we’ll get:
https://{{{Pokemon!A5}}}{{{Pokemon!A1}}}
which is the same URL as before.
You can reference a cell value in your API URL, Headers, or POST Body.
After you’re done setting everything up, press Run to send your request to the server.
And that’s it!
Congratulations, you now know how to reference cell values in your Apipheny API requests.
Crypto API tutorials and more:
Sponsored by Zink Virtual Tip Jar & Rewording.io Paraphrasing Tool
Accept donations on Twitch | Accept donations on Discord | Accept donations on YouTube | Accept donations on Telegram | Accept donations on Twitter | Accept donations on TikTok | Accept donations on Instagram | Accept donations on LinkedIn | Accept donations on Facebook | Accept donations on your Website