NLeSC / litstudy

LitStudy: Using the power of Python to automate scientific literature analysis from the comfort of a Jupyter notebook
https://nlesc.github.io/litstudy/
Apache License 2.0
155 stars 50 forks source link

Scopus400Error: Exceeds the maximum number allowed for the service level. #91

Open asynchronousani opened 5 months ago

asynchronousani commented 5 months ago

This is the full error snippet. Please help me fix this.

Scopus400Error                            Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_11056\1525091348.py in <cell line: 4>()
      2 logging.getLogger().setLevel(logging.CRITICAL)
      3 
----> 4 docs_scopus, docs_notfound = litstudy.refine_scopus(docs_remaining)
      5 
      6 print(len(docs_scopus), 'papers found on Scopus')

~\anaconda3\lib\site-packages\litstudy\sources\scopus.py in refine_scopus(docs, search_title)
    246         return None
    247 
--> 248     return docs._refine_docs(callback)

~\anaconda3\lib\site-packages\litstudy\types.py in _refine_docs(self, callback)
     51 
     52         for i, doc in enumerate(progress_bar(self.docs)):
---> 53             new_doc = callback(doc)
     54 
     55             if new_doc is not None:

~\anaconda3\lib\site-packages\litstudy\sources\scopus.py in callback(doc)
    234         if len(title) > 10 and search_title:
    235             query = f"TITLE({title})"
--> 236             response = ScopusSearch(query, view="STANDARD", download=False)
    237             nresults = response.get_results_size()
    238 

~\anaconda3\lib\site-packages\pybliometrics\scopus\scopus_search.py in __init__(self, query, refresh, view, verbose, download, integrity_fields, integrity_action, subscriber, **kwds)
    204         self._query = query
    205         self._view = view
--> 206         Search.__init__(self, query=query, api='ScopusSearch', count=count,
    207                         cursor=subscriber, download=download,
    208                         verbose=verbose, **kwds)

~\anaconda3\lib\site-packages\pybliometrics\scopus\superclasses\search.py in __init__(self, query, api, count, cursor, download, verbose, **kwds)
     60 
     61         # Init
---> 62         Base.__init__(self, params=params, url=URLS[api], download=download,
     63                       api=api, verbose=verbose)
     64 

~\anaconda3\lib\site-packages\pybliometrics\scopus\superclasses\base.py in __init__(self, params, url, api, download, verbose, *args, **kwds)
     64                 self._json = loads(fname.read_text())
     65         else:
---> 66             resp = get_content(url, api, params, *args, **kwds)
     67             header = resp.headers
     68 

~\anaconda3\lib\site-packages\pybliometrics\scopus\utils\get_content.py in get_content(url, api, params, **kwds)
    114             except:
    115                 reason = ""
--> 116         raise errors[resp.status_code](reason)
    117     except KeyError:
    118         resp.raise_for_status()

Scopus400Error: Exceeds the maximum number allowed for the service level

arianna-bienati commented 1 month ago

Hi there! I was trying out your package in a tutorial on Colab with some non-nerdy friends... here the Colab notebook: https://colab.research.google.com/drive/1ZW9BVpQ2cTFta5d8YhTiAkZuo7VfPBSU?usp=drive_link

However, when trying to use the scopus API the "Scopus400Error: Exceeds the maximum number allowed for the service level" pops up. When re-implementing the thing on a local machine the error disappears. Any ideas why is it so?