PHPackages                             thomas-institut/apm-publication-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. thomas-institut/apm-publication-api

ActiveLibrary[API Development](/categories/api)

thomas-institut/apm-publication-api
===================================

Definition and client for APM's publication API

0.0.11(1w ago)027↑50%GPL-3.0-or-laterPHPPHP ^8.3

Since May 22Pushed 4d agoCompare

[ Source](https://github.com/thomas-institut/apm-publication-api)[ Packagist](https://packagist.org/packages/thomas-institut/apm-publication-api)[ RSS](/packages/thomas-institut-apm-publication-api/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (3)Dependencies (16)Versions (10)Used By (0)

APM Publication API
===================

[](#apm-publication-api)

This repo provides the official definition of APM's publication API in PHP and a client implementation.

> This repo is still **alpha**. DO NOT assume any information or code here will stay as it is right now.

API Description
---------------

[](#api-description)

The Publication API is how APM publishes its data to external clients, most notably APE. APM users determine which resources they want to make available to specific clients, and the clients call the API to get a listing of these resources and to get the data.

There are two calls:

- `api/publication/list`: returns a StandardApiResponse with an array of PublicationListing objects
- `api/publication/{id}/get`: returns a StandardApiResponse with the data for the given id.

A publication listing consists of general information about a publication:

- type: for example, `'Transcription'`
- id
- versionTimeString
- title
- description

The data for a publication contains this same information together with all required resource's data according to the publication type.

Publication Types
-----------------

[](#publication-types)

### Text

[](#text)

A text string without any formatting.

### Transcription

[](#transcription)

The transcription of a document, normally a manuscript. It consists of an array of pages, each one with a number of columns, with each column containing a transcription. A column transcription consists of an array of elements (main text, marginal additions, etc.). Each element in turn consists of an array of transcription items: simple text, abbreviations, additions, etc.

### Edition

[](#edition)

*TBD*

Api Client
----------

[](#api-client)

The `PublicationApiClient` requires a PSR-18 HTTP Client and a PSR-17 Request Factory. Below is an example of how to use it with [Guzzle](https://github.com/guzzle/guzzle).

### Installation

[](#installation)

If you don't have an HTTP client yet, you can install Guzzle:

```
composer require guzzlehttp/guzzle
```

### Usage Example

[](#usage-example)

```
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\HttpFactory;
use ThomasInstitut\ApmPublicationApi\Client\PublicationApiClient;

// 1. Create the PSR-18 HTTP Client (Guzzle 7+ implements this)
$httpClient = new Client();

// 2. Create the PSR-17 Request Factory (Guzzle PSR-7 provides this)
$requestFactory = new HttpFactory();

// 3. Define the base URL of the APM API (without /publication)
$baseUrl = 'https://apm.example.com/api';

// 4. Initialize the PublicationApiClient
$apiClient = new PublicationApiClient(
    $httpClient,
    $requestFactory,
    $baseUrl
);

// Optional: you can also provide a logger and enable debug mode
// $apiClient = new PublicationApiClient($httpClient, $requestFactory, $baseUrl, $logger, true);

// Example usage:
try {
    $listResponse = $apiClient->list();
    foreach ($listResponse->publications as $listing) {
        echo $listing->title . PHP_EOL;
    }
} catch (\ThomasInstitut\ApmPublicationApi\Client\PublicationApiClientException $e) {
    // Handle transport or server errors
}
```

### Key Components

[](#key-components)

- **`GuzzleHttp\Client`**: Implements `Psr\Http\Client\ClientInterface`.
- **`GuzzleHttp\Psr7\HttpFactory`**: Implements `Psr\Http\Message\RequestFactoryInterface`.
- **`baseUrl`**: The base URL for the APM API (e.g., `https://example.com/api`). The client automatically appends `/publication/list` or `/publication/{id}/get` to this URL.
- **`logger`**: (Optional) A `Psr\Log\LoggerInterface` to log API requests and responses. Defaults to `NullLogger`.
- **`debug`**: (Optional) Set to `true` to enable detailed debug logging. Defaults to `false`.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance99

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity44

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

Total

9

Last Release

8d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17843226?v=4)[Rafael Nájera](/maintainers/rafaelnajera)[@rafaelnajera](https://github.com/rafaelnajera)

---

Top Contributors

[![rafaelnajera](https://avatars.githubusercontent.com/u/17843226?v=4)](https://github.com/rafaelnajera "rafaelnajera (40 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Type Coverage Yes

### Embed Badge

![Health badge](/badges/thomas-institut-apm-publication-api/health.svg)

```
[![Health](https://phpackages.com/badges/thomas-institut-apm-publication-api/health.svg)](https://phpackages.com/packages/thomas-institut-apm-publication-api)
```

###  Alternatives

[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k11](/packages/tempest-framework)[cakephp/cakephp

The CakePHP framework

8.8k19.1M1.7k](/packages/cakephp-cakephp)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

84735.1k](/packages/flow-php-flow)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6941.5M395](/packages/drupal-core-recommended)[mollie/mollie-api-php

Mollie API client library for PHP. Mollie is a European Payment Service provider and offers international payment methods such as Mastercard, VISA, American Express and PayPal, and local payment methods such as iDEAL, Bancontact, SOFORT Banking, SEPA direct debit, Belfius Direct Net, KBC Payment Button and various gift cards such as Podiumcadeaukaart and fashioncheque.

60415.4M74](/packages/mollie-mollie-api-php)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.7k371.6k5](/packages/theodo-group-llphant)

PHPackages © 2026

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