I wrote a little script a while ago that has occasionally comes in handy, here is the gist. What is does essentially is, given some package path on nixpkgs, it will scrape f"https://hydra.nixos.org/job/nixos/trunk-combined/nixpkgs.{pkg_path}.x86_64-linux/all", going through the pages on demand. This allows me to utilize past versions of packages which I know have their whole build closure on Hydra, avoiding rebuilds.
It would be nice if the API could expose something akin to that. Currently, it doesn't seem like the API would support such a request.