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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
nupur
Regular Visitor

How to get count of github repositories in all pages using the rest api

Below is the link of Github repository and I am trying to get count of all repository with type "internal". The challenge, is docs says per page the maximum count returned is 100, How can I get the total count of repositories available.. like summarizing from all pages

Here is the github api I am trying to call: 

 

https://docs.github.com/en/rest/repos/repos#list-public-repositories

 

Here is my power query which works ..need to fix to get the total counts:

 

let
Source = Json.Document(Web.Contents("https://api.github.com/orgs/orgaccount/repos?type=internal&page=1", [Headers=[Accept="application/vnd.github.v3+json", Authorization="Bearer g7Ev"]])),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
#"Converted to Table"

1 ACCEPTED SOLUTION
v-easonf-msft
Community Support
Community Support

Hi, @nupur 

You can try create a loop for fetching paginated data from a REST API.

Please review the following thread about how to implement REST API pagination in Power Query.

How to get paginated data from API in Power BI 

 

Best Regards,
Community Support Team _ Eason

View solution in original post

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi, @nupur 

You can try create a loop for fetching paginated data from a REST API.

Please review the following thread about how to implement REST API pagination in Power Query.

How to get paginated data from API in Power BI 

 

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.