Academy

/

Rest API

/

WordPress API 101: Master REST API Basics

WordPress API 101: Master REST API Basics

Discover the essentials of WordPress native REST API. Unlock powerful integration capabilities and elevate your web development skills. Learn more today!

Integrate WordPress data seamlessly into Divhunt

Using the WordPress native REST API, you can fetch all the information from your website, such as posts, categories, specific posts, media files, authors, and much more. For a better understanding of what you can fetch with the WordPress API, it's best to read their documentation.

After learning how the WP REST API works, you can use endpoints to fetch data in Divhunt and display it on your website. Divhunt also enables you to cache API data, so you don't need your APIs to be cached by WordPress, achieving the best performance.

In the video below, you can view examples of how to fetch specific data with the WordPress REST API and display it in Divhunt.

How to fetch and display the last 30 WordPress posts in Divhunt (Example)

In this lesson, we will show you how to fetch and display the last 30 posts from WordPress, ordered from oldest to newest, using the Divhunt builder. You can find many more lessons in the WordPress category of Divhunt Academy.

API endpoint for this use case

https://yourwebsite.com/wp-json/wp/v2/posts?per_page=30&order=asc
  1. Install REST API application in Divhunt
  2. Create new GET Request in REST API of Divhunt
  3. Paste your endpoint in Endpoint (url) of our GET Request.
  4. Click the execute icon in the middle of the top bar to verify everything is working correctly. If you see a JSON data preview on the right (as shown in the screenshot), everything is correct, and we are ready to use this data in the builder.
  5. This data is now stored in Source of your website and you are ready to use it. Learn more about Source here.
How To Fetch & Display WordPress Posts In Divhunt
How To Fetch & Display WordPress Posts In Divhunt

Table of content

Create your website visually – fast and easy.

Build a stunning website with ease using our visual builder. No experience needed – just drag, drop, and launch your site today.

Build and publish websites for free

Build and host your site with a custom domain for free. Upgrade anytime for expanded limits.

Build for free

Built in Divhunt

We use cookies.

By clicking “Accept All”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View ourCookie Policyfor more information.

Optahunt

Preferences

Manage your cookie preferences.

Essentials

Always Active

These are required for the website to work, like remembering your privacy settings, keeping you logged in, or enabling secure payments.

Performance

These help us understand how people use our site (like which pages are most popular) so we can make improvements.

Personalization

These allow the site to remember your preferences (such as language or region) and provide enhanced features.

Advertising & Targeting

These are used to deliver ads more relevant to you, limit how often you see them, and measure campaign performance.

Save my preferences

You can always change these settings later via ourCookie Policy pagepage, or via the cookie widget placed at the bottom left of the page.