- Get your api key from https://console.developers.google.com/
- Create a get request to https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url={THE_URL_TO_CHECK}&key={YOUR_API_KEY}
- Replace {THE_URL_TO_CHECK} with actual url and {YOUR_API_KEY} with real api key
- You will get the analysis in report in json format
- Host your site in fast server
- Create cache
- Optimize images
- use CDN