PHPackages                             survos/nara-php-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. survos/nara-php-api

ActiveLibrary[API Development](/categories/api)

survos/nara-php-api
===================

PHP client for NARA's Catalog API v2

1.0.0(3mo ago)06↓90.9%MITPHPPHP ^8.4CI failing

Since Mar 31Pushed 3mo agoCompare

[ Source](https://github.com/survos/nara-php-api)[ Packagist](https://packagist.org/packages/survos/nara-php-api)[ GitHub Sponsors](https://github.com/kbond)[ RSS](/packages/survos-nara-php-api/feed)WikiDiscussions main Synced 4w ago

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

NARA Catalog PHP API
====================

[](#nara-catalog-php-api)

A PHP client for the [National Archives Catalog API v2](https://catalog.archives.gov/api/v2/).

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

[](#installation)

```
composer require survos/nara-php-api
```

This library requires Symfony HTTP Client (included as a dependency).

Quick Start
-----------

[](#quick-start)

```
use Survos\Nara\ClientFactory;

$client = ClientFactory::create($yourApiKey);

// Search records (raw array response)
$results = $client->search(['q' => 'constitution']);
echo $results['body']['hits']['total']['value'];

// Search with typed DTOs
$results = $client->searchWithDtos(['q' => 'constitution']);
foreach ($results as $result) {
    echo $result->record->title;
    echo $result->record->naId;
}

// Search transcriptions
$transcriptions = $client->transcriptionsSearchWithDtos(['q' => 'constitution']);
foreach ($transcriptions as $t) {
    echo $t->contribution;
}

// Get single record by NA ID
$record = $client->getRecordByNaId(1667751);
echo $record->title;
```

API Key
-------

[](#api-key)

To get an API key, email [Catalog\_API@nara.gov](mailto:Catalog_API@nara.gov).

Demo
----

[](#demo)

A CLI demo is included:

```
# Using environment variable
export NARA_API_KEY="your-key"
php bin/search.php search "constitution"

# Using --api-key option
php bin/search.php search "constitution" --api-key=your-key
php bin/search.php search "presidents" --limit=5

# Lookup by NA ID
php bin/search.php search 1667751

# Verbose output
php bin/search.php search "constitution" -vvv --limit=1
```

Bulk Data
---------

[](#bulk-data)

For large-scale data access, NARA provides bulk downloads on AWS S3:

```
# Download full descriptions (87 GB)
aws s3 cp s3://nara-national-archives-catalog/zip/nac_export_descriptions_2025-04-08.zip ./ --no-sign-request

# Sync specific record group
aws s3 sync s3://nara-national-archives-catalog/descriptions/record-groups/rg_011/ ./rg011/ --no-sign-request
```

See [NARA Developer Docs](https://www.archives.gov/developer/national-archives-catalog-dataset) for more.

License
-------

[](#license)

MIT License - see [LICENSE](LICENSE.md) file.

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance82

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

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

91d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/21b39551f92ed4143772c622f9e571589c5a72c96ab3c53fe67489ce0d83e806?d=identicon)[tacman1123](/maintainers/tacman1123)

---

Top Contributors

[![tacman](https://avatars.githubusercontent.com/u/619585?v=4)](https://github.com/tacman "tacman (2 commits)")

---

Tags

apiclientsdkswaggeropenapicatalogarchivesnara

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/survos-nara-php-api/health.svg)

```
[![Health](https://phpackages.com/badges/survos-nara-php-api/health.svg)](https://phpackages.com/packages/survos-nara-php-api)
```

###  Alternatives

[jolicode/slack-php-api

An up to date PHP client for Slack's API

2554.6M13](/packages/jolicode-slack-php-api)[deepseek-php/deepseek-php-client

deepseek PHP client is a robust and community-driven PHP client library for seamless integration with the Deepseek API, offering efficient access to advanced AI and data processing capabilities.

46784.5k5](/packages/deepseek-php-deepseek-php-client)[api-platform/openapi

Models to build and serialize an OpenAPI specification.

374.2M77](/packages/api-platform-openapi)[api-platform/json-schema

Generate a JSON Schema from a PHP class

294.3M59](/packages/api-platform-json-schema)[jolicode/harvest-php-api

An up to date PHP client for Harvest's API

2265.4k](/packages/jolicode-harvest-php-api)

PHPackages © 2026

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