Icon

01a Data Collection with REST API - Solution

Step 1. Data loading

Execute the Table Creator node to load the list of the product categories.



Data Collection: REST API


Learning objective: In this exercise, you will learn how to request data from a website.


Workflow description: In this exercise we are going to use GET Request node to load the products information based on the product category. Retrieve data using GET Requests node, transform the JSON output and extract the asked information into a data table.


You'll find the instructions to the exercises in the yellow annotations.

Step 2. Creating and formatting the URLs for the GET Request node

Use an Expression node to create the urls with this format:
https://fakestoreapi.com/products/category/{product_category}



Step 3. Requesting for the data using the GET Request node

Use a GET Request node to load the list products information related to each category.


Hint: make sure to set the timeout (s) configuration to 15 seconds or above.

Step 4. Transforming the JSON data and extracting the products information

Extract the product id and product price related to each product category with the JSON Path and Ungroup nodes.


Hint: use collection queries to extract multiple entries from the JSON.

Extract products ID and price
JSON Path
Ungroup to get row-wise records
Ungroup
Request data from a website
GET Request
Create the urls
Expression
Product Categories
Table Creator

Nodes

Extensions

Links