Python tool to extract data from F1 app

Post here all non technical related topics about Formula One. This includes race results, discussions, testing analysis etc. TV coverage and other personal questions should be in Off topic chat.
Xwang
29
Joined: 02 Dec 2012, 11:12

Python tool to extract data from F1 app

Post

Hi to all,
I've found this tool for extracting data from the F1 official app:
https://github.com/KurtMoran/F1-Data-Extractor

Does anyone use it or similar one to get data like speed graphs and so one?
I'm thinking about giving it a try to analyse F1 testing and races.
It seems that the TV access subscription needed but it is only 27€ a year.

PS I do not know how to record the video of the app and if the replay option is available only on the app or also from the web access

User avatar
nzjrs
60
Joined: 07 Jan 2015, 11:21
Location: Redacted

Re: Python tool to extract data from F1 app

Post

I do the same thing, but found it wasn't necessary to train a custom tessaract detector for the F1 font.

User avatar
Zynerji
111
Joined: 27 Jan 2016, 16:14

Re: Python tool to extract data from F1 app

Post

Does the app actually have an API?

User avatar
Oehrly
5
Joined: 08 Jan 2018, 17:53

Re: Python tool to extract data from F1 app

Post

Zynerji wrote:
23 Feb 2020, 20:35
Does the app actually have an API?
Pretty sure, but it's not going to be public and certainly not documented.
It probably can be reverse engineered, but I would guess that all requests are encrypted. You should be able to decrypt and read the traffic anyways but the whole project would take quite some time.

User avatar
Oehrly
5
Joined: 08 Jan 2018, 17:53

Re: Python tool to extract data from F1 app

Post

OK, did a quick check on my phone

Image

Image

So as I guessed. It has an Api and requests are send over https.
I could only check Events because I don't have an account. But I'm sure it's going to be the same for telemetry.


User avatar
nzjrs
60
Joined: 07 Jan 2015, 11:21
Location: Redacted

Re: Python tool to extract data from F1 app

Post

Is the telemetry drawn client-side?

Xwang
29
Joined: 02 Dec 2012, 11:12

Re: Python tool to extract data from F1 app

Post

Interesting, but how to use it to save and extract telemetry data?

User avatar
Zynerji
111
Joined: 27 Jan 2016, 16:14

Re: Python tool to extract data from F1 app

Post

Not sure yet, but there is an API in there. Might be the bootstrap needed to pull this info directly.

User avatar
Oehrly
5
Joined: 08 Jan 2018, 17:53

Re: Python tool to extract data from F1 app

Post

I quickly read through the code. I don't think you can get telemetry with it. Doesn't look like it's implemented. It is called "Minimal API" after all.
If I finally decide on getting an F1 TV subscription and if I have some time, I might take a closer look at it. And maybe I'll try and write a more extensive API wrapper in Python.

User avatar
Juzh
161
Joined: 06 Oct 2012, 08:45

Re: Python tool to extract data from F1 app

Post

Not too long ago there was a reddit thread where a user was explaining in detail how to scrape all data directly off of websocket, no OCR required, but I think it's only possible for live sessions (don't quote me on that). This way he managed to capture a bunch of data, but crucially I don't think speed traces are included.

For those really interested I suggest reading the entire thread and author's past comments:

https://www.reddit.com/r/formula1/comme ... a_sectors/

User avatar
Zynerji
111
Joined: 27 Jan 2016, 16:14

Re: Python tool to extract data from F1 app

Post

Juzh wrote:
24 Feb 2020, 18:08
Not too long ago there was a reddit thread where a user was explaining in detail how to scrape all data directly off of websocket, no OCR required, but I think it's only possible for live sessions (don't quote me on that). This way he managed to capture a bunch of data, but crucially I don't think speed traces are included.

For those really interested I suggest reading the entire thread and author's past comments:

https://www.reddit.com/r/formula1/comme ... a_sectors/
This API definitely seems more comprehensive... Awesome find!

https://github.com/Ax6/Fast-F1/tree/master/fastf1

User avatar
Oehrly
5
Joined: 08 Jan 2018, 17:53

Re: Python tool to extract data from F1 app

Post

So, I'm a bit confused currently. I've seen screenshots like this a few times now
https://i.imgur.com/gTMYIZc.jpg

Which app is that? Do I need F1TV Access/Pro to get that? And is it only available as live data or can you view it after a race? What about testing?

User avatar
Juzh
161
Joined: 06 Oct 2012, 08:45

Re: Python tool to extract data from F1 app

Post

Oehrly wrote:
25 Feb 2020, 16:49
So, I'm a bit confused currently. I've seen screenshots like this a few times now
https://i.imgur.com/gTMYIZc.jpg

Which app is that? Do I need F1TV Access/Pro to get that? And is it only available as live data or can you view it after a race? What about testing?
You need F1TV access. It's available for all race weekend sessions (fps, quali, race) live and as a replay. It's only available live for testing, no replays.

Xwang
29
Joined: 02 Dec 2012, 11:12

Re: Python tool to extract data from F1 app

Post

Zynerji wrote:
24 Feb 2020, 18:34
Juzh wrote:
24 Feb 2020, 18:08
Not too long ago there was a reddit thread where a user was explaining in detail how to scrape all data directly off of websocket, no OCR required, but I think it's only possible for live sessions (don't quote me on that). This way he managed to capture a bunch of data, but crucially I don't think speed traces are included.

For those really interested I suggest reading the entire thread and author's past comments:

https://www.reddit.com/r/formula1/comme ... a_sectors/
This API definitely seems more comprehensive... Awesome find!

https://github.com/Ax6/Fast-F1/tree/master/fastf1
Using this API, I've managed to do this one

Image

Which is the same as viewtopic.php?p=891389#p891389

The total length is different between the two pilot traces (about 2 meters) so I think the best way to handle that is to normalize the length of the lap to the circuit official length. Do you agree?
Moreover the minimum speed is at different lap position especially in the last turns, but maybe it is a symptom of an early chord point?

Leclerc lap starts at 6 m and ends at 5502.5 m (total lap length 5496.5 m).
Hamilton lap starts at 2.5 m and ends at 5505.5 (total lap length 5503.0 m).
The official track length is 5554 m.

According to you is it possible that on a qualifying lap to have such differences or is it given by telemetry approximation?

On the API documentation page there is the following warning:

Code: Select all

Absolute time is not super accurate. The moment a lap is logged is not always the same and there will be some jitter. At the moment lap time reference is synchronised on the sector time triggered with lowest latency. Expect an error of around ±10m when overlapping telemetry data of different laps.
I do not know if it applies to the above case too.
Last edited by Xwang on 03 Mar 2020, 01:32, edited 1 time in total.

Post Reply