API Reference
Complete endpoint documentation with examples
Base URL
http://your-wordpress-site.com/wp-json/bridge/v1
Endpoints
Get Single Page/Post by Slug
GET /page?slug={slug}
GET /page?slug={slug}&preview=true
GET /page?slug={slug}&locale={locale}Parameters:
slug(string, required) - Post slugpreview(boolean, optional) - Include draft/private content (requires API key)locale(string, optional) - Locale code for multi-language
Example:
curl http://yoursite.com/wp-json/bridge/v1/page?slug=hello-world
Get Single Page/Post by UUID
GET /page/{uuid}List Pages/Posts
GET /pages?type={type}&limit={limit}&offset={offset}Parameters:
type(string, optional, default: "post") - Post typelimit(integer, optional, default: 20, max: 100) - Number of itemsoffset(integer, optional, default: 0) - Pagination offsetlocale(string, optional) - Locale code
Example:
curl 'http://yoursite.com/wp-json/bridge/v1/pages?type=post&limit=10'
Response Schema
Post Object (Full)
{
"uuid": "550e8400-e29b-41d4-a716-446655440000",
"slug": "my-post",
"type": "post",
"status": "publish",
"title": "Post Title",
"excerpt": "Short description",
"content": "<p>Full HTML content</p>",
"publishedAt": "2025-12-04T20:56:31Z",
"modifiedAt": "2025-12-04T20:56:31Z",
"author": {
"id": 1,
"name": "Author Name",
"slug": "author-slug",
"avatar": "https://...",
"bio": "Author bio",
"url": "https://..."
},
"seo": {
"title": "SEO Title",
"description": "SEO Description",
"canonical": "https://...",
"noindex": false,
"ogImage": "https://..."
},
"featuredImage": {
"id": 123,
"url": "https://...",
"alt": "Alt text",
"width": 1920,
"height": 1080,
"srcset": "...",
"sizes": "...",
"caption": "Caption",
"mimeType": "image/jpeg"
},
"categories": [...],
"tags": [...],
"acf": {}
}Authentication
Preview Content (API Key)
To access draft/private content, include an API key in the request header:
X-Headless-Bridge-Key: hb_your_api_key_here
Example:
curl -H "X-Headless-Bridge-Key: hb_abc123..." \ "http://yoursite.com/wp-json/bridge/v1/page?slug=draft-post&preview=true"
Multi-Language Support
Headless Bridge includes FREE multi-language support for WPML and Polylang.
# Get French version curl 'http://yoursite.com/wp-json/bridge/v1/page?slug=bonjour-monde&locale=fr_FR' # Get Spanish version curl 'http://yoursite.com/wp-json/bridge/v1/page?slug=hola-mundo&locale=es_ES'
Error Responses
All errors return JSON:
{
"code": "rest_post_invalid_slug",
"message": "Invalid post slug.",
"data": {
"status": 404
}
}Rate Limiting
Default limits (configurable):
- Authenticated requests: 1000 requests/hour
- Unauthenticated requests: 100 requests/hour
Performance Tips
- Use pagination - Don't fetch all posts at once
- Cache responses in your application
- Use UUID for internal references (faster than slug)
- Leverage srcset for responsive images
Next Steps
- See Next.js Integration for complete examples
- Check Troubleshooting if you encounter issues
- Upgrade to Pro for ACF integration