New in Beta:  Block Data API

We’re pleased to announce the beta availability of a new Block Data API.  It is now released for you to begin testing.  

What is the Block Data API?

Animation detailing how the block API functions

For many use cases, it’s helpful to access blocks in WordPress as pure JSON data instead of HTML.  Doing so eliminates the need to write parsing layers to transform markup into JSON, and to keep those translation layers up to date with every version of Gutenberg.  All of this saves developer time and effort.  

While options have existed for accomplishing this with GraphQL when accessed via REST, translation layers were required. The Block Data API is a new REST API endpoint to retrieve the Gutenberg blocks of a single WordPress post.

What are some use cases for the Block Data API?

There are several known use cases for the Block Data API.  These include:

  • Power your Node.js front end with less reliance on dangerouslySetInnerHTML. 
  • Send data about your blocks to Machine Learning and AI applications.
  • Use blocks in mobile applications with reduced processing.

This is not a comprehensive list.  As we go through the beta period, we’d love your feedback on how you use the Block Data API, what works well for you, and what you’d like to see improved.

While the API is in beta, you can offer that feedback by opening a GitHub issue. When it is released, we can provide support via normal means.

How do I get access to the Block Data API?

To install the plugin, go here and follow the instructions that have been provided

Where can I find more information/documentation?

The project Readme has comprehensive information on the plugin and its functions.