Using API-Football in Alteryx

Today for dashboard week I got set a task to call data from the following API: https://www.api-football.com/documentation-v3?ref=thedataschool.co.uk#section/Authentication.

This blog will cover how this was achieved.

Step 1:

Create an account with API football in order to obtain an access key.

Step 2:

In Alteryx create a text input, with 2 columns. These columns should contain the url of the data you want to obtain, and your API key. In this example we will obtain all leagues from 2023 using the following URL: https://v3.football.api-sports.io/leagues?season=2023

It is important to note that the column containing your key must be named "x-apisports-key" .

Step 3:

Input a download tool and configure it to download the URL field. Also make sure that your API key is selected in the "headers" pane.

Step 4:

Your data has now downloaded! However, it still needs to be parsed. This can be done using a JSON Parse tool, configured in the following way.

Step 5:

Your output should look like the table below.

JSON_Name contains the names of your columns and JSON_ValueString contains the values that should reside in those columns.

We will look at JSON_Name in more detail:

By looking at the structure of the data it seems that our column names occur after 4 fullstops. The number "0" changes for each league so this is also useful as it can act as an ID.

To obtain these columns a Text To Columns tool can be used:

I used a select tool to clean up the column names:

Step 6:

The output to this should look like below:

You'll notice some values in the Column Header have a 0 in front of them. These only have 0 and 1 values associated with them and aren't needed for the final table. The same can be said for any Null value. I filtered both these values out of the dataset:

Step 7:

The final step is to convert your Column Header values to be columns. For this a transpose can be used:

Complete!

You have now successfully called and parsed data from API-Football. The output contains the information for each football competition.

Author:
Dan Booth
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2025 The Information Lab