pybliometrics
pybliometrics copied to clipboard
pybliometrics.scopus.exception.Scopus401Error: The requestor is not authorized to access the requested view or fields of the resource
Hello, I have a API Key and it works with some command and doesn't work with others. For example:
s = ScopusSearch('ISSN(1532-849X) AND PUBYEAR IS 2010',subscriber=False) print(s.results)
Works well and I've got the results.
But:
s = ScopusSearch('ISSN(1532-849X) AND PUBYEAR IS 2010') print(s.results)
Doesn't work and got the following error:
pybliometrics.scopus.exception.Scopus401Error: The requestor is not authorized to access the requested view or fields of the resource
For this one I also couldn't get the results:
ab = AbstractRetrieval("2-s2.0-85068268027",subscriber=False) print(ab)
Same error:
pybliometrics.scopus.exception.Scopus401Error: The requestor is not authorized to access the requested view or fields of the resource
My config.ini file looks this:
[Directories] AbstractRetrieval = C:\Users\AI/.scopus/abstract_retrieval AffiliationRetrieval = C:\Users\AI/.scopus/affiliation_retrieval AffiliationSearch = C:\Users\AI/.scopus/affiliation_search AuthorRetrieval = C:\Users\AI/.scopus/author_retrieval AuthorSearch = C:\Users\AI/.scopus/author_search CitationOverview = C:\Users\AI/.scopus/citation_overview ScopusSearch = C:\Users\AI/.scopus/scopus_search SerialSearch = C:\Users\AI/.scopus/serial_search SerialTitle = C:\Users\AI/.scopus/serial_title PlumXMetrics = C:\Users\AI/.scopus/plumx
[Authentication] APIKey = XXX
For AbstractRetrieval both subscriber=True and subscriber=False didn't work. Any help would be appreciated. Thanks.
Thanks for the elaborated report!
- When you use
subscriber=FalseinScopusSearch(), you're telling the Scopus Search API to send unrestricted but limited access. People whose institutions don't pay Scopus should use this. But it always works, for anybody, like in your first example. The default value forsubscriberis True, meaning by defaultScopusSearch()asks for the restricted full view. Apparently your institution doesn't pay for Scopus, or you're outside the network that grants access to Scopus, which is why your second call fails. - The Scopus Abstract Retrieval API doesn't offer an unrestricted limited access for non-subscribers. Therefore the
subscriberkeyword inAbstractRetrieval()doesn't take effect. Your third call therefore fails for the same reason your second call fails.
Thanks for your complete reply. Actually, I am in my university network and our university subscribes scopus. But we need to sign in with university SSO and they redirect us to https://www-scopus-com.eproxy.lib.hku.hk and then we will access to the content . I am wondering if there is any way to add username/pass besides API key in config.ini.
I've already sent an email to scopus to generate a institution key. I will check with institution key and update you. Thanks.
Yes, the InstToken should solve those problems. But as far as I know there can be pricing options according to which users can access scopus.com but not the Scopus APIs.
There is no username and/or pass option in the config.ini. According to the API docs it does not accept those things.
Yes, the InstToken should solve those problems. But as far as I know there can be pricing options according to which users can access scopus.com but not the Scopus APIs.
There is no username and/or pass option in the config.ini. According to the API docs it does not accept those things.
Hello!
I also have the same issue. I would like to use AuthorRetrieval , but it didn't work with 401ERROR.
My university has access to Scopus, but I am currently not at the university and cannot access the network. Also, I emailed Scopus to ask for an InstToken and have had no response.
Could I ask is there any other way that I can use AuthorRetrieval?
No there isn't.
You have three options:
- Get the InstToken
- Go to your university
- Use VPN and eventually set a proxy in the configuration file
No there isn't.
You have three options:
- Get the InstToken
- Go to your university
- Use VPN and eventually set a proxy in the configuration file
Thanks for your reply. I have been able to connect to the university network and can run the example of AuthorRetrieval successfully:
from pybliometrics.scopus import AuthorRetrieval
au = AuthorRetrieval(7004212771)
But, when I change the Scopus ID, like this:
from pybliometrics.scopus import AuthorRetrieval
au = AuthorRetrieval(7005251283)
The run results in Scopus401Error again:
Scopus401Error: The requestor is not authorized to access the requested view or fields of the resource
I am confused about this issue because I thought I had obtained authorization. Any help would be appreciated!
That's odd. Indeed, both should work. Is your configuration file correctly specified (https://pybliometrics.readthedocs.io/en/stable/configuration.html)? Does any other class work?
That's odd. Indeed, both should work. Is your configuration file correctly specified (https://pybliometrics.readthedocs.io/en/stable/configuration.html)? Does any other class work?
Thanks for your reply firstly.
My configuration file is correct like this:
[Directories] AbstractRetrieval = /Users/elizabeth/.scopus/abstract_retrieval AffiliationRetrieval = /Users/elizabeth/.scopus/affiliation_retrieval AffiliationSearch = /Users/elizabeth/.scopus/affiliation_search AuthorRetrieval = /Users/elizabeth/.scopus/author_retrieval AuthorSearch = /Users/elizabeth/.scopus/author_search CitationOverview = /Users/elizabeth/.scopus/citation_overview ScopusSearch = /Users/elizabeth/.scopus/scopus_search SerialSearch = /Users/elizabeth/.scopus/serial_search SerialTitle = /Users/elizabeth/.scopus/serial_title PlumXMetrics = /Users/elizabeth/.scopus/plumx SubjectClassifications = /Users/elizabeth/.scopus/subject_classification
[Authentication] APIKey = XXXX
Since I'm in the university network, I guess I don't need an InstToken.
I tested other examples of class and they didn't work except for the AuthorRetrieval.
I also created a new APIKey to do the same test and still only the example of AuthorRetrieval works. If I change the ScopusID or test other class examples, it comes up with Scopus401Error:
Scopus401Error: The requestor is not authorized to access the requested view or fields of the resource
I really don't know what the problem is. Any help would be appreciated!
When working via a university's VPN, sometimes one needs to define proxies. For example the Technical University Munich has to do this. Maybe try this! Can't tell which proxy you would need however.
When working via a university's VPN, sometimes one needs to define proxies. For example the Technical University Munich has to do this. Maybe try this! Can't tell which proxy you would need however.
I got your point! But I am not working via a VPN actually to remote connect the university network. I go to my university's library to use the network directly. So all above problem is base on this situation. Also, I try to set a proxy but it shows a bug like this:
RemoteDisconnected: Remote end closed connection without response
I guess I don't need a proxy since I am not using remote connection. What do you think?
Thank you for your help!
I don't know the exact specifics, but there's been similar questions before: #155 seems the most elaborated one. Is this similar for you?
BTW: AFAIK there are license agreements whereby access to scopus.com is granted but not the API.
This - literally - makes the research paper and pybibliometrics library completely useless. Read the paper, installed the github package because pip3 could not find it, and this is the only output.
So, you may want to update your README on github to provide real, working examples that Scopus allows.
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/judge/src/temp/venv/lib/python3.8/site-packages/pybliometrics/scopus/abstract_retrieval.py", line 703, in __init__ Retrieval.__init__(self, identifier=identifier, id_type=id_type, File "/home/judge/src/temp/venv/lib/python3.8/site-packages/pybliometrics/scopus/superclasses/retrieval.py", line 48, in __init__ Base.__init__(self, params=params, url=url, api=api) File "/home/judge/src/temp/venv/lib/python3.8/site-packages/pybliometrics/scopus/superclasses/base.py", line 59, in __init__ resp = get_content(url, api, params, *args, **kwds) File "/home/judge/src/temp/venv/lib/python3.8/site-packages/pybliometrics/scopus/utils/get_content.py", line 110, in get_content raise errors[resp.status_code](reason) pybliometrics.scopus.exception.Scopus401Error: The requestor is not authorized to access the requested view or fields of the resource
You, @joej , may want to tone down and read https://pybliometrics.readthedocs.io/en/stable/access.html instead. If you cannot access pybliometrics, there's a reason, and most of the time it's because your institution doesn't provide you direct access to the Scopus API.
You're also the first person to report pip install pybliometrics doesn't work - you sure you don't have a typo?