Fetch Content
Contentstack is an API-first headless CMS that separates your content backend from the frontend, giving developers complete flexibility in delivering content across various channels.
You can fetch content using a variety of APIs and tools, depending on your application’s structure and requirements—whether you’re building a dynamic web app, mobile application, or syncing content to a local environment.
Choose a Content Fetching Method
Use this quick guide to select the right method before integrating Contentstack into your application.
| If your goal is... | Use this | Why |
| Fetch published content for websites or apps | Content Delivery API or Delivery SDKs | Optimized for fast, read-only content delivery |
| Retrieve related or nested content in a single request | GraphQL Delivery API | Flexible queries reduce multiple API calls |
| Synchronize content with a local database or cache | Synchronization API or DataSync | Efficient delta updates for sync workflows |
| Manage content (create, update, delete) | Content Management API | Supports administrative and automation operations |
Note:
- Use Delivery APIs and SDKs for rendering content in your application.
- Use the Content Management API only for content management operations. Mixing these patterns can lead to performance and security issues.
Validate Your Setup Before Integration
Before building your application logic, make a successful test request using a tool such as Postman, curl, or an SDK.
Confirm the following:
- The request returns a 200 OK response
- The response includes expected entry or asset data
- The correct environment and locale are used
Verify these configuration details:
- API key
- Access token (use a Delivery token for content delivery)
- Environment name
- Region-specific API host
Common Issues and How to Fix Them
| Issue | Possible Cause | What to Check |
| 401 / 403 errors | Invalid token or insufficient permissions | Token type, permissions, environment |
| 404 errors | Incorrect UID or API host | Entry UID, content type UID, region |
| Missing or empty fields | Unpublished content or incorrect locale | Publish status, locale, field identifiers |
Recommended Integration Flow
- Select a content fetching method based on your use case
- Make a test API request to validate credentials and configuration
- Integrate the API or SDK into your application
- Configure webhooks or deployment triggers if your setup requires updates on content changes
Tip: Validate your API request early to avoid integration issues later in development.
Fetch Content Using RESTful APIs
Contentstack offers multiple read-only APIs that let you fetch content in various formats. These APIs support use cases from real-time content delivery to local synchronization and image transformation.
Content Delivery API
Use the Content Delivery API to retrieve live, published content from your stack and deliver it to your digital properties.
- Read-only API for published content
- Supports multiple platforms: web, mobile, smart displays, wearables, etc.
- Ideal for delivering real-time content directly from Contentstack to your frontend
GraphQL Delivery API
The GraphQL Content Delivery API lets you fetch precise, structured content from multiple types using a single query.
- Fetch customized content using a single read-only API endpoint
- Retrieve entries and assets from multiple content types
- Fetch nested or related resources without multiple API calls
Synchronization API
Use the Synchronization API to keep your local app data in sync with Contentstack by fetching only the latest updates.
- Read-only API for delta content updates
- Efficient for apps that require offline access or local caching
- Suitable for mobile apps, kiosks, or distributed systems
Image Delivery API
Manipulate and deliver images stored in your Contentstack stack using the Image Delivery API.
- Read-only API for image retrieval
- Supports real-time manipulation via URL parameters
- Optimize image performance with resizing, cropping, trimming, quality control, and DPR adjustments
Content Management API
The Content Management API gives you complete control over managing the content of your Contentstack account.
- Read-write API to create, update, and delete entries and assets
- Supports content types, workflows, and user management
- Fetches both draft and published content
- Ideal for admin operations, automation, and custom CMS tooling
Fetch Content Using SDKs
To simplify integration, Contentstack offers SDKs across multiple languages and platforms to simplify content retrieval and management within your development environment.
Each SDK includes API references, sample apps, and installation guides for quick setup.
Available SDKs:
Fetch Content Using Other Tools
In addition to APIs and SDKs, Contentstack provides other tools to help automate workflows and enable advanced integrations.
Webhooks
Webhooks let you send real-time notifications to custom endpoints when specific events occur in Contentstack.
- Trigger actions on content publishing, deletion, and more
- Integrate with third-party services or CI/CD pipelines
Use for triggering deployments, alerts, or syncing changes with external systems (e.g., Slack, Jenkins, Netlify).
Contentstack DataSync
DataSync helps you sync published content from your stack to local backends like MongoDB or file systems.
- Keeps local databases updated with the latest published changes
- Suitable for offline or low-connectivity environments
- Ideal for applications that require fast, reliable access to synced content
