pybliometrics-dev / pybliometrics

Python-based API-Wrapper to access Scopus
https://pybliometrics.readthedocs.io/en/stable/
Other
407 stars 127 forks source link

Scopus403Error on CitationOverview #281

Closed syleeknu closed 1 year ago

syleeknu commented 1 year ago

Hi, I have Scopus dev api keys and created confing so i can see config.ini files with api keys in my directory. print(config['Authentication']['APIKey']) also shows my api keys correctly. However, when i instantiate CitationOverview Class, i got this error

Scopus403Error                            Traceback (most recent call last)
Input In [10], in <cell line: 4>()
      2 from pybliometrics.scopus import CitationOverview
      3 identifier = ["85068268027"]
----> 4 co = CitationOverview(identifier, start=2019, end=2021)

File ~\anaconda3\envs\ds\lib\site-packages\pybliometrics\scopus\abstract_citation.py:275, in CitationOverview.__init__(self, identifier, start, end, id_type, eid, refresh, citation, **kwds)
    273 kwds.update({id_type: identifier})
    274 stem = md5("_".join(identifier).encode('utf8')).hexdigest()
--> 275 Retrieval.__init__(self, stem, api='CitationOverview', date=date,
    276                    citation=citation, **kwds)
    277 self._data = self._json['abstract-citations-response']
    279 # citeInfoMatrix

File ~\anaconda3\envs\ds\lib\site-packages\pybliometrics\scopus\superclasses\retrieval.py:48, in Retrieval.__init__(self, identifier, api, id_type, **kwds)
     46 # Parse file contents
     47 params = {'view': self._view, **kwds}
---> 48 Base.__init__(self, params=params, url=url, api=api)

File ~\anaconda3\envs\ds\lib\site-packages\pybliometrics\scopus\superclasses\base.py:59, in Base.__init__(self, params, url, api, download, verbose, *args, **kwds)
     57         self._json = loads(fname.read_text())
     58 else:
---> 59     resp = get_content(url, api, params, *args, **kwds)
     60     header = resp.headers
     61     if search_request:
     62         # Get number of results

File ~\anaconda3\envs\ds\lib\site-packages\pybliometrics\scopus\utils\get_content.py:111, in get_content(url, api, params, **kwds)
    109         except:
    110             reason = ""
--> 111     raise errors[resp.status_code](reason)
    112 except KeyError:
    113     resp.raise_for_status()

Scopus403Error: Requestor configuration settings insufficient for access to this resource.

My api keys work fine with other applications Any suggestions?

Environ: Windows, py39

Michael-E-Rose commented 1 year ago

Please see the second and third sentence in the documention for this class:

Your API Key needs to be approved by Elsevier manually. Please contact Scopus to do so.