February 25, 2026

AEM 6.4 Content Fragment Output as JSON

AEM Content Fragments can be read through JSON URLs.

Why JSON?

Content Fragments are not only for web pages. A fragment is made available to external applications through JSON delivery, for example:

  • single-page applications
  • native mobile applications
  • other channels and touchpoints outside AEM
AEM content as a service JSON

AEM 6.4 core components can export their data as JSON, so structured content can be delivered to channels other than AEM pages.

Content Fragments vs Experience Fragments

The major difference is that a Content Fragment is pure content, without design or layout, while an Experience Fragment is fully laid-out content — a portion of a web page. More in Experience Fragments vs Content Fragments.

Two kinds of Content Fragments

  • Simple fragments have no predefined structure — only text and images. They are based on the Simple Fragment template.
  • Fragments with structured content are based on a Content Fragment model, which defines their structure.

Generating JSON for a Content Fragment

AEM 6.4 supports the JSON exporter with the Content Fragment core component. With it, the content of an AEM page is delivered as a JSON data model that any third-party application can consume. The exporter is invoked by adding .model.json to a URL.

JSON for a fragment in the DAM

Say we have created a fragment called My Simple Fragment (my-simple-fragment). Its model is available at:

http://localhost:4502/content/dam/my-simple-fragment/_jcr_content/model.json
{
    "jcr:primaryType": "nt:unstructured",
    "jcr:title": "Simple Fragment",
    "version": 2,
    "jcr:description": "A simple fragment, containing one single element and no predefined variations",
    "precreateElements": true
}

JSON for a fragment authored on a page

Step 1: get the page JSON. Here the same fragment is authored on the We.Retail page /content/we-retail/language-masters/en/men.html. Its JSON is at:

http://localhost:4502/content/we-retail/language-masters/en/men.model.json

Step 2: get the Content Fragment JSON. The fragment appears in the page JSON:

Content Fragment in the page JSON

For the authored fragment alone, call .model.json on the fragment component:

http://localhost:4502/content/we-retail/language-masters/en/men/jcr:content/root/responsivegrid/contentfragment_1655772226.model.json

The JSON contains every element, including the variations that were created and authored.

Content Fragment output JSON

Next: create a Content Services endpoint to deliver fragments to a mobile app or SPA. For AEM 6.3, see Content Fragment output as JSON; for today's headless delivery, see GraphQL in AEM.