Get Page
Retrieve a single page by ID with complete configuration, content, and metadata. This endpoint returns different data structures based on the page type.
Endpoint
Path Parameters
Name Type Required Description idstring Yes Unique page identifier (e.g., page_xyz789)
Query Parameters
Name Type Required Description include_sectionsboolean No Include detailed section configuration (default: true) include_markdownboolean No Include raw markdown content for article/docs pages (default: true) formatstring No Response format: json (default) or markdown
Name Required Description AuthorizationYes Bearer $PAGEGUN_API_KEYContent-TypeNo application/json
Response
Returns a page object with complete configuration and content data.
Page Type: Landing Page
{
"data" : {
"id" : "page_xyz789" ,
"page_name" : "Product Landing Page" ,
"slug" : "product-landing" ,
"subroute" : "pages" ,
"type" : "page" ,
"status" : "published" ,
"url" : "/product-landing" ,
"description" : "Our main product landing page with hero, features, and CTA" ,
"og_image_url" : "https://example.com/product-og.jpg" ,
"meta" : {
"title" : "Amazing Product - Get Started Today" ,
"description" : "Discover our amazing product features and benefits." ,
"keywords" : "product, landing, features" ,
"robots" : "index, follow"
},
"config" : {
"sections" : [
{
"id" : "hero-1" ,
"type" : "hero" ,
"props" : {
"headline" : "Build Amazing Websites" ,
"subheadline" : "Create stunning pages without code" ,
"cta_text" : "Get Started" ,
"cta_url" : "/signup" ,
"background_image" : "https://example.com/hero-bg.jpg"
}
},
{
"id" : "features-1" ,
"type" : "features" ,
"props" : {
"title" : "Why Choose Us" ,
"features" : [
{
"icon" : "⚡" ,
"title" : "Lightning Fast" ,
"description" : "Optimized for speed and performance"
}
]
}
}
]
},
"markdown_content" : null ,
"sections_count" : 2 ,
"word_count" : 245 ,
"created_at" : "2024-01-15T10:30:00Z" ,
"updated_at" : "2024-01-20T14:00:00Z"
}
}
Page Type: Article
{
"data" : {
"id" : "page_art456" ,
"page_name" : "How to Build Better Landing Pages" ,
"slug" : "build-better-landing-pages" ,
"subroute" : "blog" ,
"type" : "article" ,
"status" : "published" ,
"url" : "/blog/build-better-landing-pages" ,
"description" : "Learn the best practices for creating high-converting landing pages" ,
"og_image_url" : "https://example.com/article-og.jpg" ,
"meta" : {
"title" : "How to Build Better Landing Pages - Best Practices Guide" ,
"description" : "Learn proven strategies to create landing pages that convert visitors into customers." ,
"keywords" : "landing pages, conversion, marketing, design" ,
"robots" : "index, follow"
},
"config" : {
"sections" : []
},
"markdown_content" : "# How to Build Better Landing Pages\n\nLanding pages are crucial for converting visitors...\n\n## Key Principles\n\n1. **Clear Value Proposition**\n2. **Compelling Headlines**\n3. **Strong Call-to-Action**" ,
"sections_count" : 0 ,
"word_count" : 1250 ,
"publish_date" : "2024-01-18T00:00:00Z" ,
"author" : {
"name" : "John Smith" ,
"avatar" : "https://example.com/john.jpg"
},
"created_at" : "2024-01-15T10:30:00Z" ,
"updated_at" : "2024-01-20T14:00:00Z"
}
}
Page Type: Documentation
{
"data" : {
"id" : "page_doc789" ,
"page_name" : "API Authentication" ,
"slug" : "authentication" ,
"subroute" : "docs" ,
"type" : "docs" ,
"status" : "published" ,
"url" : "/docs/api-keys" ,
"description" : "Learn how to authenticate with our API" ,
"og_image_url" : null ,
"meta" : {
"title" : "API Authentication - Documentation" ,
"description" : "Complete guide to authenticating with the PageGun API." ,
"keywords" : "api, authentication, bearer token" ,
"robots" : "index, follow"
},
"config" : {
"sections" : []
},
"markdown_content" : "# API Authentication\n\nAll API requests require authentication..." ,
"sections_count" : 0 ,
"word_count" : 850 ,
"nav_order" : 2 ,
"parent_page" : "page_doc123" ,
"created_at" : "2024-01-12T08:00:00Z" ,
"updated_at" : "2024-01-18T16:30:00Z"
}
}
Response Fields
Base Page Object
Field Type Description idstring Unique identifier for the page page_namestring Display name of the page slugstring URL slug for the page subroutestring Subroute/folder for the page typestring Page type: page, article, docs, or item statusstring Publishing status: draft, published, or archived urlstring Full URL path for the page descriptionstring Page description for admin use og_image_urlstring Social sharing image URL metaobject SEO metadata configobject Page configuration (sections for landing pages) markdown_contentstring Raw markdown content (articles/docs only) sections_countinteger Number of content sections word_countinteger Approximate word count created_atstring ISO 8601 timestamp when page was created updated_atstring ISO 8601 timestamp when page was last modified
Field Type Description titlestring Page title for SEO descriptionstring Meta description for SEO keywordsstring SEO keywords (comma-separated) robotsstring Robots meta directive
Config Object (Landing Pages)
Field Type Description sectionsarray Array of section configuration objects
Additional Fields (Articles)
Field Type Description publish_datestring ISO 8601 timestamp for article publication authorobject Author information
Additional Fields (Documentation)
Field Type Description nav_orderinteger Navigation order in documentation parent_pagestring Parent page ID for nested docs
Examples
Basic Request
curl -X GET "https://api.pagegun.com/pages/page_xyz789" \
-H "Authorization: Bearer $PAGEGUN_API_KEY "
Minimal Response (No Sections)
curl -X GET "https://api.pagegun.com/pages/page_xyz789?include_sections=false" \
-H "Authorization: Bearer $PAGEGUN_API_KEY "
curl -X GET "https://api.pagegun.com/pages/page_art456?format=markdown" \
-H "Authorization: Bearer $PAGEGUN_API_KEY "
JavaScript Example
const getPage = async (pageId, options = {}) => {
const params = new URLSearchParams(options);
const queryString = params.toString() ? `? ${params} ` : '' ;
const response = await fetch( `https://api.pagegun.com/pages/ ${pageId} ${queryString} ` , {
headers : {
'Authorization' : `Bearer ${process.env.PAGEGUN_API_KEY} `
}
});
if (!response.ok) {
throw new Error ( `HTTP error! status: ${response.status} ` );
}
return response.json();
};
// Usage examples
const page = await getPage( 'page_xyz789' );
const articleMarkdown = await getPage( 'page_art456' , { format : 'markdown' });
const minimalPage = await getPage( 'page_xyz789' , { include_sections : false });
Error Responses
401 Unauthorized
{
"statusCode" : 401 ,
"name" : "unauthorized" ,
"message" : "Invalid or missing API key"
}
403 Forbidden
{
"statusCode" : 403 ,
"name" : "forbidden" ,
"message" : "You don't have access to this page"
}
404 Not Found
{
"statusCode" : 404 ,
"name" : "not_found" ,
"message" : "Page not found"
}
400 Bad Request
{
"statusCode" : 422 ,
"name" : "invalid_request" ,
"message" : "Invalid query parameter"
}
429 Too Many Requests
{
"statusCode" : 429 ,
"name" : "rate_limit_exceeded" ,
"message" : "Too many requests. Please try again later."
}