I am interested in creating a tool for Hackage involving analysis of the various dependencies between Hackage's packages. I am thinking this would involve downloading and syncing a mirror of all Hackage package sources, in particular the *.cabal files, on which I can run the various analyses I have in mind.
How can I access the same repositories that cabal and stack fetch packages from? Is there an API that cabal and stack use to fetch packages that my program could similarly plug into?