← Portfolio | All Demos | Headless WP REST API

⚡ WordPress REST API + Vanilla JS

Headless WordPress
in Action

Real property listings fetched live from a WordPress REST API endpoint — rendered entirely client-side with no page reload.

GET /wp-json/wp/v2/property?per_page=6&_embed&orderby=date&order=desc
📦
WordPress CPT + ACF data
🌐
WP REST API /wp-json/wp/v2/
📄
fetch() Async + JSON
🎨
DOM Render Zero framework

Live Property Listings

Fetched in real time from the Real Estate demo WordPress install

Open Endpoint
Fetching from WordPress REST API…

    

How This Works

✅ WordPress REST API

The property custom post type is automatically exposed at /wp-json/wp/v2/property — no plugin required. Adding show_in_rest: true to the CPT registration is all it takes.

✅ _embed parameter

Appending ?_embed inlines the featured image, author, and taxonomy data in a single request — eliminating the need for multiple API calls.

✅ Zero dependencies

This page uses the native fetch() API with async/await — no React, Vue, Axios, or jQuery. Just modern JavaScript and the browser's built-in capabilities.

✅ ACF + REST

Advanced Custom Fields data is available in the acf key of each response object when "Show in REST API" is enabled on each field group — price, beds, baths included.