Skip to main content

Elsevier Developer Portal

Elsevier APIs Blog

elsapy: a Python library for api.elsevier.com

Many of the users of Elsevier's APIs are people who are not primarily programmers or software developers. Instead, they are researchers or information specialists who need programmatic access to Elsevier's content for a variety of reasons, and with widely varying levels of programming skills. Sometimes, the solutions they build are quite sophisticated; often, they cobble together some code to solve a specific need. But whatever the case, it's likely that many of them have gone through the mechanics of configuring and executing an HTTP request to the APIs, retrieving the response to that request, and parsing its content into some kind of data structure for further processing. This is a common sequence of operations for using any API and all major programming languages provide libraries that make it easier to implement those operations.

But for each API, the specifics of those operations are different, and it is not always easy to map those specifics to the methods and data structures of a language's standard libraries. That is also the case for Elsevier's APIs: there is a certain data model and design pattern that underlies the APIs, and there are ways to orchestrate calls to the APIs such that the data model can be traversed in an efficient, intuitive manner and used in your application.

To help clients do this, we've put together a Python module called elsapy. It contains a couple of classes that represent the most important bits of Scopus' data model, allowing clients to define 'documents' and 'authors' and 'affiliations' and get data for them from Elsevier's APIs. With the module, we also provide a blueprint configuration file that allows you to easily plug in your own APIkey, and an example program that demonstrates some important operations and that you can use as a starting point for your own code.

We have chosen Python because it seems to be the language of choice across many domains: it seems used as much for local scripting as for web development, and it's a relatively easy language to learn with high adoption amongst non-professional coders. Also, due to its readability, we hope it makes it easier to understand the data model behind our APIs, which might help you write a client in a different language.

The elsapy module is provided as-is; it's been put together in our spare time, outside of our regular responsibilities and as a by-product of solving some of our own problems. We can't guarantee that it will meet all your needs or that it won't cause any issues on your system - use it at your own risk. But we will try to keep it up-to-date as much as we can, are very open to collaboration, and are definitely interested in feedback.



Accelerate academic research using Scopus APIs

APIs story on Scopus blog

The recent addition new Academic Research use case and policy for Scopus APIs makes it easier for researchers affiliated with a Scopus subscribing institution to use Scopus data for academic research.



Reach for the stars: How one developer uses ScienceDirect APIs to achieve more for NASA

APIs story on ScienceDirect blog



Author-aid: Scopus Cited-by Counts API

Hi! My name is Victoria. I am a Product Manager at Elsevier responsible for ScienceDirect and Scopus APIs. This is my first blog post and it is a bit personal. My husband DJ is an Assistant Professor at Miami University, Oxford, Ohio. Apart from being a brilliant teacher, in order to meet university tenure requirements, he must also publish his research findings in high impact journals. Historically, the impact of individual articles, authors and journals is based on a single basic metric: citation counts.

Showcasing your research and accomplishments (i.e. citation counts) is one of the most important aspects in ensuring academic career progression. I would like to demonstrate how to add Scopus citation counts to your online CV or publication list. To do so, we will use Scopus Cited-by Counts API. You are not required to subscribe to Scopus in order to take advantage of the Scopus Cited-by Counts API - it is free to use as specified in the corresponding use case and policy.

Let's proceed with procurement of a brand new API key at Elsevier Developer Portal. While registering API key you are asked to provide a web site - please specify a web site that will be used to interact with Elsevier APIs. If you specified some other site, not to worry: you can login and modify the site URL at any time. You may ask - why do we ask that you use the actual site URL? The answer is: Elsevier APIs are W3C CORS compliant and support browser security policy for Cross-Origin requests. This feature enables Elsevier APIs content to be seamlessly integrated with your web site while maintaining compliance with W3C security standards and policies. In DJ's case, the publications page URL is http://www.djrao.com/publications.html, so we registered an API key with site http://www.djrao.com.
By default, the Scopus Cited-by Counts API is enabled for all newly registered API keys with a weekly limit of 20,000 API requests. For your reference, all default API key settings are available here.

Next, let us find out how Scopus Cited-by Counts API works by navigating to the "Explore" menu on the developer portal and selecting "Interactive Metadata APIs". Click on "Abstract_Citation_Count : Abstract Citation Count API", another click on /abstract/citation-count. You should see interactive interface as shown on the picture below.



The default API key and example document identifier are already pre-populated, the default response content type is set to text/html via HTTP request header. I suggest to add text/html in the "httpAccept" field to pass response content type via URL parameter httpAccept. This way the API request URL will be fully functional without the need to manipulate HTTP request headers. Now all you have to do is to click on the "Try it out!" button. After you click on the "Try it out!" button, the actual API request appears in the "Request URL" field as follows:

http://api.elsevier.com/content/abstract/citation-count?doi=10.1016%2FS0014-5793(01)03313-0&apiKey=7f59af901d2d86f78a1fd60c1bf9426a&httpAccept=text/html



The API response appears in the "Response Body" field as an image. Please note that the "Cited x times in Scopus" image has built-in hyperlink to the Scopus page listing all citing documents. The actual API response is the HTML snippet as shown below.

<a target="_blank" href="http://www.scopus.com/inward/citedby.url?partnerID=HzOxMe3b&scp=0037070197&origin=inward"><image src="http://api.elsevier.com/content/abstract/citation-count?eid=2-s2.0-0037070197&httpAccept=image%2Fjpeg&apiKey=7f59af901d2d86f78a1fd60c1bf9426a" border="0" alt="cited by count"/></a>
The link into Scopus is required for compliance with Scopus Cited-by API policy. If you chose to use another API response format or Scopus Search API to display Scopus citation counts, you will be responsible for "powered by Scopus" attribution and linking of the actual counts to Scopus page from your web site.

Now you have a fully functional Scopus Cited-by Counts API request example and it is time to customize it. First, replace the example API key with your own:

http://api.elsevier.com/content/abstract/citation-count?doi=10.1016%2FS0014-5793(01)03313-0&apiKey=MY_OWN_APIKEY&httpAccept=text/html
Next, collect your article identifiers. DOI is considered a universal article identifier and this is what we will use for retrieving Scopus cited-by counts. However, you may choose to use any identifier available or a combination of other info such as article title. The appropriate examples are shown in the interactive documentation for the Cited-by Counts API.

Now is the fun-most part: adding citation counts to the publications page. To do so we will start with creating API requests by replacing DOI string in the example below with the actual DOIs of the articles you want to add citation counts:

http://api.elsevier.com/content/abstract/citation-count?doi=ACTUAL_ARTICLE_DOI&apiKey=MY_OWN_APIKEY&httpAccept=text/html
I will start with DOI 10.1016/j.envsoft.2008.06.011, so my API request will look as follows:

http://api.elsevier.com/content/abstract/citation-count?doi=10.1016/j.envsoft.2008.06.011&apiKey=c7af0f4beab764ecf68568961c2a21ea&httpAccept=text/html
To embed the counts in the DJ's publications page, we will add HTML <object> tag to the publications.html file (yes, you will need to edit the html source file) as follows:

<object height="50" data="http://api.elsevier.com/content/abstract/citation-count?doi=10.1016/j.envsoft.2008.06.011&apiKey=c7af0f4beab764ecf68568961c2a21ea&httpAccept=text/html"></object>

Now, let us reload the publication page and marvel at the Cited-by Counts image next to the article info:



Repeat the process for all DOIs - and you are all set! From this point on any time someone cites your articles the counts will be updated automatically.


I hope you found this info useful and will be able to adopt it for your own blog, online CV or publication list.