docs.rs builds & hosts the rustdoc
JSON output.
This structured version of the documentation can be used for inspecting the docs and types of the crate in a programmatic way.
The JSON file you're downloading might have been built with an older version of rustdoc
so you might have to check the format_version
attribute to determine how to parse the structure.
The rustdoc-types
crate helps with this.
We started building rustdoc JSON on 2025-05-23. So any release before that won't have a download available until our rebuilds reached that release.
The download URLs can be generic or specific, depending on what you need. In case of rebuilds we
also keep old format versions around. The endpoints redirect to a download URL on
https://static.docs.rs
. Until we rebuilt all releases, the redirect target might
not exist.
By default we use `zstd` compression, which is more space efficient and faster to decompress. For more limited environments we also started supporting `gzip` compression. You can receive gzip by adding `.gz` to the given URL.
Here some URL examples you can use.
URL | Redirects to JSON download of |
---|---|
https://docs.rs/crate/clap/latest/json | latest version, default target, latest format-version |
https://docs.rs/crate/clap/latest/json.gz | latest version, default target, latest format-version, gzip compression |
https://docs.rs/crate/clap/latest/json/42 | latest version, default target, format-version 42 |
https://docs.rs/crate/clap/~4/json | latest v4 via semver, default target, latest format-version |
https://docs.rs/crate/clap/~4/json.zst | latest v4 via semver, default target, latest format-version, zstd compression |
https://docs.rs/crate/clap/latest/i686-pc-windows-msvc/json | latest version, windows target, latest format-version |