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.

Author: brucemcp

1 thought on “jSon data for all F1 races straight into Excel

Leave a Reply

Your email address will not be published. Required fields are marked *