Preheat the oven to 200°C, fan 180°C, gas 6. Put the chicken, breast-side up, in a large roasting tin and rub all over with the olive oil. Scatter the leaves of 1 of the thyme sprigs over the top.
Prick 1 of the lemons all over with a fork and pop it inside the chicken cavity, along with the onion, garlic and half of the remaining thyme sprigs.
Roast in the oven for 1 hour 10 minutes. Halve the remaining lemons and add to the tin along with the rest of the thyme sprigs. Roast for a further 30 minutes until the chicken is cooked: the juices should run clear when a skewer is inserted into the thickest part of the thigh.
Remove from the oven, cover with foil and let rest for 15 minutes before carving.