PHPackages                             ritson/placid-statamic - 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. ritson/placid-statamic

ActiveStatamic-addon[API Development](/categories/api)

ritson/placid-statamic
======================

Consume RESTful APIs in your Statamic templates

3.1.0(4y ago)551.2k1[4 issues](https://github.com/alecritson/Placid-Statamic/issues)MITPHPCI failing

Since Dec 20Pushed 2y ago5 watchersCompare

[ Source](https://github.com/alecritson/Placid-Statamic)[ Packagist](https://packagist.org/packages/ritson/placid-statamic)[ RSS](/packages/ritson-placid-statamic/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (10)Dependencies (2)Versions (4)Used By (0)

Placid Statamic
===============

[](#placid-statamic)

[![StyleCI](https://camo.githubusercontent.com/bab38ab8ba2efdf40dbcf6556fd63b39da681b474e8110ace4fc1efa9ab9989d/68747470733a2f2f7374796c6563692e696f2f7265706f732f32353634303335342f736869656c643f6272616e63683d7632)](https://styleci.io/repos/25640354)

---

Placid allows you to consume RESTful APIs in your Statamic templates, using Guzzle to handle the requests.

**Placid supports**:

- Caching/Refreshing
- Template variable pairs
- Predefined requests
- Headers
- Access tokens

### Installation

[](#installation)

Require the addon via composer

```
composer require ritson/placid-statamic

```

### Parameters

[](#parameters)

- **host**: The API host
- **cache** (number): The time in seconds until the cache refreshes (default is 7200 / 2 hours)
- **handle** (string) : The handle of the resource to use
- **method** (string) : You can set which method to use on the request, default is 'GET'
- **query** (string) : Add your queries here, see [queries](#queries) for more info
- **path** (string) : Add your own custom path, see [paths](#paths) for details
- **auth** (string) : Handle for the auth scheme to use

### Saved requests

[](#saved-requests)

You can set up requests for placid in **resources/placid/requests** like so:

```
// resources/placid/requests/placeholder.yaml
host: https://jsonplaceholder.typicode.com
method: GET
path: posts/:id
auth: placeholder // See Authentication section
segments:
  id: 1
headers:
  accept: application/json
query:
  foo: bar
formParams:
  foo: bar
```

#### Authentication

[](#authentication)

You can define authorisation schemes to use and reuse on your requests. You define them in **resources/placid/auth** like so:

```
// resources/placid/auth/placeholder.yaml
headers:
  Authorization: Bearer :token
token: services.api.token
```

The above will send the token through the headers, you define your tokens in your config and reference as you would any Laravel config item.

If you need to send your access token through the query string, define your auth scheme like so:

```
// resources/placid/auth/placeholder.yaml
query:
  access_token: :token
token: services.api.token
```

The query string and headers will be merged with any that are already present on the request

Usage
-----

[](#usage)

To use this plugin in your templates, simply use these tags:

### Basic example

[](#basic-example)

```
{{ placid handle="placeholder" }}
  {{ response.data }}
    {{ title }}
  {{ /response.data }}
{{ /placid }}

```

### Full example

[](#full-example)

```
{{ placid host="https://jsonplaceholder.typicode.com" path=":part/:id" cache="60" query="foo:bar|bar:baz" segments="part:posts|id:1" headers="foo:bar" }}
  {{ response.data }}
    {{ title }}
  {{ /response.data }}
{{ /placid }}

```

Support,issues,feedback
-----------------------

[](#supportissuesfeedback)

If you want to leave feedback about this project, feel free to get in touch on [twitter](http://www.twitter.com/alecritson) if you experience any issues please just create a new issue here on the Repo

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Total

3

Last Release

1756d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/46bf54d2d231f28cc772f9b9c8c7e081f7fb95bbd73d3b6b8230b83658e94dde?d=identicon)[ritson](/maintainers/ritson)

---

Top Contributors

[![alecritson](https://avatars.githubusercontent.com/u/1488016?v=4)](https://github.com/alecritson "alecritson (46 commits)")

---

Tags

statamicstatamic-addonstatamic-v2statamic-v3

### Embed Badge

![Health badge](/badges/ritson-placid-statamic/health.svg)

```
[![Health](https://phpackages.com/badges/ritson-placid-statamic/health.svg)](https://phpackages.com/packages/ritson-placid-statamic)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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