Blog Posts API
Fetch and manage blog posts with filtering, pagination, and search capabilities.
Overview
The Blog Posts API provides endpoints to retrieve blog posts with support for filtering, pagination, search, and sorting. It's designed to power blog listings, search functionality, and content management systems.
/api/blog-posts Endpoint Details
URL
GET /api/blog-posts
Content Type
application/json
Query Parameters
page Page number for pagination (default: 1)
limit Number of posts per page (default: 10, max: 50)
search Search term to filter posts by title or content
Response Format
Success Response (200)
Returns a JSON object with blog posts data, pagination info, and applied filters.
Usage Examples
Fetch Latest Posts
Use GET request to /api/blog-posts to fetch the latest blog posts.
Implementation Notes
Data Sources
Connect to your preferred content source:
- Headless CMS (Contentful, Strapi, Sanity)
- Markdown files with frontmatter
- Database (PostgreSQL, MongoDB)