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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Luka2893
Regular Visitor

Power Query API request URL error in Excel

Hello,

I am trying to connect Excel 2021 spreadsheet with data from BIS (Bank of International Settlements) database. They have API key builder. I retrieved the URL and put in Excel Power Query but the error poped up: "We encountered an error while trying to connect. Details: "Web.Contents failed to get contents from 'https://stats.bis.org/api/v1/data/BIS%2CWS_CBPOL%2C1.0/M.JP/all?detail=full' (404) ".
Can anyone suggest whats wrong here and how can I make it work?
https://stats.bis.org/api-doc/v1/#/Data%20queries/get_data__flow___key__all  -  API Builder
https://data.bis.org/topics/CBPOL/BIS,WS_CBPOL,1.0/M.JP?  -  Time series I'm trying to connect

1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @Luka2893 

 

I tinkered around a bit and came up with this (.xlsx attached too):

let
  apiCall = Web.Contents(
    "https://stats.bis.org/api/v1",
    [
      RelativePath = "data/BIS,WS_CBPOL_M,1.0/M.JP/all"
      //Query        = [startPeriod = "1960", endPeriod = "2023", detail = "full"]
    ]
  ),
  #"Imported XML" = Xml.Tables(apiCall, null, 65001),
  #"Navigation: Table" = #"Imported XML"{1}[Table],
  #"Navigation: Namespace" = #"Navigation: Table"{0}[#"Namespace:"],
  #"Navigation: Series" = #"Navigation: Namespace"{0}[Series],
  #"Navigation: Obs" = #"Navigation: Series"{0}[Obs],
  #"Changed Type" = Table.TransformColumnTypes(
    #"Navigation: Obs",
    {
      {"Attribute:TIME_PERIOD", type date},
      {"Attribute:OBS_VALUE", type number},
      {"Attribute:OBS_STATUS", type text},
      {"Attribute:OBS_CONF", type text}
    }
  ),
  #"Rename Columns" = Table.TransformColumnNames(#"Changed Type", each Text.AfterDelimiter(_, ":"))
in
  #"Rename Columns"

 

  • I compared with some examples and WS_CBPOL_M seemed to be the required format.
  • You can optionally include Query parameters, but I commented them out (add a comma before the Query field if you do this).
  • The steps from "Imported XML" onwards may need to be tweaked.

Does this help with what you were trying to do?

 

Regards

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

2 REPLIES 2
Luka2893
Regular Visitor

Hi @OwenAuger,

It worked perfectly well. Thank you!

Best regards

OwenAuger
Super User
Super User

Hi @Luka2893 

 

I tinkered around a bit and came up with this (.xlsx attached too):

let
  apiCall = Web.Contents(
    "https://stats.bis.org/api/v1",
    [
      RelativePath = "data/BIS,WS_CBPOL_M,1.0/M.JP/all"
      //Query        = [startPeriod = "1960", endPeriod = "2023", detail = "full"]
    ]
  ),
  #"Imported XML" = Xml.Tables(apiCall, null, 65001),
  #"Navigation: Table" = #"Imported XML"{1}[Table],
  #"Navigation: Namespace" = #"Navigation: Table"{0}[#"Namespace:"],
  #"Navigation: Series" = #"Navigation: Namespace"{0}[Series],
  #"Navigation: Obs" = #"Navigation: Series"{0}[Obs],
  #"Changed Type" = Table.TransformColumnTypes(
    #"Navigation: Obs",
    {
      {"Attribute:TIME_PERIOD", type date},
      {"Attribute:OBS_VALUE", type number},
      {"Attribute:OBS_STATUS", type text},
      {"Attribute:OBS_CONF", type text}
    }
  ),
  #"Rename Columns" = Table.TransformColumnNames(#"Changed Type", each Text.AfterDelimiter(_, ":"))
in
  #"Rename Columns"

 

  • I compared with some examples and WS_CBPOL_M seemed to be the required format.
  • You can optionally include Query parameters, but I commented them out (add a comma before the Query field if you do this).
  • The steps from "Imported XML" onwards may need to be tweaked.

Does this help with what you were trying to do?

 

Regards

Owen


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors