1. Go to this page and download the library: Download hedii/zotero-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hedii / zotero-api example snippets
// '/path/to/vendor/autoload.php';
// instantiate
$api = new Hedii\ZoteroApi\ZoteroApi('your_zotero_api_key_here');
// _DIR__ . '/vendor/autoload.php';
use Hedii\ZoteroApi\ZoteroApi;
// instantiate zotero api
$api = new ZoteroApi('xxxxxxxxxxxxxxxxxxx');
// get the item 'ABCDEF' in the user 12345 library
$response = $api->user(12345)
->items('ABCDEF')
->send();
$item = $response->getBody();
// get 12 first top items in the group 12345 library and
// sort them by descendant modification date.
$response = $api->group(12345)
->items()
->top()
->limit(12)
->sortBy('dateModified')
->direction('desc')
->send();
$items = $response->getBody();
// search for tags matching 'a name' in the user 12345 library
$response = $api->user(12345)
->tags('a name')
->send();
$tags = $response->getBody();
// get all user 12345 collections
$response = $api->user(12345)
->collections()
->send();
$collections = $response->getBody();
// get top items within the collection 'ABCDEF' in the group 98765 library
$response = $api->group(98765)
->collections('ABCDEF')
->items()
->top()
->send();
$topItems = $response->getBody();
// get an array of all items keys with their versions
$response = $api->user(12345)
->items()
->versions();
$itemKeysWithVersions = $response->getBody();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.