88use Scopus \Exception \XmlException ;
99use Scopus \Response \Abstracts ;
1010use Scopus \Response \Author ;
11+ use Scopus \Response \CitationCount ;
1112use Scopus \Response \SearchResults ;
1213use Scopus \Response \AbstractCitations ;
1314use Scopus \Util \XmlUtil ;
@@ -20,6 +21,7 @@ class ScopusApi
2021 const AFFILIATION_URI = 'https://api.elsevier.com/content/affiliation/affiliation_id/ ' ;
2122 const SEARCH_AUTHOR_URI = 'https://api.elsevier.com/content/search/author ' ;
2223 const CITATION_OVERVIEW_URI = 'https://api.elsevier.com/content/abstract/citations ' ;
24+ const CITATION_COUNT_URI = 'https://api.elsevier.com/content/abstract/citation-count ' ;
2325 const TIMEOUT = 40.0 ;
2426
2527 protected $ apiKey ;
@@ -68,7 +70,7 @@ private function query($query)
6870 /**
6971 * @param string $uri
7072 * @param array $options
71- * @return array|Abstracts|Author|SearchResults
73+ * @return array|Abstracts|Author|SearchResults|CitationCount[]
7274 * @throws Exception
7375 */
7476 private function retrieve ($ uri , array $ options = [])
@@ -112,6 +114,12 @@ private function retrieve($uri, array $options = [])
112114 }, $ json ['author-retrieval-response-list ' ]['author-retrieval-response ' ]);
113115 case 'abstract-citations-response ' :
114116 return new AbstractCitations ($ json ['abstract-citations-response ' ]);
117+ case 'citation-count-response ' :
118+ $ document = $ json ['citation-count-response ' ]['document ' ];
119+
120+ return array_map (function ($ data ) {
121+ return new CitationCount ($ data );
122+ }, isset ($ document ['@status ' ]) ? [$ document ] : $ document );
115123 default :
116124 throw new Exception (sprintf ('Unsupported response type: "%s" for "%s" ' , $ type , $ uri ));
117125 }
@@ -190,6 +198,31 @@ public function overviewCitation($documentId, String $startYear = null, String $
190198 return $ responses ;
191199 }
192200
201+ /**
202+ * @param string|string[] $scopusId
203+ * @param array $options
204+ *
205+ * @return CitationCount[]
206+ *
207+ * @throws Exception
208+ */
209+ public function retrieveCitationCount ($ scopusId , array $ options = [])
210+ {
211+ if (is_array ($ scopusId )) {
212+ $ scopusId = implode (', ' , $ scopusId );
213+ }
214+
215+ if (count (explode (', ' , $ scopusId )) > 25 ) {
216+ throw new Exception ("The maximum number of 25 document id's exceeded! " );
217+ }
218+
219+ $ options ['scopus_id ' ] = $ scopusId ;
220+
221+ return $ this ->retrieve (self ::CITATION_COUNT_URI , [
222+ 'query ' => $ options
223+ ]);
224+ }
225+
193226 /**
194227 * @param $scopusId
195228 * @param array $options
0 commit comments