Skip to content

Get One Blog

Use the following endpoint to get a blog post via the API.

GET /api/v1/public/get-blog/{blogId}

Include your API key in the Authorization header:

Terminal window
Authorization: Bearer YOUR_API_KEY
// Replace "YOUR_UNIQUE_BLOG_ID" with the actual Blog ID
// Endpoint: {API_ENDPOINTS.BLOGS.GET_ONE("YOUR_UNIQUE_BLOG_ID")}
fetch(`https://api.blogz.ai/api/v1/public/get-blog/YOUR_UNIQUE_BLOG_ID`, {
method: 'GET', // Method is GET to retrieve data
headers: {
'Authorization': `Bearer YOUR_API_KEY`,
'Content-Type': 'application/json' // Good practice, though not strictly needed for GET
}
})
.then(response => response.json()) // Expecting JSON data for a successful GET
.then(blogData => {
console.log('Blog retrieved successfully:', blogData);
// Use the blogData object here
})
.catch(error => console.error('Error retrieving blog:', error));