Fetching article citation counts from Web of Science

  1. Sign up for the Thomson Reuters Links Article Match Retrieval Service, providing the IP address of the machine that will be calling the service. Note that this IP address has to be already authorised for access to Web of Science.
  2. Use the code below to query the service for information on articles citing a particular article, using the DOI as an identifier.
<?php
$dois = array('10.1038/nature04924', '10.1038/nature04923');
$query = array();
foreach ($dois as $doi)
  $query[] = sprintf('<map name="%s"><val name="doi">%s</val></map>', htmlspecialchars($doi), htmlspecialchars($doi));
$request = sprintf('<?xml version="1.0" encoding="UTF-8" ?>
<request xmlns="http://www.isinet.com/xrpc41">
  <fn name="LinksAMR.retrieve">
    <list>
      <!-- authentication -->
      <map><!-- leave this empty to use IP address for authentication --></map>
      <!-- what to to return -->
      <map>
        <list name="WOS">
          <val>timesCited</val>
          <val>doi</val>
          <val>sourceURL</val>
          <val>citingArticlesURL</val>
          <val>relatedRecordsURL</val>
        </list>
      </map>
      <!-- query -->
      <map>%s</map>
    </list>
  </fn>
</request>
', implode("\n", $query));
$context = array('http' => array ('method'=> 'POST', 'content' => $request, 'header' => 'Content-Type: text/xml'));
$response = file_get_contents('https://ws.isiknowledge.com/esti/xrpc', FALSE, stream_context_create($context));
$xml = simplexml_load_string($response);
$xml->registerXPathNamespace('t', 'http://www.isinet.com/xrpc41');
$errors = $xml->xpath("t:fn/t:error");
if (!empty($errors))
  exit((string) current($errors));
$results = array();
foreach ($xml->xpath("t:fn/t:map/t:map/t:map[@name='WOS']") as $item){
  $result = array();
  foreach ($item->val as $value)
    $result[(string) $value['name']] = (string) $value;  
  $results[$result['doi']] = $result;
}
  
print_r($results);

Which produces output like this:

    [10.1038/nature04924] => Array
        (
            [citingArticlesURL] => http://gateway.isiknowledge.com/gateway/Gateway.cgi?GWVersion=2&SrcApp=PARTNER_APP&SrcAuth=LinksAMR&KeyUT=000238979700043&DestLinkType=CitingArticles&DestApp=ALL_WOS&UsrCustomerID=59e483fb086408d0f6f7edc9be340623
            [relatedRecordsURL] => http://gateway.isiknowledge.com/gateway/Gateway.cgi?GWVersion=2&SrcApp=PARTNER_APP&SrcAuth=LinksAMR&KeyUT=000238979700043&DestLinkType=RelatedRecords&DestApp=ALL_WOS&UsrCustomerID=59e483fb086408d0f6f7edc9be340623
            [doi] => 10.1038/nature04924
            [timesCited] => 22
            [sourceURL] => http://gateway.isiknowledge.com/gateway/Gateway.cgi?GWVersion=2&SrcApp=PARTNER_APP&SrcAuth=LinksAMR&KeyUT=000238979700043&DestLinkType=FullRecord&DestApp=ALL_WOS&UsrCustomerID=59e483fb086408d0f6f7edc9be340623
        )
    [10.1038/nature04923] => Array
        (
            [citingArticlesURL] => http://gateway.isiknowledge.com/gateway/Gateway.cgi?GWVersion=2&SrcApp=PARTNER_APP&SrcAuth=LinksAMR&KeyUT=000239278900043&DestLinkType=CitingArticles&DestApp=ALL_WOS&UsrCustomerID=59e483fb086408d0f6f7edc9be340623
            [relatedRecordsURL] => http://gateway.isiknowledge.com/gateway/Gateway.cgi?GWVersion=2&SrcApp=PARTNER_APP&SrcAuth=LinksAMR&KeyUT=000239278900043&DestLinkType=RelatedRecords&DestApp=ALL_WOS&UsrCustomerID=59e483fb086408d0f6f7edc9be340623
            [doi] => 10.1038/nature04923
            [timesCited] => 59
            [sourceURL] => http://gateway.isiknowledge.com/gateway/Gateway.cgi?GWVersion=2&SrcApp=PARTNER_APP&SrcAuth=LinksAMR&KeyUT=000239278900043&DestLinkType=FullRecord&DestApp=ALL_WOS&UsrCustomerID=59e483fb086408d0f6f7edc9be340623
        )

Information for up to 50 articles can be fetched in one request.