ropensci / rotl

Interface to Open Tree of Life API
https://docs.ropensci.org/rotl
Other
39 stars 18 forks source link

New bulk node_info and taxon_info api call options #145

Open snacktavish opened 1 year ago

snacktavish commented 1 year ago

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,

fmichonneau commented 1 year ago

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?

bredelings commented 1 year ago

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.