Skip to content

Add /v1/cwv-distribution endpoint#105

Open
max-ostapenko wants to merge 15 commits intomainfrom
development
Open

Add /v1/cwv-distribution endpoint#105
max-ostapenko wants to merge 15 commits intomainfrom
development

Conversation

@max-ostapenko
Copy link
Copy Markdown
Contributor

@max-ostapenko max-ostapenko commented Mar 30, 2026

New Feature: CWV Distribution Endpoint

  • Added a new controller (cwvDistributionController.js) and route (/v1/cwv-distribution) that queries BigQuery for CWV histogram data by technology, with support for filtering by date and rank.

Offers the data for HTTPArchive/httparchive.org#1147

alonkochba and others added 11 commits March 23, 2026 09:43
* feat: add /v1/geo-breakdown endpoint for geographic CWV breakdown

Adds a new controller and route that returns core_web_vitals data for
all geographies for a given technology. Unlike /cwv, this endpoint omits
the geo filter so callers can build a geographic breakdown chart without
issuing one request per country.

* refactor: merge geo-breakdown into reportController factory

Add crossGeo option to createReportController; delete standalone
geoBreakdownController.js. Endpoint now returns a single-month snapshot
(latest by default, or the month specified by the end param).

---------

Co-authored-by: Max Ostapenko <1611259+max-ostapenko@users.noreply.github.com>
@max-ostapenko max-ostapenko requested a review from tunetheweb April 6, 2026 23:16
@max-ostapenko max-ostapenko marked this pull request as ready for review April 6, 2026 23:17
@max-ostapenko
Copy link
Copy Markdown
Contributor Author

Copy link
Copy Markdown
Member

@tunetheweb tunetheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Nice set of tests too!

@alonkochba
Copy link
Copy Markdown
Member

alonkochba commented Apr 7, 2026

Nice!!
Returned list mixing INP/CLS/LCP concerns is a bit odd, but this would work.

PR here (still need to integrate with this API after merge)
HTTPArchive/httparchive.org#1241

Here's a preview with this hardcoded data:

image image image image image image

@alonkochba
Copy link
Copy Markdown
Member

Don't you want to support geo param though?

@max-ostapenko
Copy link
Copy Markdown
Contributor Author

@alonkochba Added geo support, you can test all the filters now.

The latency may be ~30sec for non-cached responses (due to direct query). A loading animation could be helpful here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants