Forum

Notifications
Clear all

API Web Scraping

4 Posts
2 Users
0 Reactions
223 Views
(@freshwood)
Posts: 14
Eminent Member
Topic starter
 
Hi to all Forum Members,
I have an issue about API‘s. I can‘t build the bridge about Myndas examples from the corresponding video on youtube and my problem here. Where can I put in the needed information in the process of Data from Web with Power Query?
 
I have given following curl:
 
curl -X GET - - header “Accept: application/json“ - - header “Authorization: Bearer “ “ https://developer.fraport.de/api/flights/1.0.1/flight/FRA/arroval“
 
In addition I have a consumer key and a consumer secret.
 
Actually I get really confused about what my API key is and at what point I have to type it in Excel.
 
Hope someone can help. 🙂
 
Posted : 03/02/2021 5:06 pm
Philip Treacy
(@philipt)
Posts: 1630
Member Admin
 

Hi Peter,

If you haven't already, please read these posts on API's and Power Query

Getting Started with API's in Power Query • My Online Training Hub

Connecting to an OAuth API Like PayPal With Power Query • My Online Training Hub

The API you are trying to use uses OAuth as an authentication process - that's the process of registering an application (like Power Query) to use the API.  To get data from the API you need to generate an access token. You can do this on the fraport.de web site.  On the same page where you generated the consumer key & secret, you can generate an access token.

Usually you can create the access token from within PQ too but I didn't see the mechanism described in their documentation on how to do this, so you'll have to generate tokens via the site for now.

If you open the attached workbook I've modified the query from the Paypal API blog post (linked above).  I created an account on fraport, registered an app and generated my own token by following these instructions

Instructions (fraport.de)

Using my own access token I was then able to query the API to get this data - see attached image.

If you edit the query in my workbook, and enter your own access token, you should be able to get similar data.  You'll need to modify the URL end point to get data for other things 

Documentation (fraport.de)

Give it a go and if you get stuck, post back here.

Regards

Phil

fraport.png

 
Posted : 04/02/2021 3:41 am
(@freshwood)
Posts: 14
Eminent Member
Topic starter
 

Hi Phil,

thank you very much for your very well described answer.

Your link to the Paypal API blog post was really helpful as well and now I understand that I have to use the advanced query editor in order to type in my credentials <- this was my main issue!

I will use your example file in order to understand the M statement.

All the best

Peter

 
Posted : 04/02/2021 3:47 pm
Philip Treacy
(@philipt)
Posts: 1630
Member Admin
 

You're welcome, glad to help.

Phil

 
Posted : 04/02/2021 7:41 pm
Share: