Created
June 23, 2021 10:12
-
-
Save mucahitnezir/1676e467bb8dcaff9b8b17b603b0155d to your computer and use it in GitHub Desktop.
PageSpeed Insights API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
const config = { | |
method: 'get', | |
url: 'https://www.googleapis.com/pagespeedonline/v5/runPagespeed', | |
params: { | |
key: '<YOUR_GOOGLE_API_KEY>', | |
url: 'https://mucahitnezir.com', | |
locale: 'tr' | |
}, | |
headers: { | |
'Content-Type': 'application/json' | |
} | |
}; | |
axios(config) | |
.then(function (response) { | |
console.log(JSON.stringify(response.data)); | |
}) | |
.catch(function (error) { | |
console.log(error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment