jSon data for all F1 races straight into Excel

Thanks to Tony Hirst blog, where he demonstrates the Ergast API  I have another entry to make in the Rest-Excel library. This time, it’s all the F1 races to start with, along with the possibility to get all kinds of associated stats.

As usual, I used the Rest Results Explorer to see what we get –

which gives a simple Rest Library entry that looks like this

        With .add("f1")
            .add "restType", erSingleQuery
            .add "url", "http://ergast.com/api/f1.json?limit="
            .add "results", "MRData.RaceTable.Races"
            .add "treeSearch", True
            .add "ignore", vbNullString
        End With

 

And is called like this…

Public Sub testF1()
    generalReport restQuery("f1", "f1", 1000, , , , , , , , True) _
        , True
End Sub

 

Next step is to populate a worksheet with the column headings of the fields I want to populate and run the query — and we get all sorts of stuff about all the F1 races there have ever been.

You can download all this in the cDataSet.xlsm worksheet on the ramblings site download page. This API seems pretty rich, so if you come up with some other nice library entries, dont forget to submit them to the ramblings forum. In the meantime, this looks like very nice rich data to be creating a vizMap Google Earth application around- watch this space.

About brucemcp 225 Articles
I am a Google Developer Expert and decided to investigate Google Apps Script in my spare time. The more I investigated the more content I created so this site is extremely rich. Now, in 2019, a lot of things have disappeared or don’t work anymore due to Google having retired some stuff. I am however leaving things as is and where I came across some deprecated stuff, I have indicated it. I decided to write a book about it and to also create videos to teach developers who want to learn Google Apps Script. If you find the material contained in this site useful, you can support me by buying my books and or videos.

1 Comment

Comments are closed.