List and Search Posts
Learn about various endpoints to list and search posts in a blog.
We'll cover the following...
In this lesson, we'll look at various endpoints enabling 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 | The option to decide whether to include the posts' body content. Allowable values: Default value: |
| boolean | optional | The option to decide whether to include the image URL metadata. Allowable values: |
| 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: |
| string | optional | The next page's pagination token. Note: This parameter will only be displayed if it exists. |
| datetime | optional | The date from which the posts are to be retrieved. Format: yyyy-mm-ddThh:mm:ss.ssZ |
| string | optional | The status of the posts to retrieve. Allowable values: |
| string | optional | The level of details to be retrieved. Allowable values: |
In the code below, we've used the stored value of BLOG_ID
on line 8. Try adding the values for optional parameters to the ...