Search This Blog

Tuesday, January 27, 2009

Using the Scopus API - 1. Getting started.

Scopus is one of the most important abstract and indexing databases available to people in my University. Usually, people are happy to log in and search within the Scopus interface, but there are possible uses for including content from Scopus within a web site. Scopus announced that an API was available back in March 2008. There was some interest expressed at the time, but there is not much in the way of examples and developer notes on how to use it. I am trying to work out for myself some of the possibilities of how it can be used.


How to get started.

Before you can do anything with the Scopus API, you need to register for an API key. The form asks for basic information about who you are (name, email address), the web site on which you are developing and a password. You will be sent a Developer Key by email. You are also asked to agree that you have read and understand the Scopus Registered User Agreement and agree to be bound by all of its terms and conditions. Rather than just tick the box, you should read the agreement to make sure you are not trying to build something that breaks the agreement.
Once registered you can access 'My Scopus API' where you can get reminders of lost developer keys. If you are developing on one machine before making your code live on another one, you will need to register for each site. Once you have registered, it is possible to register for other sites where you want to use the API.

Placing the code on your site

There is a code example on the Scopus API documentation page.
Stepping though this example we find:
1. Files on

<link rel="stylesheet" type="text/css" href="">
<script type="text/javascript" src="">

2. Two sections of javascript

<script type="text/javascript">
<!-- SECTION 2 : Call back -->
callback = function(){ document.scapiForm.searchButton.disabled = false; }
<!-- SECTION 3 : Running Search -->
runSearch = function(){
document.scapiForm.searchButton.disabled = true;
var varSearchObj = new searchObj();
<!-- SECTION 4 : Setting defaults -->
<script type="text/javascript"> scapi.setDeveloperID("--INSERT YOUR DEVELOPER ID HERE--");

There is also a form to add to the body of your web page.

<h2>Search Form:</h2>
<form name="scapiForm" onsubmit="return false">
<input type="text" name="searchString"/>
<button onClick="runSearch()" name="searchButton"/>SEARCH</button>
<h2>Returned SCAPI Content:</h2>
<div id="scapi">

The form should look and act like this, at least to start with

Returned SCAPI Content:


In the next post on this topic, I will look at how to configure the search form and the results that are returned.