Skip to main content


Is there a #RustLang crate that allows me to query package metadata from either #crates.io or preferably the local #cargo package index easily? My usual search strings didn't reveal anything useful. Use case is that I want to filter crates in my dependency tree by specific categories that can be found in the metadata. Of course it would probably be easy to implement that functionality by myself, but if somebody else already did that, why not reuse it…
@decathorpe Thanks for the pointer. Looks like that one doesn't expose the categories, and neither does its parent project https://crates.io/crates/crates-index but through references in the documentation I found https://docs.rs/crates_io_api which exposes that information. Performs direct requests to crates.io though so I need to be careful to cache the relevant information instead of requesting it repeatedly from the web api.

It might be helpful to take a look at how cargo-information works:

https://crates.io/crates/cargo-information

This entry was edited (8 months ago)
@mo8it That one looks really interesting, I'll be using it for interactive queries, but it seems to be missing the categories from the output. Sadly it also doesn't appear to have any machine-readable output or library for direct use as dependency of my own crate.
@mo8it Oh, misread what you wrote on top. Of course, in order to draw inspiration when I would like to write my own implementation that would be helpful. πŸ˜‰
⇧