votemike / internet-archive-api
Library for Internet Archive API
Requires
- php: ^7.1
- guzzlehttp/guzzle: ^6.3
Requires (Dev)
- phpunit/phpunit: ^6.3
This package is not auto-updated.
Last update: 2024-11-10 05:19:36 UTC
README
A library to call archive.org's search API. Please use GitHub to raise any issues and suggest any improvements.
Install
composer require votemike/internetarchiveapi
Usage
Create a new instance of Api
passing in a Guzzle Client with the base_uri set as 'https://archive.org/'.
$client = new Client(['base_uri' => 'https://archive.org/']);
$api = new Api($client);
For a list of items, call $api->search()
with your query. For information about the valid query strings, see the advancedsearch page
Optional you can page in extra arguments:
- Page - By default this library paginates 50 items at a time. Get additional pages by changing this page.
- Rows - The number of items you would like returned as part of each call
- Fields - By default, all fields are returned. Limit them by passing through an array of fields as mentioned on advancedsearch page
- Sort - Send through an array of sort parameters
If you would like a specific item populated with extra metadata, pass an Item
object in to $api->getMetaDataForItem()
.
A second parameter can be added to only return sub-items of the metadata
Credits
License
The MIT License (MIT). Please see License File for more information.