I have an app that uses Blogger API to show the posts of a blog in a listview. Is there a way in which I can extract the thumbnail of the corresponding post URL? This is general JSON response we get-
{
"kind": "blogger#blog",
"id": "2399953",
"name": "Blogger Buzz",
"description": "The Official Buzz from Blogger at Google",
"published": "2007-04-23T22:17:29.261Z",
"updated": "2011-08-02T06:01:15.941Z",
"url": "http://buzz.blogger.com/",
"selfLink": "https://www.googleapis.com/blogger/v3/blogs/2399953",
"posts": {
"totalItems": 494,
"selfLink": "https://www.googleapis.com/blogger/v3/blogs/2399953/posts"
},
"pages": {
"totalItems": 2,
"selfLink": "https://www.googleapis.com/blogger/v3/blogs/2399953/pages"
},
"locale": {
"language": "en",
"country": "",
"variant": ""
}
}
According to the documentation, If you query the endpoint for post list via -
https://www.googleapis.com/blogger/v3/blogs/blogId/posts
It should return a Post resource, from which you can access the images
property to get the image URL for the individual posts.
But, currently the Blogger API doesn't return the images
property when you call the post list or even the individual post endpoint (via - https://www.googleapis.com/blogger/v3/blogs/blogId/posts/postId
). Therefore, you have two alternatives available -
Either parse the HTML from the content
property and find the Image URL from there.
Or query the publicly available API for post list (via - https://www.blogger.com/feeds/blogID/posts/default?alt=json
and get the image URL via the media$thumbnail
property)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With