genko.meDocs
Frameworks and languagesPHP

PHP

Read genko.me entries from PHP using only cURL and json_decode(), without an official PHP package.

The genko.me delivery API is a REST API: send a GET request with an X-API-KEY header and receive JSON. In PHP, you only need the standard cURL and JSON extensions.

What to use

There is no official PHP package. You do not need a Composer dependency. The curl_* functions and json_decode() are enough to add CMS-managed content to an existing PHP site.

You can also use file_get_contents() with a stream context. This guide uses cURL because it makes HTTP status codes and error responses straightforward to read. The delivery API returns JSON with a message even for 404 and 400 responses.

Good fit

  • Show entries written in genko.me from a WordPress theme or plugin.
  • Add announcements or case studies to an existing Laravel, Symfony, or CakePHP app.
  • Move frequently updated pages of a plain PHP site into a CMS.
  • Run on shared hosting where Node.js is unavailable.

Limitations

  • Creating or updating entries. The delivery API is read-only. Create and publish entries in the dashboard.
  • Generated types. @genko-me/cli generates TypeScript definitions. Define PHP types to match your schema yourself.
  • Showing a list of drafts. A draftKey can fetch only one entry.
  • Full-text search. q performs a case-insensitive substring match, without relevance ranking or linguistic analysis.

Cache the response

PHP normally starts a process for each request. Without caching, every page view calls the delivery API. The limit is 300 requests per minute per API key. On busy pages, store results in a file or an application cache such as APCu, Redis, or your framework's cache, then invalidate them with a webhook.

Delivery API responses include Cache-Control: private, no-store, so an intermediate HTTP cache will not cache them. Manage the cache in your app.

Next steps

  • Get started: configure an API key and show a list and a single entry
  • Tutorial: pagination, previewing drafts, and webhook signature verification
  • Delivery API: endpoint and response specifications

Last updated: October 6, 2026

On this page