DEV Community

loading...

Google's PageSpeed Insights API, C# version

Bruce Axtens
Programmed Canon Canola calculators in 1977. Assorted platforms and languages ever since. Assisting with HOPL.info. I am NOT looking for work -- I've got more than enough to do.
・1 min read

Google's PageSpeed Insights API offers solutions in cURL and JavaScript. Over on my github account there's a C# implementation. You still need an API key and what you get in return is still JSON. The parsing of that is left to the reader/user to implement.

In our case, we're only interested in a small subset of the data, so it works to use Newtonsoft.Json.JsonConvert.DeserializeObject on the JSON we receive and pull out what we need from a dynamic.

The project uses RestSharp for the retrieval.

Enjoy!

Discussion (3)

Collapse
anjankant profile image
Anjan Kant

Thanks Bruce for the implementation in visual studio using C#.

Collapse
gadrawingz profile image
Gad Iradufasha

Great, But Short details

Collapse
bugmagnet profile image
Bruce Axtens Author

Writing good articles is important to me, so please tell me what else should I have put in?