pybliometrics icon indicating copy to clipboard operation
pybliometrics copied to clipboard

Author Search counts doubling?

Open jbarbosa29 opened this issue 7 years ago • 5 comments

I'm making a Python script to get info about the author country. I think the API might have a strange behaviour that is: each time an AuthorSearch is made, e.g., s1 = AuthorSearch('AU-ID(' + str(au_id) + ')', refresh=False), it counts as 2 in the 5k limit that Scopus imposes to this type of query.

Anyone with this behaviour?

jbarbosa29 avatar Jan 05 '19 14:01 jbarbosa29

Yes, that's on purpose: Super class search first gets the count of how many results there will be in total: https://github.com/scopus-api/scopus/blob/master/scopus/classes/search.py#L78

One could change the behavior to make the first run return results and the number of total results.

Michael-E-Rose avatar Jan 06 '19 21:01 Michael-E-Rose

Thanks.

jbarbosa29 avatar Jan 08 '19 15:01 jbarbosa29

Your issue was a welcomed opportunity to review that piece of code. Now there are no unnecessary queries just to get the number of results - the total number of results can be used from the first query.

You only need to update scopus from the repo. It's not on pip yet.

Michael-E-Rose avatar Jan 08 '19 16:01 Michael-E-Rose

I'm currently using AuthorSearch for the same reason, and although this issue is marked as closed, I am still having the same problem. Each AuthorSearch counts as 2 from the API key quota.

Here are the results I get when I run the code:

s.get_key_remaining_quota()
# '4828'

s = AuthorSearch(f'AUTHLAST({surname}) AND AUTHFIRST({name}) AND {sa_list}')

s.get_key_remaining_quota()
# '4826'

Is this issue fixed or do I need to do something differently? Thanks in advance!

Oz-like-the-Wizard avatar Jul 30 '22 17:07 Oz-like-the-Wizard

You're right @Oz-like-the-Wizard , we didn't solve the problem. I found the problem (I didn't design a while loop properly) and will fix this week.

Thanks for bringing this up again!

Michael-E-Rose avatar Aug 15 '22 20:08 Michael-E-Rose

This should have fixed it once and for all :)

Michael-E-Rose avatar Aug 29 '22 14:08 Michael-E-Rose

Thank you @Michael-E-Rose for the response and your work!

Oz-like-the-Wizard avatar Aug 29 '22 14:08 Oz-like-the-Wizard