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.

Examples


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 www.scopus.com

<link rel="stylesheet" type="text/css" href="http://www.scopus.com/scsearchapi/stylesheets/css_scapi_list_hilight.css">
<script type="text/javascript" src="http://www.scopus.com/scsearchapi/scripts/scapi.jsp">

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();
varSearchObj.setSearch(document.scapiForm.searchString.value);
scapi.search(varSearchObj);
}
<!-- SECTION 4 : Setting defaults -->
<script type="text/javascript"> scapi.setDeveloperID("--INSERT YOUR DEVELOPER ID HERE--");
scapi.setCallback(callback);
</script>



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

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

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






Returned SCAPI Content:



None.

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

5 comments:

Unknown said...

Any update on the next post? i'm part of a group looking to implement something similar, as part of a user workspace - to search online resources like scopous, and get back hits, then offer to save abstracts, or give a download link if possible.

Thanks for the first post - scopus itself doesn't even provide decent examples of use of it's API!

Fulup said...

Thanks for the encouragement. There is another post on its way (next week, I hope).

Anonymous said...

How to get developer id form scopus i have registered my account and i got a mail for confirmation but that mail is not containing with developer id, can you please suggest me a way to get developer id

Fulup said...

Hi Manisha,
It might be best to ask the Scopus Helpdesk about getting a Developer ID. You could try the 'Live Chat' feature on their website to make contact.

Anonymous said...

Thanks for your reply i have tried with that but i got mail to wait for 1 or 2 working days