Aller au contenu

omnistate/nara Référence de l’API

Étage
Fournisseur · Omnistate
Version
1.x
Suite de conformité
branchée, CI non lue
Vérifié en réel
Son README ne le dit pas
Licence
MIT
composer require omnistate/nara:1.x-dev

Lue dans les fichiers PHP du paquet au commit 12ccf05abb98 : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.

Omnistate\Nara

  • Nara class

    The National Archives Catalog of the United States (NARA), through its Catalog API v2: the federal records described file by file, many of them by the name of the person they are about - pension application files, compiled military service records, draft registration cards, indexes to naturalization papers, Indian census cards, homestead certificates, deceased personnel files... and, for a good share, their pages scanned.

    9 methods · 2 constants

Omnistate\Nara

Nara class

final class Nara implements CivilRegistryInterface Nara.php:39

The National Archives Catalog of the United States (NARA), through its Catalog API v2: the federal records described file by file, many of them by the name of the person they are about - pension application files, compiled military service records, draft registration cards, indexes to naturalization papers, Indian census cards, homestead certificates, deceased personnel files... and, for a good share, their pages scanned.

It is a catalogue of federal archives, NOT civil registration: births, marriages and deaths are kept by the states and counties, and the Catalog holds none of them as such. Every record is therefore of the kind OTHER: a file that names the person, with its series, its record group and the reference room that holds it, and the links to its scanned pages at NARA (never copied). The Catalog dates a file by its series only: the span of the series is the record's period, not the date of an event.

A key is needed (header x-api-key; ask Catalog_API@nara.gov), 10,000 calls a month per key: past it, the key is blocked until the first of the next month. Without a valid key the API answers the Catalog's HTML page with a 200, which is read as unavailable.

const URL = 'https://catalog.archives.gov/api/v2'
const PAGE = 'https://catalog.archives.gov/id/'

Nara::__construct()

public function __construct(readonly HttpClientInterface $http, readonly ?string $apiKey = null, readonly float $timeout = 10, readonly string $url = self::URL)

Nara::name()

public function name(): string

Nara::countries()

public function countries(): array

Nara::kinds()

public function kinds(): array

Nara::period()

public function period(): ?Period

Nara::hasImages()

public function hasImages(): bool

Nara::supports()

public function supports(CivilQuery $query): bool
public function search(CivilQuery $query): array

Nara::find()

public function find(string $identifier): ?CivilRecord