Analyze PageSpeed
curl -X GET "https://api.latentgeo.com/pagespeed/analyze?url=https://example.com&strategy=mobile" \
-H "Authorization: Bearer YOUR_API_KEY"
Analyze page performance using Google PageSpeed Insights.
Query Parameters
URL to analyze for performance metrics
Analysis strategy: mobile or desktop
Response
Returns detailed performance metrics including Core Web Vitals and optimization suggestions.
Complete Lighthouse audit results
The final URL analyzed (after redirects)
Performance category scores
Performance score (0-100)
Accessibility score (0-100)
Best practices score (0-100)
Detailed audit results for each metric
Real-world loading experience data from Chrome User Experience Report
Core Web Vitals metrics
FIRST_CONTENTFUL_PAINT_MS
First Contentful Paint timing
LARGEST_CONTENTFUL_PAINT_MS
Largest Contentful Paint timing
CUMULATIVE_LAYOUT_SHIFT_SCORE
Cumulative Layout Shift score
INTERACTION_TO_NEXT_PAINT
Interaction to Next Paint timing
Overall performance category: FAST, AVERAGE, or SLOW
{
"lighthouseResult": {
"finalUrl": "https://example.com/",
"categories": {
"performance": {
"score": 0.92,
"title": "Performance"
},
"accessibility": {
"score": 0.88,
"title": "Accessibility"
},
"best-practices": {
"score": 0.95,
"title": "Best Practices"
},
"seo": {
"score": 1.0,
"title": "SEO"
}
},
"audits": {
"first-contentful-paint": {
"score": 0.98,
"displayValue": "0.8 s",
"numericValue": 800
},
"largest-contentful-paint": {
"score": 0.95,
"displayValue": "1.2 s",
"numericValue": 1200
},
"cumulative-layout-shift": {
"score": 1.0,
"displayValue": "0.02",
"numericValue": 0.02
}
}
},
"loadingExperience": {
"metrics": {
"LARGEST_CONTENTFUL_PAINT_MS": {
"percentile": 1450,
"category": "FAST"
},
"CUMULATIVE_LAYOUT_SHIFT_SCORE": {
"percentile": 0.05,
"category": "FAST"
},
"INTERACTION_TO_NEXT_PAINT": {
"percentile": 120,
"category": "FAST"
}
},
"overall_category": "FAST"
}
}
Error Codes
Unauthorized - Invalid or missing authentication token
Bad Request - Invalid URL or strategy parameter
Too Many Requests - PageSpeed API rate limit exceeded
Bad Gateway - Google PageSpeed API error
Compare Strategies
curl -X GET "https://api.latentgeo.com/pagespeed/compare?url=https://example.com" \
-H "Authorization: Bearer YOUR_API_KEY"
Compare page performance across mobile and desktop strategies.
Query Parameters
URL to analyze for both mobile and desktop
Response
Returns performance data for both mobile and desktop strategies.
Mobile performance analysis with the same structure as the analyze endpoint
Desktop performance analysis with the same structure as the analyze endpoint
{
"mobile": {
"lighthouseResult": {
"finalUrl": "https://example.com/",
"categories": {
"performance": {
"score": 0.85,
"title": "Performance"
}
}
},
"loadingExperience": {
"overall_category": "AVERAGE"
}
},
"desktop": {
"lighthouseResult": {
"finalUrl": "https://example.com/",
"categories": {
"performance": {
"score": 0.98,
"title": "Performance"
}
}
},
"loadingExperience": {
"overall_category": "FAST"
}
}
}
Error Codes
Unauthorized - Invalid or missing authentication token
Bad Request - Invalid URL parameter
Too Many Requests - PageSpeed API rate limit exceeded
Bad Gateway - Google PageSpeed API error