Code Monkey home page Code Monkey logo

php-pubmed-api-wrapper's Introduction

PHP PubMed API Wrapper

Author: Asif Rahman
Demo: Example

Description

A standalone PHP class provides a wrapper around the PubMed API. Fully documented with working examples.

  • Access PubMed through a proxy server programatically
  • Limit the total number of search results
  • Pagination splits search results amoung multiple pages
  • Optional exact search term matching
  • Cache search results as JSON formatted text files
  • Load search results from cache
  • Control lifetime of cache results

See the script in action at the Soterix Medical publications browser.

Documentation

To get started:

include('PubMedAPI.php');
$search_term = 'search query';
$PubMedAPI = new PubMedAPI();
$results = $PubMedAPI->query($search_term);

The query() method returns an array of search results or an empty array if no matches were found.

Interaction with the PubMed API is accomplished in two steps. Given a search term, the first query returns a list of PMIDs. The second query returns the metadata of each article. query() takes three arguments, the first is the search term string (this can also be the PMID if already known), the second is a boolean that returns a compact result if TRUE, and the third is an optional callback function to manipulate the results.

Returns the pmid, volume, issue, year, month, pages, issn, journal, journalabbrev, title, abstract, affiliation, authors, articleid, keywords of each article.

Refer to the class file for more documentation.

Copyright and License

This script is free software, available under the terms of the BSD-style open source license reproduced below, or, at your option, under the GNU General Public License version 2 or a later version.

PHP PubMed API Wrapper
Copyright © 2012 Asif Rahman
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name "PHP PubMedAPI Wrapper" nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright owner or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.

php-pubmed-api-wrapper's People

Contributors

asifr avatar auehara avatar hwsamuel avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.