PHPackages                             dcarbone/amber-hat - 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. dcarbone/amber-hat

AbandonedArchivedLibrary[API Development](/categories/api)

dcarbone/amber-hat
==================

Lib designed to help PHP apps consume from REDCap's API

0.4.2(10y ago)029[1 issues](https://github.com/dcarbone/amber-hat/issues)GPL-2.0PHPPHP &gt;=5.3.3

Since Dec 9Pushed 10y ago1 watchersCompare

[ Source](https://github.com/dcarbone/amber-hat)[ Packagist](https://packagist.org/packages/dcarbone/amber-hat)[ Docs](https://github.com/dcarbone/amber-hat)[ RSS](/packages/dcarbone-amber-hat/feed)WikiDiscussions master Synced 4w ago

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

amber-hat
=========

[](#amber-hat)

A REDCap Client library written in PHP

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

[](#installation)

This lib requires the use of [Composer](https://getcomposer.org/).

```
"require": {
    "dcarbone/amber-hat": "0.4.*"
}
```

Client Creation
---------------

[](#client-creation)

To get started, you will need 3 things:

1. Full URL to your REDCap installation's API endpoint (typically something like "")
2. A REDCap API token
3. A Temp directory on the server capable of handling potentially large files

Once you have those, you can immediately start exporting data for the project the token gives you access to:

```
use DCarbone\AmberHat\AmberHatClient;

$client = new AmberHatClient(
    'https://redcap.mygreatinstitution.edu/api/',
    'mygreattoken',
    'my-cache-dir');
```

Available Data Export methods:
------------------------------

[](#available-data-export-methods)

- [Arms](documentation/ARMS.md)
- [Events](documentation/EVENTS.md)
- [Metadata](documentation/METADATA.md)
- [Export Field Names](documentation/EXPORTFIELDNAMES.md)
- [Project Information](documentation/PROJECTINFORMATION.md)
- [Form Events](documentation/FORMEVENTS.md)
- [Users](documentation/USER.md)
- [Instruments (forms)](documentation/INSTRUMENT.md)
- [Records](documentation/RECORDS.md)
- [Record Field File](documentation/FILE.md)
- [Version](documentation/VERSION.md)

### Basic Export Data Object Structure

[](#basic-export-data-object-structure)

With the exception of [Records](documentation/RECORDS.md), [Project Information](documentation/PROJECTINFORMATION.md), and [Record Field File](documentation/FILE.md), all export methods return a collection class which extends [AbstractItemCollection](src/AbstractItemCollection.php). This collection class implements the following interfaces:

- [ArrayAccess](http://php.net/manual/en/class.arrayaccess.php)
- [Countable](http://php.net/manual/en/class.countable.php)
- [Iterator](http://php.net/manual/en/class.iterator.php)
- [Serializable](http://php.net/manual/en/class.serializable.php)

The objects present in the collection are all classes which implement the [ItemInterface](src/ItemInterface.php) interface. The interface requires concrete classes to implement the following:

- [ArrayAccess](http://php.net/manual/en/class.arrayaccess.php)
- [Iterator](http://php.net/manual/en/class.iterator.php)
- [Serializable](http://php.net/manual/en/class.serializable.php)
- [JsonSerializable](http://php.net/manual/en/class.jsonserializable.php)

*NOTE*: For PHP 5.3 users, I have created a [JsonSerializableCompatible](src/JsonSerializableCompatible.php)interface, however you must execute [json\_encode](http://php.net/manual/en/function.json-encode.php)on the result of the implemented method call, rather than on the object itself.

Ex:

```
$json_string = json_encode($itemObject->jsonSerialize());
```

Available Data Import methods:
------------------------------

[](#available-data-import-methods)

At the moment, no import methods are available. However, this feature is being worked on and will hopefully come to fruition soon.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Total

6

Last Release

3826d ago

Major Versions

0.4.2 → 1.x-dev2016-01-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/385c0c0eae1b51f1e81ee464ff6bfb3cce32589ac252ca68cc3a8aec2e3ada14?d=identicon)[dcarbone](/maintainers/dcarbone)

---

Top Contributors

[![dcarbone](https://avatars.githubusercontent.com/u/1392439?v=4)](https://github.com/dcarbone "dcarbone (33 commits)")

---

Tags

redcapred cap

### Embed Badge

![Health badge](/badges/dcarbone-amber-hat/health.svg)

```
[![Health](https://phpackages.com/badges/dcarbone-amber-hat/health.svg)](https://phpackages.com/packages/dcarbone-amber-hat)
```

###  Alternatives

[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[corsinvest/cv4pve-api-php

Corsinvest Proxmox VE Client API PHP

811.4M](/packages/corsinvest-cv4pve-api-php)[tinify/tinify

PHP client for the Tinify API. Tinify compresses your images intelligently. Read more at https://tinify.com.

2515.4M76](/packages/tinify-tinify)[zzantares/proxmoxve

A simple PHP 5.5+ Proxmox API client.

17662.8k5](/packages/zzantares-proxmoxve)[snowcap/emarsys

Emarsys RestFull API client

381.2M](/packages/snowcap-emarsys)[shortpixel/shortpixel-php

ShortPixel PHP SDK. Read more at https://shortpixel.com/api-tools

36542.7k11](/packages/shortpixel-shortpixel-php)

PHPackages © 2026

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