Get Web Vitals visitor context breakdown
GET
/api/sites/{id}/web-vitals/breakdown
const url = 'https://hitkeep.com/api/sites/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/web-vitals/breakdown?rating=good&metric=LCP&dimension=browser';const options = {method: 'GET', headers: {cookie: 'hk_token=<hk_token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://hitkeep.com/api/sites/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/web-vitals/breakdown?rating=good&metric=LCP&dimension=browser' \ --cookie hk_token=<hk_token>Returns Web Vitals p75 and rating counts for one metric grouped by browser, country, language, device, city, provider, or ASN using the matching pageview context.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” id
required
string format: uuid
Query Parameters
Section titled “Query Parameters ” from
string format: date-time
to
string format: date-time
path
string
Exact normalized page path.
rating
string
Web Vital threshold rating.
metric
required
string
Web Vital metric.
dimension
required
string
Visitor context dimension.
limit
integer
Responses
Section titled “ Responses ”Web Vitals breakdown
Media type application/json
Array<object>
object
name
string
p75
number
samples
integer
good
integer
needs_improvement
integer
poor
integer
rating
string
Example
[ { "rating": "good" }]