PHPackages                             bouiboui/pokket-php - 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. bouiboui/pokket-php

AbandonedArchivedLibrary[API Development](/categories/api)

bouiboui/pokket-php
===================

PHP SDK to access the Pocket API

0.2(9y ago)6521[2 PRs](https://github.com/bouiboui/pokket-php/pulls)UnlicensePHPPHP ^5.6|^7.0

Since Apr 16Pushed 5y agoCompare

[ Source](https://github.com/bouiboui/pokket-php)[ Packagist](https://packagist.org/packages/bouiboui/pokket-php)[ RSS](/packages/bouiboui-pokket-php/feed)WikiDiscussions master Synced today

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

pokket-php
==========

[](#pokket-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ef2acf9cc76151ec4361a8993ba2662a5c684b421741541249d3481627a1fd08/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626f7569626f75692f706f6b6b65742d7068702e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bouiboui/pokket-php)[![Software License](https://camo.githubusercontent.com/e6fd1430520a41e5861f1fdf2ac70cde32bdfe292a6f2ddb83681339575c7948/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d556e6c6963656e73652d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![SensioLabsInsight](https://camo.githubusercontent.com/3ad29e6bbe3672987a1e053a39d3354efb66dca89e9c158a5fe3d1de1830f29e/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f39643633376164322d376330362d346538632d613262322d3765336261653365316164342f6d696e692e706e67)](https://insight.sensiolabs.com/projects/9d637ad2-7c06-4e8c-a2b2-7e3bae3e1ad4)

PHP SDK to access the [Pocket](https://getpocket.com) [API](https://getpocket.com/developer/docs/overview) (v3, currently).

*Wait, why don't you call it* Pocket API PHP SDK *or something similar then?*

[It's actually forbidden](https://getpocket.com/developer/docs/branding) because business™.

I'm a big fan of Pocket and I have some ideas I want to try out thanks to its API. The other librairies I found on Github were either too small, too big, or not documented enough for my needs. [duellsy/pockpack](https://github.com/duellsy/pockpack) seems very nicely done, it's a shame I found it too late.

Install
-------

[](#install)

```
$ composer require bouiboui/pokket-php
```

Usage
-----

[](#usage)

*Note: For a complete example: [example/index.php](https://github.com/bouiboui/pokket-php/blob/master/example/index.php)*

Initialize Pokket with your [Consumer key](https://getpocket.com/developer/apps/new) and Redirect URI (classic OAuth)

```
$pokket = new PokketAPI(
    '1234-abcd1234abcd1234abcd1234', // Consumer key
    'https://yourdomain.tld/' // Redirect uri
);
```

First we ask the user to login

```
if (!array_key_exists('pokket.token.request', $_SESSION)) {
    $pokket->requestUserAccess($_SESSION['pokket.token.request'] = $pokket->getRequestToken());
}
```

Then we fetch an Access token

```
if (!array_key_exists('pokket.token.access', $_SESSION)) {
    $_SESSION['pokket.token.access'] = $pokket->getAccessToken($_SESSION['pokket.token.request']);
}
$pokket->setAccessToken($_SESSION['pokket.token.access']);
```

Now we can get down to business™

```
// Retrieve user posts
$retrieveQuery = RetrieveQuery::build()
    ->withState(RetrieveQuery::STATE_UNREAD)
    ->withSort(RetrieveQuery::SORT_TITLE)
    ->withDetailType(RetrieveQuery::DETAIL_TYPE_SIMPLE)
    ->withCount(100);

$posts = $pokket->retrieve($retrieveQuery);

// Display results
header('Content-type: application/json;Charset=utf8');
echo json_encode($posts);
```

The code above returns (minus the *pretty format*):

```
{
	"status": 1,
	"complete": 1,
	"list": {
		"2093856": {
			"item_id": "2093856",
			"resolved_id": "2093856",
			"given_url": "http://www.csie.ntu.edu.tw/~cjlin/libsvm/",
			"given_title": "",
			"favorite": "0",
			"status": "0",
			"time_added": "1390842458",
			"time_updated": "1390927561",
			"time_read": "0",
			"time_favorited": "0",
			"sort_id": 74,
			"resolved_title": "LIBSVM -- A Library for Support Vector Machines",
			"resolved_url": "http://www.csie.ntu.edu.tw/~cjlin/libsvm/",
			"excerpt": "LIBSVM -- A Library for Support Vector Machines Chih-Chung Chang and Chih-Jen Lin  Version 3.19 released on October 27, 2014. It conducts some minor fixes.LIBSVM tools provides many extensions of LIBSVM. Please check it if you need some functions not supported in LIBSVM.",
			"is_article": "0",
			"is_index": "1",
			"has_video": "0",
			"has_image": "1",
			"word_count": "961"
		},
		" ... and 99 more elements ... "
	},
	"error": null,
	"search_meta": {
		"search_type": "normal"
	},
	"since": 1460836019
}
```

Credits
-------

[](#credits)

- bouiboui — [Github](https://github.com/bouiboui) [Twitter](https://twitter.com/j_____________n) [Website](http://cod3.net)
- [All contributors](https://github.com/bouiboui/tissue/graphs/contributors)

License
-------

[](#license)

Unlicense. Public domain, basically. Please treat it kindly. See [License File](LICENSE) for more information.

This project uses the following open source projects

- [guzzle/guzzle](https://github.com/guzzle/guzzle) by [Michael Dowling](https://github.com/mtdowling) — [License](https://github.com/guzzle/guzzle/blob/master/LICENSE).

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Total

2

Last Release

3577d ago

PHP version history (2 changes)v0.1PHP ^5.6

0.2PHP ^5.6|^7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3274103?v=4)[Julien](/maintainers/bouiboui)[@bouiboui](https://github.com/bouiboui)

---

Top Contributors

[![bouiboui](https://avatars.githubusercontent.com/u/3274103?v=4)](https://github.com/bouiboui "bouiboui (36 commits)")

---

Tags

phppocketsdkapisdkpocket

### Embed Badge

![Health badge](/badges/bouiboui-pokket-php/health.svg)

```
[![Health](https://phpackages.com/badges/bouiboui-pokket-php/health.svg)](https://phpackages.com/packages/bouiboui-pokket-php)
```

###  Alternatives

[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[resend/resend-php

Resend PHP library.

596.2M35](/packages/resend-resend-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.5M11](/packages/checkout-checkout-sdk-php)[mozex/anthropic-laravel

Laravel integration for the Anthropic API: facade, config publishing, install command, testing fakes, messages, streaming, tool use, thinking, and batches.

72287.1k1](/packages/mozex-anthropic-laravel)[clicksend/clicksend-php

301.6M11](/packages/clicksend-clicksend-php)

PHPackages © 2026

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