To build the datasets for these analyses, we used the Open Data Portal of the Town hall of Madrid. Unfortunately, all its content is in Spanish, but we can refer to some relevant links, so you don't need to look around too much.
Tráfico. Histórico de datos del tráfico desde 2013 (Traffic. Historic traffic data since 2013): This data has in separated files the recorded traffic measurements from more than 3000 points, taken every 15 minutes. This is the core dataset we use for our traffic analysis, but, to reduce the size of the data, we preprocess it to only use the average measure on each point per day.