PHPackages                             snapshot-site/php-sdk - 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. snapshot-site/php-sdk

ActiveLibrary[API Development](/categories/api)

snapshot-site/php-sdk
=====================

Official PHP SDK for the Snapshot Site API

v0.1.1(1w ago)00MITPHPPHP ^8.1CI passing

Since Mar 30Pushed 1w agoCompare

[ Source](https://github.com/snapshot-site/snapshot-site-php-sdk)[ Packagist](https://packagist.org/packages/snapshot-site/php-sdk)[ Docs](https://snapshot-site.com/api-docs)[ RSS](/packages/snapshot-site-php-sdk/feed)WikiDiscussions main Synced 4d ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

Snapshot Site PHP SDK
=====================

[](#snapshot-site-php-sdk)

[![Packagist](https://camo.githubusercontent.com/61a00488cc4ab40e440cb29cad7290ab552863e3e856c511d8daa601c9446108/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736e617073686f742d736974652f7068702d73646b2e737667)](https://packagist.org/packages/snapshot-site/php-sdk)[![PHP](https://camo.githubusercontent.com/092d545f529c0bc11f393035f40f9cced2c9db2a0d148532f4fc2aa5409dc992/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e312d3737374242342e737667)](https://www.php.net/)[![License](https://camo.githubusercontent.com/fd4a6806c72642ee5f70176dd6d5fe5746981aaec6a10747f0f0934ea7257a0a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f736e617073686f742d736974652f736e617073686f742d736974652d7068702d73646b2e7376673f63616368655365636f6e64733d333030)](https://github.com/snapshot-site/snapshot-site-php-sdk/blob/main/LICENSE)[![CI](https://github.com/snapshot-site/snapshot-site-php-sdk/actions/workflows/tests.yml/badge.svg)](https://github.com/snapshot-site/snapshot-site-php-sdk/actions/workflows/tests.yml)

Official PHP SDK for the Snapshot Site API.

Install
-------

[](#install)

```
composer require snapshot-site/php-sdk
```

Credentials
-----------

[](#credentials)

You need a Snapshot Site API key to use this SDK.

1. Sign up for a [Snapshot Site Console](https://console.snapshot-site.com/) account.
2. Create an API key on the [API Keys](https://console.snapshot-site.com/api-keys) page.

    [![Snapshot Site Console — API Keys](assets/console-apikeys.png)](assets/console-apikeys.png)
3. Pass it as the first argument to `new Client(...)`. Read it from the environment rather than hardcoding it: `new Client(getenv('SNAPSHOT_SITE_API_KEY'))`.
4. Leave `baseUrl` unset unless you're pointed at a self-hosted or staging instance; it defaults to `https://api.prod.ss.snapshot-site.com`. See [Custom base URL](#custom-base-url).

Compatibility
-------------

[](#compatibility)

Requires PHP 8.1 or later, with the `curl` and `json` extensions.

Usage
-----

[](#usage)

Not sure which options to use? Preview a capture and its parameters in the [Screenshot](https://console.snapshot-site.com/screenshot) console playground before wiring them into code.

[![Snapshot Site Console — Screenshot playground](assets/console-screenshot.png)](assets/console-screenshot.png)

```
