PHPackages                             guym4c/ghost-api-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. guym4c/ghost-api-php

ActiveLibrary[API Development](/categories/api)

guym4c/ghost-api-php
====================

PHP Ghost API client

v2.0.1(5y ago)037MITPHPCI failing

Since Nov 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/guym4c/ghost-api-php)[ Packagist](https://packagist.org/packages/guym4c/ghost-api-php)[ Docs](https://github.com/guym4c/ghost-api-php)[ RSS](/packages/guym4c-ghost-api-php/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (6)Versions (11)Used By (0)

`ghost-api-php`
===============

[](#ghost-api-php)

Easy pulling of content from a Ghost API.

Installation
------------

[](#installation)

```
composer require guym4c/ghost-api-php
```

Usage
-----

[](#usage)

Get an instance of the API client:

```
$ghost = new Ghost(
    $yourGhostApiBaseUrl,
    $yourGhostApiKey,
);
```

You can also pass in a Doctrine Cache provider here (and configure its lifetime), and the client will cache all requests that give a single-resource answer.

Call static methods on the resource classes to get your data.

```
use Guym4c\GhostApiPhp\Model as Cms;

Cms\Post::bySlug($ghost, 'my-post-slug');
Cms\Tag::byId($ghost, 'my-tag-id');
Cms\Page::get()
```

If you don't know the slug or ID of the resource you're looking for, you can also run queries. (You'll probably want to be reading Ghost's [API docs](https://ghost.org/docs/api/v3/content/) in parallel if you use this method, so that you know what the client is doing.)

```
Cms\Page::get(
    /* limit: */ 5,
    /* simple sorting: */ new Sort('some_value', SortOrder::DESC),
);
```

`get()` returns a `CollectionRequest` that exposes methods for managing pagination - you can access the returned records using `getResources()`.

### Filtering

[](#filtering)

The third parameter to the `::get` method above is a Ghost NQL filter, assembled programmatically using the client. It provides fluent methods that allow you to construct complex filter expressions.

```
(new Filter())
    ->by('some-val', '=', 'true', true)
    ->and('another-val', '-', 'not-this')
    ->else((new Filter())
        ->by(
            'this-filter-will-be-given-brackets',
            '=',
            'which-overrides-operator-precedence',
        )
    );
```

`with()` and `else()` are bracket-ised versions of `and()` and `or()`. You must start with `by()`.

We've passed an additional `true` at the start here to denote that the value, `'true'`, is a literal and should be interpreted by Ghost as a boolean, not a string.

`[]` in-group syntax is not supported by the client.

Refer to the Ghost docs for more information on NQL filtering.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~22 days

Total

10

Last Release

2169d ago

Major Versions

v0.2 → v1.02020-03-07

v1.2 → v2.0.02020-06-01

### Community

Maintainers

![](https://www.gravatar.com/avatar/9db8acda212740c63090beab8438300c1e158e824a9642fa49babef315136c4c?d=identicon)[guym4c](/maintainers/guym4c)

---

Top Contributors

[![guym4c](https://avatars.githubusercontent.com/u/2103489?v=4)](https://github.com/guym4c "guym4c (14 commits)")

---

Tags

phpapiGhost

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/guym4c-ghost-api-php/health.svg)

```
[![Health](https://phpackages.com/badges/guym4c-ghost-api-php/health.svg)](https://phpackages.com/packages/guym4c-ghost-api-php)
```

###  Alternatives

[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[resend/resend-php

Resend PHP library.

574.7M21](/packages/resend-resend-php)[mozex/anthropic-php

Anthropic PHP is a supercharged community-maintained PHP API client that allows you to interact with Anthropic API.

46365.1k13](/packages/mozex-anthropic-php)[redwebcreation/twitter-stream-api

Consume the Twitter Stream API in real-time.

3220.3k1](/packages/redwebcreation-twitter-stream-api)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

762.6k](/packages/scriptdevelop-whatsapp-manager)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
