blogger api

 By default the blogger API only returns 10 posts per request. You can change this by adding maxResults=50 as a parameter in your request. See here.

I believe there is a limit to how many posts you can fetch even with this parameter. It may actually be 50, I forget. So, you may want to also use the paging feature, to fetch "the next 50 posts", if you have more posts than can be handled by a single fetch.

To do this, you need to include nextPageToken in your request - for example, as follows:

fields=nextPageToken,items(title,url,published)

...and whatever other attributes you may want to fetch.

Now, the response you get back from the blogger API will include an additional "next page token" value (nextPageToken=DgkICheAxTJ1gcQ5vmT9OXn5xZU).

To use the "next page" token, you have to append it to the query parameters of your next API call - for example:

pageToken=DgkICheAxTJ1gcQ5vmT9OXn5xZU

And then repeat the process for each subsequent call, until there are no more "next pages".

Note - the request parameter you need to send is pageToken, (not the same as what you receive, which is nextPageToken).

blogger api blogger api Reviewed by Admin on 11:01 AM Rating: 5

No comments:

Powered by Blogger.