pubmedR icon indicating copy to clipboard operation
pubmedR copied to clipboard

error http 400 when only one document found

Open mgerault opened this issue 3 years ago • 1 comments

Hello,

When I only found one document with a query, pmApiRequest doesn't work. In fact, entrez_fetch throw me this error : Erreur : HTTP failure: 400

Cannot retrieve history data: OUT OF RANGE. Parameter retstart=1 + 1 is greater than number of records available in history. History includes 1 IDs.

My code : query <- "Mediator of RNA polymerase II transcription subunit 19*[Title/Abstract] AND OS*[Title/Abstract]"

res <- pmQueryTotalCount(query = query, api_key = NULL) res$total_count

D <- pmApiRequest(query = query, limit = res$total_count, api_key = NULL)

For me, the problem comes from the s variable which is set to one (because of "Parameter retstart=1 + 1 is greater than number of records available in history"), is it possible to set it to 0 instead ?

Thanks in advance

Sorry if this isn't the place to request that, I'm quite new to github.

mgerault avatar May 14 '21 10:05 mgerault

I'm experiencing the same problem.

leandrorodriguess avatar Feb 16 '24 01:02 leandrorodriguess