Examples

Notes about these examples:

  • All of the following examples use the parameter api_key=plos_api_test. This is key is for testing only! You will need to register for a PLoS API key and replace plos_api_test with your own PLoS API key.
  • See Using the Article-Level Metrics API for parameters that you can send to the API.
  • See PLoS Article-Level Metrics Sources for the different data sources that can be retrieved for each article.

Examples for Retrieving Single Articles

1. For article journal.pbio.0000012, return the article attributes in XML format:

alm.plos.org/articles/10.1371/journal.pbio.0000012.xml?api_key=plos_api_test

2. For article journal.pbio.0000012, return the data for all sources in XML format:

alm.plos.org/articles/10.1371/journal.pbio.0000012.xml?history=1&api_key=plos_api_test

3. For article journal.pone.0005723, return the data for all sources in CSV format:

alm.plos.org/articles/10.1371/journal.pone.0005723.csv?history=1&api_key=plos_api_test

4. For article journal.pbio.0000012, return PLoS usage statistics from source “counter” in XML format:

alm.plos.org/articles/10.1371/journal.pbio.0000012.xml?source=counter&events=1&api_key=plos_api_test

5. For article journal.pone.0000001, return PLoS usage statistics from source “pmc” in XML format:

alm.plos.org/articles/10.1371/journal.pone.0000001.xml?source=pmc&events=1&history=1&api_key=plos_api_test

6. For article journal.pbio.0000012, return the number of events and link to the Scopus landing page for the source “Scopus ” in XML format:

alm.plos.org/articles/10.1371/journal.pbio.0000012.xml?source=scopus&events=1&api_key=plos_api_test

7. For article journal.pbio.0000012, return all data for the source “CrossRef” in XML format:

alm.plos.org/articles/10.1371/journal.pbio.0000012.xml?source=crossref&history=1&api_key=plos_api_test

Examples for Retrieving Multiple Articles

The Article-Level Metrics API can be used to retrieve data for a subset of articles or all articles. Retrieving data for all articles aren’t intended for high-volume use and can take several seconds to execute. If these are the types of requests that you will be performing, please contact us at api@plos.org to discuss your options.

1. For all articles published in PLoS Biology, return PubMed Central citation counts for all articles with events, ordered by DOI, in XML format:

alm.plos.org/articles.xml?query=journal.pbio&cited=1&order=doi&api_key=plos_api_test

Note:This query returns the first 30 results. To get the next 30 results, add the page=# parameter. For example, to return the next 30 results:

alm.plos.org/articles.xml?query=journal.pbio&cited=1&order=doi&page=2&api_key=plos_api_test

Examples using Sources

For a list and description of sources available, see the Article-Level Metrics Sources.

1. For article journal.pbio.0000012, return the PLoS usage stats (source “counter”) in XML format:

alm.plos.org/articles/10.1371/journal.pbio.0000012.xml?source=counter&events=1&api_key=plos_api_test

2 For article journal.pbio.0000012, return the events for the source “crossref” in XML format:

alm.plos.org/articles/10.1371/journal.pbio.0000012.xml?source=crossref&events=1&api_key=plos_api_test

3. For article journal.pbio.0000012, return the citation URIs from source “pubmed” in CSV format:

alm.plos.org/articles/10.1371/journal.pbio.0000012.csv?source=pubmed&events=1&api_key=plos_api_test

4. For article journal.pbio.0000012, return the bookmarks from source “citeulike” in XML format:

alm.plos.org/articles/10.1371/journal.pbio.0000012.xml?source=citeulike&events=1&api_key=plos_api_test

JSON Request Example

1. For article journal.pbio.0000012, the JSON request alm.plos.org/articles/10.1371/journal.pbio.0000012.json?api_key=plos_api_test will return something like this:

{"article":"pub_med":"14551910","pub_med_central":"212692","doi":"10.1371/journal.pbio.0000012",
"events_count":687,"title":"Genome-Wide RNAi of C. elegans Using the Hypersensitive rrf-3 Strain Reveals Novel Gene Functions","published":"2003-10-13T00:00:00-07:00"}}

JSONP Request Example

1. For article journal.pbio.0000012, the JSONP request alm.plos.org/articles/10.1371/journal.pbio.0000012.json?callback=myparam&api_key=plos_api_test will return something like this:

myparam{"article":"pub_med":"14551910","pub_med_central":"212692","doi":"10.1371/journal.pbio.0000012",
"events_count":687,"title":"Genome-Wide RNAi of C. elegans Using the Hypersensitive rrf-3 Strain Reveals Novel Gene Functions","published":"2003-10-13T00:00:00-07:00"}}