March 04, 2025

Blogger Feed API (Summary)

Here's a summary about the Blogger feed API that I've collected until now. There are a few more under editorial. I'll update the post after reconfirming the cases.



Requesting Blog Feed

There are two common ways to request a Blogger blog feed.

Inline script:

<script>
function callbackFunction(json) {
  console.log('blog feed result:', json)
}
</script>

<script src="https://www.blogger.com/feeds/blogID/posts/default?alt=json-in-script&callback=callbackFunction"></script>

Fetch API:

fetch('https://www.blogger.com/feeds/blogID/posts/default?alt=json')
.then(function(response) {
  return response.json();
})
.then(function(result) {
  // do something with the result
});

Use the inline script method if you're requesting from outside the blog, e.g. from an app or a non blogspot website.

Alternate URL

You can use your own blog name to request the feed. The request will only succeed if it's coming from your blog. The advantage of using this alternative URL is that you don't have to specify the blog ID.

https://xmlexpr.blogspot.com/feeds/posts/default?alt=json

Blogger Feed Parameters

A list of Blogger blog feed parameters that I know:

  • alt 
    Feed format. Accepted values are xmljsonjson-in-script, and rss. The default format is xml.

  • callback
    Feed callback function. Used together with alt=json-in-script.

  • prettyprint 
    Set true to preserve tab and new line characters in the feed response, making it easier to read. Used together with alt=json. Usually for viewing feed response directly in a new tab.

  • max-results 
    Maximum feed entries (posts) result. Value must be a number between 1 and 500.

  • start-index 
    Retrieve items starting from a specific index. Value must be a number >= 1.

  • published-min, published-max
    Retrieve blog posts published after or before a certain date.

  • updated-minupdated-max 
    Retrieve blog posts updated after or before a certain date.

  • orderby 
    Apply ordering to the feed items. This parameter must be used together with either published-min/max or updated-min/max parameter. Accepted values are published and updated.

  • search
    Blog search query parameter.

  • category
    Posts label name.

Feed Limit

Feed response is limited to 512K in size. So make sure to always use jump break (read more tag) in your posts.

Ordered Feed Entries Issue

There seems to be a bug that makes it not possible to use orderby and start-index parameters together to retrieve posts over 500 items.

https://www.blogger.com/feeds/3000166519687388789/posts/summary/-/song?alt=json&orderby=updated&start-index=490

Assuming a blog has thousands of posts, in the example URL above:

  • expected total feed entries is 500, starting from index 490.

  • actual response: 10.

This issue only happends if you're using fetch API, so you can still get the expected result using inline script with callback parameter.

<script>
  let script = document.createElement('script');
  script.src = 'https://www.blogger.com/feeds/3000166519687388789/posts/summary/-/song?alt=json&max-results=0&orderby=updated&callback=feedCallback';
  document.body.append(script);
  
  function feedCallback(json) {
    console.log(json)
  }
</script>

CORS Error

I need to reconfirm the cases, but requesting feed to the blogger.com domain sometimes gives a CORS error. A workaround is to append a string to the feed URL, e.g. a random number.

fetch(feedsUrl+'&random='+Math.random());


Other Resources

Some blog posts relating Blogger feed API that you may find useful:



Open comments page