Getting data from any API using http GET (2024)

New to Rows?

Rows is the spreadsheet with superpowers, where anyone can build automation and internal tools without code.

It has 50+ built-in data integrations with the tools you use everyday, and a powerful sharing experience to instantly turn any spreadsheet into a web app, a form, or a dashboard.

Get started for free.

You’ve got the knowledge and Rows tools to authenticate your requests. But you’re probably wondering how to test and get data from an API:

Stick with us, as in this article we’ll talk about:

  1. Some more basic terms in API documentation
  2. How to use Rows’ GET() function to request data directly on your spreadsheet.
  3. How to use a POST() function to send data to a spreadsheet

Some more basic terms in APIs

Again, we’ll need to just quickly make sure that we’re all on the same page regarding some terms.

Base URL
The Base URL (also called the Request URL) is the URL that you need to use to access the API. Look for these terms in the API docs.

Endpoint
The Endpoint is where the data that you want to interact with is located. You add it to the base URL after a forward slash /.

Query
This is what you want to get. After the endpoint, you’ll see a ? followed by a lot of key-value pairs, joined with &.

Now, all these three things together create what in Rows we refer to as the action_url:

Getting data from any API using http GET (1)

How to know which endpoint you need to access?
Well, that’s up to you 😅. Endpoints are usually grouped according to the data that they interact with and what you can do with it.

If you have a look at the Spotify API:

Getting data from any API using http GET (2)

You’ll see that they group them by data (Playlists), and then provide you with the base URL, along with the endpoints (along with a description with what you can do). So for example, if you wanted to get all the playlists in your account you’d just need to send your request to this URL (with some authentication, of course):

https://api.spotify.com/v1/me/playlists

But if you look at how to get a specific playlist, you'll see some curly brackets {}? These mean that you need to provide some parameters to the URL. For example, if you wanted to get all the tracks for a playlist:

https://api.spotify.com/v1/playlists/{playlist_id}/tracks

Then you’d need to find out the Spotify ID of the playlist and replace the {} brackets with that ID. For example:

https://api.spotify.com/v1/playlists/00981234jsadf920lu/tracks

So, now you have all the knowledge you need to start getting data from APIs! Let’s try some out in Rows.

Feeling ready?

Have a look to our HTTP GET Tester and try to make a GET call yourself.

Getting data

You’ll never guess what function you need to use in Rows to get data from any API… it’s called GET()!

Getting data from any API using http GET (3)

And you already know what you need to put in for the action_url and headers parameters.

Hint

In action_url you would have the base URL, the endpoint you want to use, and possibly your authentication.

In headers you'd put your authentication (if needed).

Let’s put this all into practice by testing some API requests on a dummy API.

JSON Placeholder API

We’ll be using a free dummy API provided by JSON Placeholder to clearly illustrate some examples. Of course, you are free to use the API of your choice.

The base URL for JSON Placeholder is https://jsonplaceholder.typicode.com

JSON Placeholder has 6 different endpoints

  • /posts
  • /comments
  • /albums
  • /photos
  • /todos
  • /users

In our test, we'll request from the /posts endpoint.

On top of this, JSON Placeholder also allows you to get a specific record ID from each endpoint, by giving a value from 1 to 100 after the endpoint. E.G /posts/1

To get set up, we will create a table to add all the options and lay them out in a logical order.

Getting data from any API using http GET (4)

Fill in your spreadsheet with the following info:

CellContent
A1Base URL
A2jsonplaceholder.typicode.com
B1Endpoint
B2/posts/
C1Record ID
C21
D1Action_URL
D2=CONCATENATE(A2,B2,C2)
E1GET()
E2=GET(D2)

As soon as you place all the info in the table and hit Enter in cell E2, the API request will be made and the cell will populate with a {data} cell.

Congratulations 🥳! You just made your first API call in Rows.

You can now inspect the data you received by clicking the {data} cell and choosing "Inspect data". In this inspection window, you can also quickly add the response value to any cell, which will add the PARSE() function formula to that cell. Read more about Parsing JSON data here.

Alternatively, you can also create a data table from the {data} cell by clicking on it and choosing "Create new Data Table" from the menu.

Getting data from any API using http GET (5)

Try exploring more functionality from the JSON Placeholder API. Try testing a new endpoint or try getting all records, by leaving the value in C2 blank.

Sending data

Using the Rows API, you are able to send data directly to a spreadsheet's table by using two distinct methods.

  1. Overwriting cells in a range
  2. Appending values to a range

Please review the full API documentaiton regarding this method.

We also have a template available to help you get started quickly and to have an example of this at your finger tips to experiment with. You will find the 2 relevant API requests in the Spreadsheet page and in the tables named Overwrite cells in range & Append values to range respectively.

Up next

OK, so you learned some theory as well as successfully used an API call in Rows to get weather data! That’s pretty amazing, right?

More for Advanced users

Want to learn more? Well then, check the rest of our Advanced Rows series:

  1. Authenticating your API calls
  2. Getting data from any API (you're here)
  3. Sending data to any API: Up next! 🚀
  4. Modifying JSON
  5. Filtering with JsonPath
  6. Managing multiple integrations
Getting data from any API using http GET (2024)

FAQs

How can I get specific data from API? ›

The Base URL (also called the Request URL) is the URL that you need to use to access the API. Look for these terms in the API docs. The Endpoint is where the data that you want to interact with is located. You add it to the base URL after a forward slash / .

How to get data from API using HttpClient? ›

Use the HttpClient. get() method to fetch data from a server. This asynchronous method sends an HTTP request, and returns an Observable that emits the requested data when the response is received.

How to extract data from APIs? ›

How to extract the API data
  1. Step 1: retrieve the API data URL.
  2. Step 2: create a new, blank Excel document.
  3. Step 3: paste the API data URL in the Excel document.
  4. Step 4: Enter the credentials.
  5. Step 5: load the API data in the Excel.
Oct 28, 2021

How to fetch data from APIs? ›

With the Fetch API, you make a request by calling fetch() , which is available as a global function in both window and worker contexts. You pass it a Request object or a string containing the URL to fetch, along with an optional argument to configure the request.

How do I get value from one API to another? ›

Retrieve Data From an API

We will use the setattribute() method to store the data from an API, and then it can be used to pass to other APIs using the getattribute() method. We created a member and set the values inside the member to a variable.

How do I retrieve data from REST API? ›

To retrieve API data using a REST client, follow these steps:
  1. Choose a REST client tool or library suitable for your project's requirements and language.
  2. Set the HTTP method (usually GET for retrieving data) and provide the API endpoint URL.
  3. Configure any required headers, such as API keys or authentication tokens.
Jul 22, 2024

How to use HttpClient to get JSON data? ›

To receive JSON data, you will make a request to a server endpoint and then deserialize the JSON string back into an object. Make a GET request using HttpClient. GetAsync or similar methods.

How to call rest API using HttpClient? ›

Call REST API by configuring the HTTP authentication style

Use the UserToken that is generated during the login call in subsequent calls. The user includes _loginid and _token as query parameters to the REST API URL. Note: You must use the HTTP client such as Postman for STANDARD authentication.

How do I get data from a web API? ›

  1. Register a Web API.
  2. Create a JSON parser.
  3. Create a JSON Dataset.
  4. Create a Knowledge Graph.
  5. Create a Transformation.
  6. Create a Workflow.

Can I scrape data from API? ›

API scraping is the process of extracting data from an API that provides access to web applications, databases, and other online services. Unlike extracting from a website's visual components, this method uses simple API calls to interact with a service's backend, ensuring more structured and dependable data retrieval.

How to query an API? ›

How to query. Queries are performed by issuing an HTTP GET or POST request to an endpoint URL and specifying a query URL parameter (in the GET case) or a JSON-valued payload in the POST case, which contains the query to execute. Results are always returned in application/json form.

What is the fetch method in HTTP? ›

The fetch() method takes one mandatory argument, the path to the resource you want to fetch. It returns a Promise that resolves to the Response to that request — as soon as the server responds with headers — even if the server response is an HTTP error status.

How to fetch data from JSON API? ›

To fetch post JSON data using API, you need to follow these steps: fetch('https://example.com/api/data', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON. stringify({ key1: 'value1', key2: 'value2' }) }) . then(response => response.

How can I fetch data from API faster? ›

Caching is one of the best ways to improve API performance. If you have requests that frequently produce the same response, a cached version of the response avoids excessive database queries. The easiest way to cache responses is to periodically expire it, or force it to expire when certain data updates happen.

How to get particular value from API response? ›

# Extracting Variables from API Response
  1. Open the test case from which you want to extract variables.
  2. Go to the "Variable Extractor" sub-tab.
  3. In the JSON Path / XML Path / Utility Method column, you may provide. the JSON path of the API response if the response is in JSON format. ...
  4. in the Post Validation?

How do I find a specific API? ›

Here are some short steps to find APIs to find their endpoints:
  1. Go to View -> Developer -> Developer Tools to open Chrome's Developer Tools. ...
  2. After that, select the XHR filter. ...
  3. After that, you'll need to devote some time to researching the specific request.
  4. Then, to view the data, go to the preview tab.

How do I fetch specific data from API in react? ›

Different Ways to Fetch Data in React
  1. Use the stale-while-revalidate (SWR) method. This method is used to fetch data from a server and is used in React. ...
  2. Use the JavaScript Fetch() method. ...
  3. Use the React Query library. ...
  4. Use the Axios Library. ...
  5. Use the useFetch custom hook from react-fetch-hook.
Dec 14, 2023

Top Articles
Pozole: IU World’s Fare: International Education Week: Get Involved: Office of International Services: Indiana University
Delivery Information | Safe-Life
English Bulldog Puppies For Sale Under 1000 In Florida
Katie Pavlich Bikini Photos
Gamevault Agent
Pieology Nutrition Calculator Mobile
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Compare the Samsung Galaxy S24 - 256GB - Cobalt Violet vs Apple iPhone 16 Pro - 128GB - Desert Titanium | AT&T
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Craigslist Dog Kennels For Sale
Things To Do In Atlanta Tomorrow Night
Non Sequitur
Crossword Nexus Solver
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Energy Healing Conference Utah
Geometry Review Quiz 5 Answer Key
Hobby Stores Near Me Now
Icivics The Electoral Process Answer Key
Allybearloves
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Pearson Correlation Coefficient
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
Marquette Gas Prices
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Vera Bradley Factory Outlet Sunbury Products
Pixel Combat Unblocked
Movies - EPIC Theatres
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Mia Malkova Bio, Net Worth, Age & More - Magzica
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Topos De Bolos Engraçados
Sand Castle Parents Guide
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Nfsd Web Portal
Selly Medaline
Latest Posts
Article information

Author: Lilliana Bartoletti

Last Updated:

Views: 5931

Rating: 4.2 / 5 (73 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Lilliana Bartoletti

Birthday: 1999-11-18

Address: 58866 Tricia Spurs, North Melvinberg, HI 91346-3774

Phone: +50616620367928

Job: Real-Estate Liaison

Hobby: Graffiti, Astronomy, Handball, Magic, Origami, Fashion, Foreign language learning

Introduction: My name is Lilliana Bartoletti, I am a adventurous, pleasant, shiny, beautiful, handsome, zealous, tasty person who loves writing and wants to share my knowledge and understanding with you.