mikone/pubmed

Wrapper API for the NCBI PubMed EFetch and ESummary Utilities developed at Ambry Genetics and made public for use by the community. My personalization include GuzzleHTTP client e the use of new api in json format. Include also a speed increase and a pagination controller.

v0.2 2020-03-26 18:28 UTC

This package is auto-updated.

Last update: 2024-04-27 22:56:41 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

DEMO: https://pubmed-api.herokuapp.com/

This library allows you to access the research of scientific articles published on Pubmed. It does this in a completely transparent way, normalizing the use of the different APIs and the response objects to the Pubmed APIs

See Pubmed API Documentation for PubmedAPI

Requirements

Installation

composer require mikone/pubmed

Usage

Search by Term and return how many articles there are, and their PMIDs

$api = new PubMed\Term();
$api->setReturnStart(10); // set first returned articles, defaults to 0, helpful in case of pagination
$api->setReturnMax(100); // set max returned articles, defaults to 10
$articles = $api->query('CFTR');
print_r($articles);

Search by Term with options array

$api = new PubMed\Term();
$api->setReturnStart(10); // set first returned articles, defaults to 0, helpful in case of pagination
$api->setReturnMax(100); // set max returned articles, defaults to 10
$articles = $api_->query('CFTR', $params);
print_r($articles);

Search Arcticle by PMID

$api = new PubMed\PubMedId();
$article = $api->query(15221447);
print_r($article);

Options array

The option array is an associative array

Option name value Description
articles true / false / null if true return the articles in search
summary true / false / null if true return only the summary of articles
page number / null if is set return paginated results

Example:

options['articles'] = true;

or 

$params = {'articles' => true, 'summary' => 'true', 'page' => 2};

Changelog

Please see CHANGELOG for more information what has changed recently.

Credits

The library has been forked by that of tmpjr/pubmed to allow the various types of bees that pubmed provides, to be performed in a completely transparent way.

License

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