Closed CNGaoWenbo closed 4 years ago
@CNGaoWenbo
This is the way the Crossref API works when using sample.
the sample endpoint retrieve a random corpus of data. The results are not ranked.
If you want to have the first 10 records you should remove sample() and iterate in the results until you have the desired number of records.
ex:
count = 0
for item in works.query(bibliographic=key_words):
count +=1
if count >= 10:
break
Are results ranked in a row? If I search the same key words in different number in 'sample()', how can I get different results in the second time?
For example, works.query(bibliographic=key_words).sample(10), get 10 results. Then works.query(bibliographic=key_words).sample(20), how to get new 20 results instead 10 old and 10 new.
Thanks!