Addon by Alec Ritson

Placid Main Screenshot

Consume REST services in your templates


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


Require the addon via composer

composer require ritson/placid-statamic


  • 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 for more info
  • path (string) : Add your own custom path, see paths for details
  • auth (string) : Handle for the auth scheme to use

Saved requests

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

// resources/placid/requests/placeholder.yaml
method: GET
path: posts/:id
auth: placeholder // See Authentication section
  id: 1
  accept: application/json
  foo: bar
  foo: bar


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
  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
  access_token: :token
token: services.api.token

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


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

Basic example

{{ placid handle="placeholder" }}
  {{ }}
    <h1>{{ title }}</h1>
  {{ / }}
{{ /placid }}

Full example

{{ placid host="" path=":part/:id" cache="60" query="foo:bar|bar:baz" segments="part:posts|id:1" headers="foo:bar" }}
  {{ }}
    <h1>{{ title }}</h1>
  {{ / }}
{{ /placid }}


If you want to leave feedback about this project, feel free to get in touch on twitter if you experience any issues please just create a new issue here on the Repo