Pagination Google .net Client library 2


Please Share

Google Developers

What is pagination?

Pagination has long been an issue for me in the Google .net client Library. When the number of results returned by your request is greater then the max results you need to use nextlink in order to get the next set of results.



This has lead to a number of strange hacks for me in the past. We now have an end to that.

I am going to show you a quick example of how this works. It will work with all of the Google APIs and the Google .net Client library, on any method that contains a nextlink and might need pagination. It can be a little tricky getting it to work and setting it up if you have any issues with your favorite API let me know I will see if i can build you an example.

The Code

This is a quick example using the Google Drive API V2.

Note: You are still making additional request to get the next page so watch your quota.

My Thanks

I would like to thank Jon Skeet for his efforts in adding pagination to the client library. You can read my feature request here. pagination #632

Please Share


Linda Lawton

About Linda Lawton

My name is Linda Lawton I have more than 20 years experience working as a developer and a database expert. I have been working with several of the Google APIs, since 2012. I helping others in the On-Line community to develop with the Google APIs, by creating my own blog www.daimto.com. This and my presence on a number of On-Line developer forums lead me to be noticed by the Google Analytics API development team. I was nominated for and recently became one of the first Google Developer Experts for Google Analytics.


Leave a comment

Your email address will not be published. Required fields are marked *

2 thoughts on “Pagination Google .net Client library

    • Linda Lawton
      Linda Lawton Post author

      PageStreamer if memory serves is part of Google.Apis and yes if you import any of the API NuGet packages they will automatically grab Google.APIs (Google.Apis.Drive.V2 || Google.Apis.Drive.V3).

      Yes it was release a while ago one of those stealth releases that the team is becoming very good at. I really need to get on them about creating actual change log release announcements.

      Note: If you are running a project with Framework 4.0 then you probably wont have this it was probably released some where around version 1.12 and support for Framework 4.0 stopped at 1.10. In that case yes you can just grab the PageStreamer method and add it to your project manually it “should” work.