List and Search Posts
Learn about various endpoints to list and search posts in a blog.
Overview
In this lesson, we'll look at various endpoints that'll enable us to retrieve a single blog post and a list of all blog posts. We'll also learn how to search for a post based on some search text.
Methods
List all posts
We can retrieve a list of all blog posts by making a GET request to the following URL:
https://blogger.googleapis.com/v3/blogs/{blogId}/posts
We'll need to specify the blogId of the blog whose posts we want to retrieve.
Request parameters
Parameter | Type | Category | Description |
| string | required | The ID of the blog whose posts are to be retrieved. |
| datetime | optional | The date till which the posts are to be retrieved. Format: yyyy-mm-ddThh:mm:ss.ssZ |
| boolean | optional | "True" to include posts' body content, "False" otherwise. Default value: "True" |
| boolean | optional | "True" to include image URL metadata, "False" otherwise. |
| string | optional | A comma-delimited list of labels we want to search. |
| integer | optional | The number of posts to retrieve. |
| string | optional | The sort order for the results. Allowable values: "published" to order by publishing date, "updated" to order by the date of last update |
| string | optional | The next page's pagination token. Note: This parameter will only be displayed if it exists. |
| datetime | optional | The date from when the posts are to be retrieved. Format: yyyy-mm-ddThh:mm:ss.ssZ |
| string | optional | The status of the posts to retrieve. Allowable values: "draft," "live," "scheduled" |
| string | optional | The level of details to be retrieved. Allowable values: "ADMIN," "AUTHOR," "READER" |
Sample code
In the code below, enter the value for the required parameter blogId on line 1 ...