Creating a GET request

How to make HTTP GET requests with the GET function.

You can use Rows to set a GET request to any API and return the data to a cell. If you're not sure what a GET request is, check out Getting Data from any API first, otherwise, read on!

GET request examples:

To understand how GET requests work in Rows, let's first look at a few examples.

GET with no authentication

Here's an example of a simple formula that sends a GET request to the Datamuse API to get all words that rhyme with "rows".

=GET("https://api.datamuse.com/words?rel_rhy=data")

  • In this example, the API doesn't require any authentication but, in reality, most APIs require you to provide some authentication details (which serve the same purpose as a user name and password).

  • For this reason, The GET function takes a second optional parameter where you can specifiy the content of the header which is how authentication details are often provided.

GET with bearer authentication

Here's an example of a GET request with Bearer Authentication:

=GET(https://api.twitter.com/2/users/by/username/rowshq, '{"Authorization": "Bearer AAAAAAAAAAAAAcE3F..."}')

  • The authentication details are specified as JSON which is a little tiresome to enter by hand. You can use the supplementaryPAIR2JSON formula which converts one or more value pairs into JSON for you.

GET with bearer authentication using PAIR2JSON

Here's an example of a GET request with Bearer Authentication that uses the PAIR2JSON function:

=GET(https://api.twitter.com/2/users/by/username/rowshq, PAIR2JSON("Authorization","Bearer AAAAAAAAAAAAAcE3F..."))

  • The PAIR2JSON function has taken the two string arguments:
    • Authorization and
    • Bearer AAAAAAAAAAAAAcE3F..."

      ... and converted them into the required JSON format from the first example: {"Authorization": "Bearer AAAAAAAAAAAAAcE3F..."}

GET with bearer authentication using PAIR2JSON and CONCAT

You coulld also put the bearer token in a cell such as A1 and concatenate it with the "Bearer " prefix it like this:

=GET(https://api.twitter.com/2/users/by/username/rowshq, PAIR2JSON("Authorization:",CONCAT("Bearer ",A1))

Creating a GET request:

The easiest way to create a GET request is through the function wizard which guides you through the options for the GET function. You can access this wizard from the autocomplete menu when you start to type a formula.

GET function wiizard example


You can also access the function wizard from the main toolbar.

To create a GET request with the function wizard, follow these steps:

  1. Select a cell where you want to create the GET request.
  2. Click the Function Wizard Function wizard button in the main toolbar.
  3. In the search box, search for GET and click the result.
  4. In the options panel, configure the options for the GET function.

    OptionUse To
    Action URLThe URL of the API that you want to interact with.

    For example, the action URL of Twitter's user information API is https://api.twitter.com/2/users/by/username/rowshq
    Set headersA JSON object that contains headers that you want to send along with the API request .

    For example, {"content-type": "application/json"}

    You can use the PAIR2JSON function to create these headers from cell values. For more information about what headers do, take a look at the Postman documentation.
    Set response typeSet the format of the response that you want to receive from the API.

    • 0 (default) — The content of the API response.

      </li>
    • 1 —Only the numeric status code without any content (such as 200 or 401).

      </li>
    • 2 — The full JSON of the API reponse which includes the content, the status code, and the response headers.</li></ul>


    • Click Save Changes in Cell... to apply the GET formula.

      Your cell should now contain the value {data} which indicates that the GET function has received some kind of response from the API.

    • (Optional) Create a data table from the content of the response so you can review the data in your spreadsheet.