Drupal is a registered trademark of Dries Buytaert

transform_api

22 sites Security covered
View on drupal.org

Transform API is meant to create a familiar path for Drupal site builders and developers to take their knowledge of entities, view modes and templates and instead use this to produce JSON instead of HTML. This enables building headless solutions while being able to use the same configuration skills that you are used to.

Features

Allows easy transform the following to JSON through configuration or code:

  • All content entities that support view modes
  • Menus and other header / footer elements through transform blocks
  • Custom routes through plugins
  • Alter any existing transforms through alter hooks

All transformed content is also fully cached in a variation cache with the usual cache tags and cache contexts for cache invalidation.

Difference to JSON:API

JSON:API is more intended to deliver the raw entity data in a standardized way for decoupled, requiring the frontend to do much processing of images and data after receiving it. The workflow of JSON:API is also quite different from building a standard Drupal application with a theme.

Transform API instead tries to leverage as much of the functionality of Drupal to deliver data as ready as possible. Like delivering images already in multiple formats for responsive images.
The workflow is also as close to how you would normally make Drupal applications, with blocks, (transform blocks) view modes (transform modes) and formatters (transformers), lazy_builders (lazy_transformers) and preprocess (transform_alter) as possible.

Similar modules

Post-Installation

After installation you should now be able to get JSON of any entities on your site by adding ?format=json to the url. To get more fields exposed as json, configure transform modes just like you would view modes and add transform blocks just like you would normal blocks.

Activity

Total releases
9
First release
Feb 2025
Latest release
4 months ago
Release cadence
29 days
Stability
78% stable

Release Timeline

Releases

Version Type Release date
2.1.4 Stable Oct 13, 2025
2.1.3 Stable Aug 25, 2025
2.1.2 Stable Aug 25, 2025
2.1.1 Stable Aug 12, 2025
2.0.1 Stable Aug 11, 2025
2.1.0 Stable Aug 11, 2025
2.0.0 Stable May 22, 2025
2.0.0-rc2 Pre-release May 15, 2025
2.0.0-rc1 Pre-release Feb 25, 2025