PHPackages                             dpb587/ravelry-api - 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. dpb587/ravelry-api

AbandonedArchivedLibrary[API Development](/categories/api)

dpb587/ravelry-api
==================

A PHP library for interacting with the Ravelry API.

v0.1.0(12y ago)22421MITPHPPHP &gt;=5.4.0

Since May 29Pushed 8y ago1 watchersCompare

[ Source](https://github.com/dpb587/ravelry-api.php)[ Packagist](https://packagist.org/packages/dpb587/ravelry-api)[ Docs](https://github.com/dpb587/ravelry-api-php)[ RSS](/packages/dpb587-ravelry-api/feed)WikiDiscussions develop Synced 4w ago

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

A PHP library for interacting with the [Ravelry API](http://www.ravelry.com/api).

Consider this a functional prototype. This library's API may change. Not all the API calls have been tested.

*This project is not affiliated with [Ravelry](http://www.ravelry.com/).*

Getting Started
---------------

[](#getting-started)

The source code is located in [`./src`](./src) and dependencies are managed with [Composer](https://getcomposer.org).

### Download

[](#download)

For integration, it's easiest to require with [`composer`](https://getcomposer.org/)...

```
composer.phar require dpb587/ravelry-api=dev-master

```

For development, it's easiest to clone with [`git`](http://git-scm.com/)...

```
git clone https://github.com/dpb587/ravelry-api-php
cd ravelry-api-php
composer.phar install

```

### Authentication

[](#authentication)

There are two authentication methods for you to decide between. In both cases you can find the necessary keys from the **apps** tab of your [Ravelry Pro](https://www.ravelry.com/pro) account.

For [OAuth](http://oauth.net/), use an [`OauthTokenStorage`](./src/RavelryApi/Authentication/OauthTokenStorage) handler and include your access and secret key...

```
$auth = new RavelryApi\Authentication\OauthAuthentication(
    new RavelryApi\Authentication\OauthTokenStorage\FileTokenStorage(),
    $accessKey,
    $secretKey
);

```

For personal use with your own account, you can use your access and personal key...

```
$auth = new RavelryApi\Authentication\BasicAuthentication($accessKey, $personalKey);

```

### Usage

[](#usage)

Create a new `RavelryApi\Client`, including the authentication handler you're using...

```
$ravelry = new RavelryApi\Client($auth);

```

And now you can make API calls, using the returned result like an array...

```
# find the first message from the inbox
$id =
    $ravelry->messages->list([ 'folder' => 'inbox' ])
    ['messages'][0]['id'];

# load and show the message
$message =
    $ravelry->messages->show([ 'id' => $id ])
    ['message'];

echo $message['content_html'];
#> I&#8217;m a message from the API!

# then mark it as read
$ravelry->messages->markRead([ 'id' => $id ]);

```

Internally, the results are an object which provides some additional values...

```
get_class($message);
#= 'RavelryApi\\Model'

$message->toArray();
#= ['message'=>['sent_at'=>...]]

$message->getEtag();
#= '"18aa948e83e5e6b131d6b60998690fd5"'

$message->getStatusCode();
#= 200

$message->getStatusText();
#= 'OK'

```

Tests
-----

[](#tests)

The testing code is located in [`./test`](./test) and are run with [`phpunit`](http://phpunit.de/).

### Functional Tests

[](#functional-tests)

The functional tests will actually communicate with the Ravelry API to run through various API calls and validate the expected responses. You must configure a `RAVELRY_TEST_ACCESS_KEY` and `RAVELRY_TEST_PERSONAL_KEY` to use for authentication with the tests. All tests run as specifically as possible and avoid changing things that tests didn't create, however, it is testing so you should probably use a dedicated test account.

There is a `./test/cleanup.php` script which will clean up any objects left behind from failed tests.

References
----------

[](#references)

-  - Ravelry's API Documentation
-  - a CLI for the API (uses this library)

License
-------

[](#license)

[MIT License](./LICENSE)

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

4415d ago

### Community

Maintainers

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

---

Top Contributors

[![dpb587](https://avatars.githubusercontent.com/u/207601?v=4)](https://github.com/dpb587 "dpb587 (26 commits)")

---

Tags

apiravelry

### Embed Badge

![Health badge](/badges/dpb587-ravelry-api/health.svg)

```
[![Health](https://phpackages.com/badges/dpb587-ravelry-api/health.svg)](https://phpackages.com/packages/dpb587-ravelry-api)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[clicksend/clicksend-php

301.6M11](/packages/clicksend-clicksend-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

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