SR
Click to open github profile
Get Started

Installation

Learn how to install the Craft Query API Craft CMS plugin.


Craft CMS Setup

Set up a Craft CMS > 5 project. You could use that Guide.

Install

With ddev:

ddev composer require samuelreichor/craft-query-api &&
ddev craft plugin/install craft-query-api

With php:

composer require samuelreichor/craft-query-api &&
php craft plugin/install craft-query-api

Create Access Token

You can use this command php craft query-api/default/create-public-token to automatically add a public access token with the according public schema. Then copy the access token.

Finish up

You can test it now by hitting that endpoint with a curl or by using tools like bruno or postman.

curl --request GET \
  --url 'https://your-site.ddev.site/v1/api/queryApi/customQuery' \
  --header 'authorization: Bearer your-access-token'

You should get an empty array as response: [].


Copyright © 2025 Samuel Reichör