Contentstack LogoContentstack Logo

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 thisWhy
Fetch published content for websites or appsContent Delivery API or Delivery SDKsOptimized for fast, read-only content delivery
Retrieve related or nested content in a single requestGraphQL Delivery APIFlexible queries reduce multiple API calls
Synchronize content with a local database or cacheSynchronization API or DataSyncEfficient delta updates for sync workflows
Manage content (create, update, delete)Content Management APISupports 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

IssuePossible CauseWhat to Check
401 / 403 errorsInvalid token or insufficient permissionsToken type, permissions, environment
404 errorsIncorrect UID or API hostEntry UID, content type UID, region
Missing or empty fieldsUnpublished content or incorrect localePublish status, locale, field identifiers

Recommended Integration Flow

  1. Select a content fetching method based on your use case
  2. Make a test API request to validate credentials and configuration
  3. Integrate the API or SDK into your application
  4. 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
Was this article helpful?
^