rest-api-doc icon indicating copy to clipboard operation
rest-api-doc copied to clipboard

Endpoint for batch queries

Open duetosymmetry opened this issue 5 years ago • 4 comments
trafficstars

I think it would be useful if there was a (POST) endpoint, e.g. /api/batch, where several queries could be batched together. Similar to how the page BiblioTools: Generating Your Bibliography allows one to get batch bibtex responses from a list of keys, this should be possible through an API endpoint.

duetosymmetry avatar Jun 19 '20 14:06 duetosymmetry

We are currently porting the bibliography generation tools to the new platform, so we could expose its API once it's done. Would that work for you or do you have something more general in mind?

michamos avatar Jun 19 '20 14:06 michamos

That could possibly work for the use case I had in mind, but I was thinking more generally. For example, the tool filltex makes queries to INSPIRE, one for each bibkey. With a batch endpoint, all of those queries could be combined into one request.

duetosymmetry avatar Jun 19 '20 14:06 duetosymmetry

Note that you can already get results for several queries by using (query1) OR (query2) OR (query3) etc., instead of doing those queries separately. This only works if you don't care which queries caused a given record to appear in the result or can independently figure it out, but that seems to be the case for this class of tools.

We'll keep your suggestion in mind for future improvements to the API, but it probably won't be happening very soon as the current priority is to add all missing features to the new website so we can switch off the old one.

michamos avatar Jun 19 '20 14:06 michamos

That is a useful suggestion, thanks @michamos. I was just writing up a tool last night (ads2inspire) where I needed to keep track of which result came from which query. It should be possible with an OR query and some extra post-processing, but it would be simpler with a batch query approach. I'll stay tuned!

duetosymmetry avatar Jun 19 '20 14:06 duetosymmetry