In week 4, the challenge is to create an Alteryx workflow and report from an Analytic App based on API of choice. In this instance, the topic about Top Anime based on Genres was selected. The objective of this challenge is to create a report showing the Top 10 Anime List from an API that contains Anime database. An illustration of the output report is shown in Figure 1.

Figure 1. First page of output report

Creation of the workflow and report starts with getting the API details from the website that hosts the API. For this challenge, the API details are gathered from the following link.

https://rapidapi.com/brian.rofiq/api/anime-db/

The link above contains the code snippets that have the URL, API Host and API Key which are essential for inputting the required data. Figure 2 shows the illustration of the Code Snippets.

Figure 2-1. Code Snippets from Anime database API to get list of genres

Figure 2-2. Code Snippets from Anime database API to get list of anime titles

Preparing File containing List of Genres

In this challenge, a .csv file containing list of genres needs to be created prior to the completion of the Analytic App to ensure that the workflow can run smoothly. To create this .csv file, tools to input and download data from the API link, prepare by filtering irrelevant values and summarizing data for preparing output are needed. Figure 3 shows the overall workflow for preparing the file containing the list of genres.

Figure 3. Workflow to prepare a file containing list of genres

The URL from figure 2 was used to specify the Text Input Tool. Meanwhile, the API Host and API Key from figure 2 were used to specify the Headers in the Download Tool. These 2 tools are required before using the JSON parsing tool to download data from the database API. Usage of these tools are shown in the ‘Input Genre Data’ container in figure 3. Meanwhile, figure 4 show configurations of the tools in the ‘Input Genre Data’ container.

Figure 4-1. Configuration of Text Input tool

Figure 4-2. Configuration of Download tool Headers

Figure 4-3. Configuration of JSON Parsing tool to parse the code from DownloadData Field

The most important tool for creating the csv file is the Summarize tool which can be found from the ‘Output Genre List’ container in figure 3. This tool is used to create ‘Name’ and ‘Value’ fields which will be important for the Analytic App creation. Configuration of the Summarize tool can be seen in figure 5.

Figure 5. Configuration of Summarize tool to create ‘Name’ and ‘Value’ fields

At the end of genres list file preparation, a csv output file that is illustrated in figure 6 will be obtained.

Figure 6. CSV output file containing list of genres

After the CSV output file has been generated, the Analytic App is ready to be created. The steps to create the Analytic App can be found in the second part of this post which can be accessed through the following link.

https://www.thedataschool.com.au/kristiadi-uisan/alteryx-week-4-creating-an-analytic-app-based-on-api-of-choice-part-2-building-analytic-app/

Kristiadi Uisan
Author: Kristiadi Uisan