PHPackages                             3ft9/dpla - 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. 3ft9/dpla

AbandonedArchivedLibrary[API Development](/categories/api)

3ft9/dpla
=========

Provides access to the Digital Public Library of America's API.

1.0.8(13y ago)8941PHP

Since May 26Pushed 4y ago1 watchersCompare

[ Source](https://github.com/3ft9/php-dpla)[ Packagist](https://packagist.org/packages/3ft9/dpla)[ RSS](/packages/3ft9-dpla/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (2)Used By (0)

PHP library for accessing the Digital Public Library of America API
===================================================================

[](#php-library-for-accessing-the-digital-public-library-of-america-api)

This is a simple library for accessing the [DPLA search API](http://dp.la/info/developers/).

Update on 2022-06-08: I've had an email notifying me that there have been breaking changes to the API and I can no longer state that it will work. Since I no longer use this code I won't be updating it but I'll be happy to accept pull requests.

Basic usage
-----------

[](#basic-usage)

To get started you simply need to require the main DPLA class and create an instance of it, passing in your API key.

```
require '/path/to/tfn/dpla.php';
$dpla = new \TFN\DPLA('your api key');
```

Using this object you can then create a search query. The query object supports chaining if you wish to use it. This example runs a simple search for anything mentioning pizza and gets the first page of ten results.

```
$res = $dpla->createSearchQuery()->forText('pizza')->withPaging(1, 10)->execute();
```

As well as generic text you can also search within specific fields. This example will match anything with "pizza" in the title.

```
$res = $dpla->createSearchQuery()->withTitle('pizza')->withPaging(1, 10)->execute();
```

See searchquery.php for full details of what's supported.

The execute() method will return a results object which has a number of convenient methods for accessing parts of the search results.

```
// Get the total number of documents that matched the search query.
$total_count = $res->getTotalCount();

// Get the page details that this results object represents.
$page = $res->getPageNumber();
$per_page = $res->getPerPage();

// Get an array of the documents in this results object.
$docs = $res->getDocuments();
```

It also provides convenience methods for getting the next and previous pages of results.

```
$prev_page_res = $res->getPrevPage();
$next_page_res = $res->getNextPage();
```

You can also get the query objects for the current, previous and next pages.

```
$current_query = $res->getSearchQuery();
$prev_page_query = $res->getPrevPageSearchQuery();
$next_page_query = $res->getNextPageSearchQuery();
```

License
-------

[](#license)

This code is being put into the public domain so please use it in whatever way you need. Attribution is encouraged and welcomed but not required.

Contributing
------------

[](#contributing)

We welcome contributions in the form of pull requests.

Who are we?
-----------

[](#who-are-we)

This code was developed and is maintained by [Stuart Dallas](http://stut.net/) at [3ft9 Ltd](http://3ft9.com/).

The original version was heavily based on [William Karavites' Java wrapper](https://github.com/willkara/DplaJavaWrapper).

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

4783d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/18305691?v=4)[3ft9](/maintainers/3ft9)[@3ft9](https://github.com/3ft9)

---

Top Contributors

[![stut](https://avatars.githubusercontent.com/u/53352?v=4)](https://github.com/stut "stut (1 commits)")

### Embed Badge

![Health badge](/badges/3ft9-dpla/health.svg)

```
[![Health](https://phpackages.com/badges/3ft9-dpla/health.svg)](https://phpackages.com/packages/3ft9-dpla)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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