lighthouse-ci icon indicating copy to clipboard operation
lighthouse-ci copied to clipboard

Documentation for REST API

Open bobbygryzynger opened this issue 4 years ago • 3 comments

Is your feature request related to a problem? Please describe. Lighthouse exposes an API but, from what I can tell, there is no documentation of it, besides what is listed here https://github.com/GoogleChrome/lighthouse-ci/issues/40#issuecomment-549579257.

Through playing around a bit, I've found that the API accepts some URL parameters for filtering, but this takes some looking into the source and guess-and-check work to figure out. It would be great if there was some documentation that identifies the API endpoints and their parameters.

Describe the solution you'd like API documentation for Lighthouse's REST API.

Describe alternatives you've considered Looking through the source and guessing-and-checking, but this doesn't give me any guarantees on what, if any, stable API will be available.

Additional context None.

bobbygryzynger avatar Jun 07 '21 16:06 bobbygryzynger

Thanks for filing @bobbygryzynger!

That's largely because we haven't really committed to a stable REST API intended for public consumption. The only real contract right now is that the CLI of a major version should be able to communicate with one prior version.

It hasn't changed in quite some time though and we'd don't really have plans to change it in the future. What sorts of use cases are you enabling by direct REST API usage?

patrickhulce avatar Jun 07 '21 20:06 patrickhulce

@patrickhulce we're housing multiple repositories under a single Lighthouse project, where we use the LHCI_BUILD_CONTEXT__CURRENT_BRANCH override to keep things organized. We use the REST API to generate comparison links since, with this usage, there is no single base build. We also use the API to translate a project's friendly name to its UUID.

bobbygryzynger avatar Jun 08 '21 15:06 bobbygryzynger

~I would love to extract build results to show selected data to my customers in a dashboard. Trying to use the API for that, but struggle with Auth~ looks like I had some bad characters in my password. works fine now :)

Would be great to have the API docs more exposed :)

axe312ger avatar Jun 11 '21 12:06 axe312ger