Author Search counts doubling?
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?
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.
Thanks.
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.
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!
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!
This should have fixed it once and for all :)
Thank you @Michael-E-Rose for the response and your work!