
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
@jobians/bloggerjs
Advanced tools
BloggerJS is a Node.js wrapper for the Google Blogger API v3, allowing you to interact with blogs, posts, pages, comments, and users programmatically.
sendRequestInstall via npm:
npm install @jobians/bloggerjs
credentials.jsonThis library comes with a working credentials.json file to help you get started quickly. You can either:
credentials.json as-is for testing.To replace the credentials, simply download your credentials.json file from your Google Cloud Console and overwrite the existing credentials.json file in the root directory.
const BloggerJS = require('@jobians/bloggerjs');
const blogId = 'your-blog-id';
const blogger = new BloggerJS(blogId);
(async () => {
try {
// Get Blog Details
const blog = await blogger.getBlog();
console.log(blog);
// Get Blog by URL
const blogByUrl = await blogger.getBlogByUrl('http://username.blogspot.com');
console.log(blogByUrl);
// List Posts
const posts = await blogger.getPosts({ maxResults: 5 });
console.log(posts);
// Get a Specific Post by ID
const postId = 'your-post-id';
const post = await blogger.getPost(postId);
console.log(post);
// Add a New Post
const newPost = await blogger.addPost({
title: 'My New Post',
content: 'This is the content of my new post!',
});
console.log(newPost);
// Update a Post
const updatedPost = await blogger.updatePost(postId, {
title: 'Updated Post Title',
content: 'Updated content of the post',
});
console.log(updatedPost);
// Delete a Post
await blogger.deletePost(postId);
console.log(`Post ${postId} deleted`);
} catch (error) {
console.error('Error:', error.message);
}
})();
getBlog()Retrieve blog details using the blog ID provided during instantiation.
const blog = await blogger.getBlog();
console.log(blog);
getBlogByUrl(blogUrl)Retrieve a blog's details using its URL.
Parameters:
blogUrl (string) – The URL of the blog.const blogByUrl = await blogger.getBlogByUrl('http://username.blogspot.com');
console.log(blogByUrl);
getPosts(params = {})Retrieve a list of posts for the blog.
Optional Parameters:
maxResults (number) – The maximum number of posts to return.const posts = await blogger.getPosts({ maxResults: 10 });
console.log(posts);
getPost(postId)Retrieve details of a specific post by its ID.
Parameters:
postId (string) – The ID of the post.const post = await blogger.getPost('your-post-id');
console.log(post);
addPost(params)Create a new post on the blog.
Parameters:
params (object) – An object containing the post properties, such as title, content, etc.const newPost = await blogger.addPost({
title: 'New Post Title',
content: 'The content of the new post.',
});
console.log(newPost);
deletePost(postId)Delete a post by its ID.
Parameters:
postId (string) – The ID of the post to delete.await blogger.deletePost('your-post-id');
console.log('Post deleted');
updatePost(postId, params)Update an existing post.
Parameters:
postId (string) – The ID of the post to update.params (object) – An object containing the new post properties (e.g., title, content).const updatedPost = await blogger.updatePost('your-post-id', {
title: 'Updated Title',
content: 'Updated post content',
});
console.log(updatedPost);
patchPost(postId, params)Partially update a post using patch semantics.
Parameters:
postId (string) – The ID of the post to update.params (object) – An object containing the fields to update.const patchedPost = await blogger.patchPost('your-post-id', {
content: 'Partially updated content',
});
console.log(patchedPost);
getComments(postId, params = {})Retrieve a list of comments for a specific post.
Parameters:
postId (string) – The ID of the post.params (object) – Optional parameters such as maxResults.const comments = await blogger.getComments('your-post-id', { maxResults: 5 });
console.log(comments);
getComment(postId, commentId)Retrieve details of a specific comment by its ID.
Parameters:
postId (string) – The ID of the post.commentId (string) – The ID of the comment.const comment = await blogger.getComment('your-post-id', 'comment-id');
console.log(comment);
deleteComment(postId, commentId)Delete a specific comment by its ID.
Parameters:
postId (string) – The ID of the post.commentId (string) – The ID of the comment.await blogger.deleteComment('your-post-id', 'comment-id');
console.log('Comment deleted');
approveComment(postId, commentId)Approve a comment that is awaiting moderation.
Parameters:
postId (string) – The ID of the post.commentId (string) – The ID of the comment.await blogger.approveComment('your-post-id', 'comment-id');
console.log('Comment approved');
getPages(params = {})Retrieve a list of pages for the blog.
Optional Parameters:
maxResults (number) – The maximum number of pages to return.const pages = await blogger.getPages({ maxResults: 10 });
console.log(pages);
getPage(pageId)Retrieve details of a specific page by its ID.
Parameters:
pageId (string) – The ID of the page.const page = await blogger.getPage('your-page-id');
console.log(page);
addPage(params)Create a new page on the blog.
Parameters:
params (object) – An object containing the page properties, such as title, content, etc.const newPage = await blogger.addPage({
title: 'New Page Title',
content: 'The content of the new page.',
});
console.log(newPage);
updatePage(pageId, params)Update an existing page.
Parameters:
pageId (string) – The ID of the page to update.params (object) – An object containing the new page properties (e.g., title, content).const updatedPage = await blogger.updatePage('your-page-id', {
title: 'Updated Title',
content: 'Updated page content',
});
console.log(updatedPage);
deletePage(pageId)Delete a page by its ID.
Parameters:
pageId (string) – The ID of the page to delete.await blogger.deletePage('your-page-id');
console.log('Page deleted');
getUserBlogs(userId)Retrieve a list of blogs for the specified user.
Parameters:
userId (string) – The ID of the user. Use 'self' to refer to the authenticated user.const blogs = await blogger.getUserBlogs('self');
console.log(blogs);
getUser()Retrieve the authenticated user's details.
const user = await blogger.getUser();
console.log(user);
logout()Log out and remove saved authentication credentials. This will delete the token.json file, effectively logging you out of the Blogger API.
await blogger.logout();
You can extend this class to make any custom requests that aren't directly covered by the provided methods. The sendRequest method allows you to make API calls by specifying the HTTP method, the endpoint, and any parameters.
sendRequest(method, endpoint, params)Make a custom request to any Blogger API endpoint.
Parameters:
method (string) – The HTTP method (e.g., 'get', 'post', 'delete', etc.).endpoint (string) – The Blogger API endpoint in the format resource.action.params (object) – The parameters to send with the request.Example:
// Custom request to list posts with a specific label
const customRequest = await blogger.sendRequest('get', 'posts.list', {
blogId: 'your-blog-id',
labels: 'Technology',
maxResults: 5,
});
console.log(customRequest);
The sendRequest method gives you the flexibility to interact with any part of the Blogger API, even those not directly wrapped by this library. You can refer to the official Blogger API v3 documentation for more information on available endpoints.
If you find my work helpful, you can support me by donating:
FAQs
A Node.js client for the Blogger API
We found that @jobians/bloggerjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.