By: Vincentius C. Calvin · July 13, 2024
Advanced
option, since you need to add HTTP request header for Authorization.
https://api.sectors.app/v1/daily/bbca
For the HTTP request header parameters, fill in Authorization
on the left cell, and then your <API Key>
on the right cell. Afterwards, click OK.
Back
and let’s change the API url to https://api.sectors.app/health/
. Leave the header and your API key as it is, as this is necessary.
OK
from the /health/
endpoint.
Go to View
tab > Advanced Editor
, and this editor will pop up:
https://api.sectors.app/health/
to https://api.sectors.app/v1/daily/bbca
, and click Done!
This is the “code” block:
To Table
on the Transform
tab. If a prompt box open out, select None
as the delimiter. You can adjust this as needed in accordance to your returned JSON data, but putting it to None would be the common default-to-go — and don’t worry if you need to change it later as it is doable.
You will now see in the right bar on Applied Steps
that we have added a new subsequent step Converted to Table
:
Close & Load
on the top left of the Power Query.
[Record]
or [List]
entries. If you leave them as they are, it will get displayed as a string after you load the query.
Company Report Query
, then establish a new connection to the API just like what we just did on the previous section.
Our target url for this will be: https://api.sectors.app/v1/company/report/bbca/
.
[Record]
or [List]
since the returned JSON is nested.
overview
. It should automatically add another step which is to called Navigation
Into Table
button on the top left of Power Query, and modify the table as needed like what you just did in the previous section.
Close & Load
, it will create you a table just for the overview
key, while we still have other data in the original JSON that we want to expand as well.
Instead, click the first step which is Source
, move on to the next [Record]
entry > right click > As new query
.
peers
JSON structure look like this:
peers_info
> companies
, and our starting point looks like this:
companies
.
to table
.
group
is still a [List]
and thus can be expanded to show what kind of peer group does each company share with BBCA.
Click on the expand button on the header, and choose Extract values..
. It will open a prompt that tells you to choose what kind of delimiter you want to concatenate the values with. I personally prefer using Comma here.
Close & Load
and all of our queries should now be displayed as table in different sheets (one sheet represents each unique query).
Refresh
on Query tab, and you can perform futher analyzing using your favourite Excel tools.