Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Do5779
Helper II
Helper II

API with different token name did not work ( Web.Contents function)

Hi Experts,

 

I am searching for hours, watching tutorials and also have no idea how to get the right answer. So I hope you can help me:

 

I want to get the informations of this website per API: Documentation | Exchange Rates API,
e.g. for the latest prices. So thats the documentation: 

https://api.exchangeratesapi.io/v1/latest
    ? access_key = API_KEY
    & base = USD
    & symbols = GBP,JPY,EUR

At first I try to connect the Webservice with the surface of power BI, but this didn't work because of the name of the key ( access_key) instead of Authorization. Now my plan was to take the code, how it was offerd in the blog (Power Query Web.Contents cheat sheet walkthrough | by Oscar Martinez | PowPCo) at Example No. 5 but i don't get it. How I can adress the freaking name of the token?

 

It seems to me something like :

 

 

 

let

Source = Json.Document(
        Web.Contents(
            "https://api.exchangeratesapi.io/v1/latest",
            [
Query = [
access_key = "123"

]])),

in
    Source

 

 

  or

 

 

let
    Source = Json.Document(Web.Contents(
        "https://api.exchangeratesapi.io/v1/latest",

        Query =[

    ApiKeyName="access_key",
    apikey = "123"
        ]
  
  ))

in 
     Source

 

 

 

In this solution I should only set the "Key Name" and set the Key at the login screen. But It also did not work. Is the key incorrect or did I some mistakes?

Get Data through API - Microsoft Power BI Community

Code: 

 

 

let
    Source = Json.Document(Web.Contents(
        "https://api.exchangeratesapi.io/v1/latest",

      [

    ApiKeyName="? access_key"]
        
  
  ))
        
    
in 
     Source

 

 

Screen:

Do5779_0-1659691530945.png

 

 

The Key "123" is only for the understanding.

 

Thanks a lot 😭

1 REPLY 1
lbendlin
Super User
Super User

Your first option is most appropriate but you are missing the other query components. You need to supply base and symbols too.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.