4 min read

Power BI web sources Part 2 – API

By Mads Bender on 07 February 2023

Topics: D365FO PowerBI

In the first part we looked at how to extract Stock data for Microsoft using Yahoo Finance. Yahoo Finance used to have their own API, today you can find third party APIs. However, because I want to go into the logic of an API, we will change to a different data set. First, we will look at covid tracking, that is an opensource dataset, and the process is exactly as we saw it from yahoo finance. 

Before we dig deeper, I want to make sure we all know what an API is. API stands for Application Programming Interface; this means it is an interface that lets more applications or software talk together. In the calls we have been so far, we have requested data from other applications to use in Power BI (our application). This interaction often happens in JSON code; however, an API call does not require interaction in JSON format, it can be in whatever format that both applications will understand. Most APIs you find when you browse around limit the access to read/get only, however APIs can also be used to write/post data, let’s say you want to send a package, when you can register the parcel at the forwarder through an API instead of going manually into the webpage and book it.

In this we will consider two types of APIs: public and partner. Public API are open for everyone like the covid tracking example we will explore shortly. Partner APIs is a way to limit the access to a selected group of people, usually this involves the use of a token.

First, we will access the public API for Covid tracking and for this we will use the following URL: https://api.covidtracking.com/v2/us/daily.json next, we will expand the dataset. This is a big data set with a lot of possibilities for expansion.

Picture1-3

Picture2-3

I am a very simple graph representation of the data to get an idea of how is looks and the data I have, one of the things I found was that the data set has multiple lines for each day or can have which could give issues with the final data. This is just to show how easy it is to add an API dataset, and not show anything meaningful with the data.  

In the next part we will look at Partner API, this is going to use code and not as plug and play as the first two methods. 

I hope this has been valuable, please contact me if you have any questions.

Important: Continuation follows in part 3, don't miss it and enjoy learning!!

 

Written by Cittros team

Subscribe for our insights