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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
aepMSC
Regular Visitor

Alterar quantidade de paginas em conexão com Json

Olá Pessoal

sou novo em conexões com API em json. queria saber se tem como eu alterar a quantidade de paginas do exemplo abaixo

Preciso alterar "totalRegistrosPagina" de "20" para "100" ou "all pages", como faço?

 

json.JPG

6 REPLIES 6
aepMSC
Regular Visitor

Hi @v-jingzhang 

 

This is the API documents https://documenter.getpostman.com/view/2228538/Szf6Yoqz?version=latest#45f44e9b-5067-4158-b155-ae70e...

I think Its can be usefull 

best regards

aepMSC
Regular Visitor

dear friend, thanks for trying help me, but, doesnt work.

Lets try again. I will translate the picuture of the topic

 

listResults: List

totalRecords: 292

totalrecordspage: 20

currentpage: 1

totalpages: 15

listmessage: list

flagErro: FALSE

 

Well, the question is... when I convert to a table, Poquer Query only show the current page with 20 records, how can I convert all records from all pages in a single table?

Hi @aepMSC 

 

It seems currently the request gets the 20 records on the page 1. Do you have any document about how to use this API? For example, you may refer to this open Qld wildlife data API. It lists the variables which can be included in the URL. If we use a variable that not exists in the list, the API will not deal with it.

 

I don't know which variables the API you are connecting to would accept. You could refer to its document or get in touch with its author/owner to find out which variables it can accept to modify the number of records returned.

 

Hope this helps.

Jing

v-jingzhang
Community Support
Community Support

Hi @aepMSC 

 

It depends on whether the API accepts a query parameter to specify the number of pages requested. You can first refer to the API's document to find out how to use it and what parameters it can accept. If it can accept a parameter like pages, you can try modifying the Souce code like below. Usually API documents will have examples about how to modify the URLs.

Source = Json.Document(Web.Contents("https://apiurl?pages=100"))

or 

Source = Json.Document(Web.Contents("https://apiurl",[Query=[pages=100]]))

 

Reference:

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

 

Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.

Friend, thanks for reply me, but, wich place you advise to insert this Query?

 

let
Fonte = Json.Document(Web.Contents("url", [Headers=[#"Content-Type"="application/json", Authorization="Basic 0000"]]))

in
Fonte

Hi @aepMSC 

You could try this: 

 

let
Fonte = Json.Document(Web.Contents("url", [Headers=[#"Content-Type"="application/json", Authorization="Basic 0000"], Query=[pages="100"]]))

in
Fonte

 

Modify the parameter name accordingly. 

 

Reference: Chris Webb's BI Blog: Using The RelativePath And Query Options With Web.Contents() In Power Query An...

 

Regards,
Jing
If this post helps, please Accept it as the solution to help other members find it.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Kudoed Authors