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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syndicate_Admin
Administrator
Administrator

Problema al extraer datos de JSON

Hola

He estado tratando de paginar una API del Banco Mundial, pero no funciona. Básicamente, enumero cuántas páginas se enumerarán en la tabla final (que de forma predeterminada carga solo 50 filas), pero a medida que se invoca la función personalizada, aparece el siguiente mensaje de error:

DataFormat.Error: We found an unexpected character in the JSON input.
Details:
    Value=<
    Position=0

Aquí está el enlace al archivo.

¿Alguien sabe lo que estoy haciendo mal y cómo hacer que funcione?

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

Gracias por tu respuesta, @amitchandak . Fuiste de gran ayuda como de costumbre.

Syndicate_Admin
Administrator
Administrator

Muchas gracias por tu respuesta, thxalot kkkk

Realmente funcionó.

Syndicate_Admin
Administrator
Administrator

Bastante simple

let
    Source = Xml.Tables(Web.Contents("http://api.worldbank.org/v2/country"))[#"Attribute:pages"]{0},
    Pages = Table.FromList({"1"..Source}, Splitter.SplitByNothing(), {"Page"}),
    #"API Call" = Table.AddColumn(Pages, "API Call", each Xml.Tables(Web.Contents("http://api.worldbank.org/v2/country?page="&[Page])))
in
    #"API Call"

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.