PHPackages                             gioppy/statamic-rest-client - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. gioppy/statamic-rest-client

ActiveLibrary[HTTP &amp; Networking](/categories/http)

gioppy/statamic-rest-client
===========================

A simple PHP client for Statamic REST Api

v1.1.1(2y ago)032MITPHPPHP ^8.1.0

Since Nov 20Pushed 2y ago1 watchersCompare

[ Source](https://github.com/gioppy/statamic-rest-client)[ Packagist](https://packagist.org/packages/gioppy/statamic-rest-client)[ RSS](/packages/gioppy-statamic-rest-client/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (9)Used By (0)

This package provide a simple client for Statamic REST API.

It was created primarily for use on SSG php systems, such as Jigsaw, but can be used in any context.

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

[](#installation)

> composer require gioppy/statamic-rest-client

The package needs at least php 8.1, and depend on `guzzlehttp/guzzle` and `illuminate/collections`.

How to use
----------

[](#how-to-use)

After installed, you can create new client with a classic `new` operator

> new StatamicRestClient(...)

or with a static method

> StatamicRestClient::make(...)

You can pass two values: the host of your Statamic installation (e.g: `https://www.my-statmic.com`) and optionally the API endpoint path (default is `api` but you can customize on [Statamic API config](https://statamic.dev/rest-api#customizing-the-api-url)).

### Filters

[](#filters)

You can filter the api using `->where()` method in two possible ways. You can filter single value

```
StatamicRestClient::make(...)
  ->where('featured', true)
```

or using a condition

```
StatamicRestClient::make(...)
  ->where('title', 'awesome', 'contains')
```

### Sorting

[](#sorting)

You can sort the response using `->sort()` method, passing an array of fields:

```
StatamicRestClient::make(...)
  ->sort(['one', '-two', 'three'])
```

### Selecting fields

[](#selecting-fields)

You can specify what fields should be included on response using `->fields()` method, passing an array of fields:

```
StatamicRestClient::make(...)
  ->fields(['id', 'title', 'content'])
```

### Pagination

[](#pagination)

You can paginate the response using `->paginate()` method, passing the number of items you want and, optionally, the number of page:

```
StatamicRestClient::make(...)
  ->paginate(5, 2)
```

### Entries / Entry

[](#entries--entry)

Get all entries of collection:

```
StatamicRestClient::make(...)
  ->entries('collection')
```

Get an entry from a collection:

```
StatamicRestClient::make(...)
  ->entry('collection', 'id')
```

### Collection Tree

[](#collection-tree)

TODO

### Navigation Tree

[](#navigation-tree)

```
StatamicRestClient::make(...)
  ->navigation('navigation_name')
```

### Taxonomy Terms / Taxonomy Term

[](#taxonomy-terms--taxonomy-term)

Get all terms of taxonomy:

```
StatamicRestClient::make(...)
  ->terms('taxonomy_name')
```

Get a single term from taxonomy:

```
StatamicRestClient::make(...)
  ->term('taxonomy_name', 'taxonomy_slug')
```

### Globals / Global

[](#globals--global)

Get all globals:

```
StatamicRestClient::make(...)
  ->globals()
```

Get single global:

```
StatamicRestClient::make(...)
  ->global('handle')
```

### Assets / Asset

[](#assets--asset)

Get all assets of one container:

```
StatamicRestClient::make(...)
  ->assets('container')
```

Get single asset:

```
StatamicRestClient::make(...)
  ->asset('container', 'path')
```

Get single asset by its id:

```
StatamicRestClient::make(...)
  ->assetById('id')
```

The `id` of an asset is formatted by Statamic as `container::path`.

### Getting response

[](#getting-response)

You can get all response as array, including links and other nodes with `->all()` method

```
StatamicRestClient::make(...)
  ->entries('collection')
  ->all()
```

or you can get only data node with `->data()` method

```
StatamicRestClient::make(...)
  ->entries('collection')
  ->data()
```

If you need to have `data` as collection you can us `->toCollection()` method

```
StatamicRestClient::make(...)
  ->entries('collection')
  ->toCollection()
```

### Integration with Statamic Glide Rest

[](#integration-with-statamic-glide-rest)

[Statami Glide Rest](https://github.com/gioppy/statamic-glide-rest) is a small addon for Statamic that expose glide manipulation presets on a REST API endpoint. You can get an asset response with a glide presets with the class `StatamicGlideRest`:

```
StatamicGlideRest::make($host)
  ->presets(['small', 'medium'])
  ->glide('container::path')
  ->data()
```

TODO
----

[](#todo)

- Entries
- Entry
- Collection Tree
- Navigation Tree
- Taxonomy Terms
- Taxonomy Term
- Assets
- Asset
- Globals
- Global
- Test
- Integration with [Statamic Glide Rest](https://github.com/gioppy/statamic-glide-rest)
- Laravel integration

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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 ~17 days

Recently: every ~29 days

Total

8

Last Release

785d ago

Major Versions

v0.0.5 → v1.0.02023-11-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/fc47a128db5ee83c716a4a83478d5b506ac22615e0f9e683426a7bd46431808e?d=identicon)[gioppy](/maintainers/gioppy)

---

Tags

apirestpackagestatamic

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gioppy-statamic-rest-client/health.svg)

```
[![Health](https://phpackages.com/badges/gioppy-statamic-rest-client/health.svg)](https://phpackages.com/packages/gioppy-statamic-rest-client)
```

###  Alternatives

[xeroapi/xero-php-oauth2

Xero official PHP SDK for oAuth2 generated with OpenAPI spec 3

1054.3M14](/packages/xeroapi-xero-php-oauth2)[zenditplatform/zendit-php-sdk

PHP client for Zendit API

1204.3k](/packages/zenditplatform-zendit-php-sdk)[whatarmy/fedex-rest

New FedEx Rest API wrapper

2440.5k1](/packages/whatarmy-fedex-rest)[threesquared/laravel-wp-api

Laravel package for the Wordpress JSON REST API

1310.3k](/packages/threesquared-laravel-wp-api)[meteocontrol/vcom-api-client

HTTP Client for meteocontrol's VCOM API - The VCOM API enables you to directly access your data on the meteocontrol platform.

175.7k1](/packages/meteocontrol-vcom-api-client)

PHPackages © 2026

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