colada/europeana

A client implementation of the Europeana API

1.0.1 2017-10-18 12:55 UTC

This package is not auto-updated.

Last update: 2024-04-07 06:30:33 UTC


README

Latest Version Software License Build Status Total Downloads

A PHP client library for the Europeana Portal

This PHP library provides a highly abstract client implementation of the Europeana REST API. It allows your PHP application to query and retrieve the Europeana datasets which are published via the main Europeana Portal in a highly abstracted, developer friendly fashion.

What is Europeana?

Europeana is an internet portal that acts as an interface to books, paintings, films, museum objects and archival records that have been digitised throughout Europe. More then 2.000 institutions across Europe have contributed. These range from large names such as the Rijksmuseum, the British Library or the Louvre to regional archives and local museums.

Install

Via Composer

$ composer require colada/europeana

Usage

API Key

You will need an API key before you can connect to the API endpoint. You can register an account an obtain a key at the Europeana Labs website.

Basic example

Perform a basic search query:

$apiKey = "myRegisteredKey";
$payload = new Colada\Europeana\Payload\SearchPayload();
$payload->addQuery("Mona Lisa");

try
{
    $client = new Guzzle\Client()
    $apiClient = new Colada\Europeana\Transport\ApiClient($apiKey, $client);

    $payloadResponse = $apiClient->send($payload);

    $items = $payloadResponse->getItems();
    foreach ($items as $item) {
        $item->getTitle();
        $item->getType();
    }

} catch (new Colada\Europeana\Exception\EuropeanaException $e) {
    // Process the exception
}

Features

  • API calls are modelled as a Payload -> Transport -> Response class representation.
  • The response is deserialized using the JMS Serializer library into first class citizen PHP objects.
  • Highly abstracted, loose coupled components for easy reuse in your own applications.

Documentation

Currently these API calls are entirely of partially implemented:

Action API call Status
Search  search.json Incomplete
Record record.json Incomplete
Dataset  dataset/[datasetId].json Complete
Provider provider/[providerId].json Complete
Suggestions suggestions.json Complete
Dataset (by provider) provider/[providerId]/datasets.json Complete

If you have any particular questions regarding the operation of the API, please refer to the Europeana API Google Group.

Testing

$ phpunit

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related, please email matthias@colada.be instead of using the issue tracker.

Credits

This package is heavily inspired upon the Slack API library by Cas Leentfaar. Parts of the Slack API code where reused and adapted under the MIT License terms.

License

The MIT License (MIT). Please see License File for more information.