Icon

04 - Rick and Morty Catalog v2

<p>Challenge 4 - Rick and Morty Catalog</p><p>You work for an entertainment company that wants to analyze various TV shows to gain insights into audience preferences. Your next project focuses on transforming data from the show “Rick and Morty” into a structured dataset that can be easily analyzed and queried. As a first step, you need to extract a complete list of characters featured in the series. However, the API that provides this information is paginated, returning separate JSON files for each page. How can you use KNIME to retrieve and merge all these pages into one unified catalog of the show’s characters? To solve this challenge, use the <strong>https://rickandmortyapi.com/api</strong> url.</p><ul><li><p><strong>Objective 1</strong>: Successfully send a Get Request to receive the characters data from the API.</p></li><li><p><strong>Objective 2</strong>:</p><ul><li><p>Implement a recursive loop to handle paginated API responses and ensure all data is collected.</p></li><li><p>Unify all the pages into a table with two string columns, id and character name.</p></li></ul></li><li><p><strong>Bonus</strong></p><ul><li><p>Created a little data app where you can select your character and have id, name and their avatar image displayed</p></li></ul></li></ul>

URL: JKI 4-4 on the KNIME forum https://forum.knime.com/t/solutions-to-just-knime-it-challenge-4-season-4/88383
URL: Subscribe to my KNIME focused YouTube channel (free) https://www.youtube.com/@bytesandbudgets?sub_confirmation=1

Challenge 4 - Rick and Morty Catalog


You work for an entertainment company that wants to analyze various TV shows to gain insights into audience preferences. Your next project focuses on transforming data from the show “Rick and Morty” into a structured dataset that can be easily analyzed and queried. As a first step, you need to extract a complete list of characters featured in the series. However, the API that provides this information is paginated, returning separate JSON files for each page. How can you use KNIME to retrieve and merge all these pages into one unified catalog of the show’s characters? To solve this challenge, use the https://rickandmortyapi.com/api url.

  • Objective 1: Successfully send a Get Request to receive the characters data from the API.

  • Objective 2:

    • Implement a recursive loop to handle paginated API responses and ensure all data is collected.

    • Unify all the pages into a table with two string columns, id and character name.

  • Bonus

    • Created a little data app where you can select your character and have id, name and their avatar image displayed

Objective 1
Objective 2a - implement a recursive loop
Objective 2b - unify all the pages
Bonus - Avatar selection and image display
send 1st requestto API to getnumber of pages
GET Request
extract number of pages from API
JSON Path
keep only numberof pages
Table Manipulator
convert to varfor usage in theCounting Loop Start
Table Row to Variable
get data from APIusing varGetRequestURL
GET Request
start looping over pages
Counting Loop Start
extract id, namefrom JSON
JSON Path
createvarGetRequestURL
Variable Expression
turn into individualrows
Ungroup
next iterationin loop
Loop End
keep onlybody column
Column Filter
create Avatar / Image URLs
Expression
select characterand see theiravatar image
Interactive View

Nodes

Extensions

Links