rotl icon indicating copy to clipboard operation
rotl copied to clipboard

New bulk node_info and taxon_info api call options

Open snacktavish opened this issue 2 years ago • 2 comments

Hi! We wanted to let you know that we (@opentreeoflife) now have an, as yet undocumented, bulk node info call.

curl -X POST https://api.opentreeoflife.org/v3/tree_of_life/node_info -H "content-type:application/json" -d '{"node_ids":["mrcaott246ott3364","mrcaott22834ott532753","mrcaott252688ott489372"]} '

We (@bredelings) are developing a bulk taxon_info call as well. (as yet only on devapi, will be on production soon).

curl -X POST https://devapi.opentreeoflife.org/v3/taxonomy/taxon_info -d '{"ott_ids": [1,2,3,4,5]}'

Would be great if you could include in your upcoming release, as it will speed things up on user side, and use less resources on our side. Thanks,

snacktavish avatar Jun 13 '23 18:06 snacktavish

Thanks! I can add this in a future release. Are these the only 2 end-points that support bulk queries? How many nodes or taxa can be queried at once? Could you please ping me again once the taxon_info endpoint is in production?

fmichonneau avatar Jun 15 '23 09:06 fmichonneau

These are up on production now. You can query 10,000 nodes or taxa at once. If you have any feedback or find bugs, please let me know.

I only added a bulk-query version for these two endpoints. The motivation was that, looking at the server logs, we sometimes get bursts of taxon_info or node_info calls that could reasonably be condensed into a single call.

Are there any other calls were a bulk option might be helpful? For calls like "tree_of_life/mrca", I didn't add such an option because "mrca" can already receive a bunch of taxa in order to perform a single call. But if there were a use case, then we could talk about it.

bredelings avatar Jun 19 '23 20:06 bredelings