Online search service/api for taps

Is anyone aware of a search service or API that provides the same JSON metadata as https://formulae.brew.sh/api/formula/${formula}.json, but for formula in taps?

I would like to add a shields .io badge for formula that are provided by 3rd party taps, but the shields .io service first requires an API that will provide the formula metadata for a given tap.

Any tap could export their own metadata. The code to generate it is here: https://github.com/Homebrew/homebrew-core/blob/master/.github/workflows/generate_formulae.brew.sh_data.yml

Thanks @SMillerDev!

So let’s say that the shields/badges service were inclined to fetch a formula’s JSON data for 3rd party taps. It would be desirable for this JSON data to live in either a central location (as presently with formula.brew.sh) or alternatively, for it to be discoverable by means of a conventional location.

Since it is unlikely that tap owners will want or be able to host separate sites (even via GitHub Pages) simply to make their formulae’ JSON available, a convenient alternative would be for the generated JSON to be committed back into the tap repo itself…

A few alternatives I can see right off the bat:

  1. commit the JSON file as .json right alongside the formula.rb file (in the Formula directory)
  2. create a separate directory (Metadata?) alongside the Formula directory
  3. either 1 or 2, but keeping the json in a wholly separate git branch.

No. 1 is simple and straightforward, but “clutters” up a tap’s Formula directory. This is negligible for most taps that are likely under a few dozen formulae in total.

No. 2 is also fairly straightforward, with the added benefit of being a bit tidier. Also would technically allow users to configure their taps using sparse-checkout in order to avoid having all the JSON files on disk. (very unlikely anyone would do this, though)

No. 3 is the least straightforward but (I believe) has the least potential impact on actual end-users. no extra files would be written to their tap working trees.

Any thoughts regarding any of these approaches or in general?

(relevant GitHub Issue for shields.io: https://github.com/badges/shields/issues/4847 )

No 3 is sorta what homebrew is doing (although it writes to a separate repo)