No RPi model is capable of directly sensing (more than once!) the presence of 240 volts ac. You will need an interface circuit or device to produce an input to the RPi which is safe for the RPi itself and safe for human life, animal life and property in the surroundings. You will also need an understanding of the safety aspects in order not to compromise them. From what you have written so far, I cannot "give you a pass mark" on that. Can you allay the doubts of potential responders?

If your oil burner as a flame inspection window, you could use a simple
LDR /opto isolator circuit to switch a 3.3vdc to your Pi in/put .It will be a
Non intrusive to the boiler supply The Opto isolator will give you total
Isolation from the boiler mains .

That’s an elegant way of doing it and whilst I’m sure it doesn’t have that option (aside from the current photocell installed by the manufacturer) but I’ll have another look to see if there’s space for it somewhere.

Your are writing that your boiler had some electric in them. So, do you know it has a communication connector somewhere. Or can you buy something from the manufacture to control the boiler from a distance. If so, that part could also have a indication if the boiler is active. And this may be a easier way of getting information from your boiler.

Okay.
Maybe a other option could be mounting a proper temperature probe on the output (tube)** of the boiler. Or a other save place where it is closer to the "hot place". But be very careful with placing part inside the boiler*.You don't want to block some important airflow. Otherwise your boiler could produce the deadly CO.

*I would not recommend that. That you place something inside the boiler. Also if the boiler damage something, and the issurent company sees that you heve modified it. I think you have a big problem then.

Edit
**you could also sense the temperature of the input water. To see it the output is still hotter than the input.

I think a Pi is perfect for this kind of thing, but there is some engineering to do.

As mentioned above, tampering with 240 VAC brings serious safety issues, but even 24 VDC and 12 VDC are not without issues. And a Pi can take only 3.3 Volt DC for input, anything higher than that will fry the SOC.
But there are current and voltage sensors that are perfectly safe to use (example: https://www.tinytronics.nl/shop/nl/sens ... 3-000-100a).

Your first question was about measuring oil consumption. Measuring the weight of the tank would be the best way to do this, but probably not very practical. Some kind of level sensor is what you need here. Mounting a sensor inside the tank is probably not a good idea (you don't want any electrics inside an oil tank), but there might be sensors that can measure the liquid level from the outside. Maybe a flow sensor on the oil line from the tank to the boiler is a good solution.

So you need to look for sensors that can be used in your particular situation, and you probably need to do some Analog-Digital conversions as well. Everything you need is out there, but you need do some searching and some engineering to make it work.

I think a Pi is perfect for this kind of thing, but there is some engineering to do.

As mentioned above, tampering with 240 VAC brings serious safety issues, but even 24 VDC and 12 VDC are not without issues. And a Pi can take only 3.3 Volt DC for input, anything higher than that will fry the SOC.
But there are current and voltage sensors that are perfectly safe to use (example: https://www.tinytronics.nl/shop/nl/sens ... 3-000-100a).

Your first question was about measuring oil consumption. Measuring the weight of the tank would be the best way to do this, but probably not very practical. Some kind of level sensor is what you need here. Mounting a sensor inside the tank is probably not a good idea (you don't want any electrics inside an oil tank), but there might be sensors that can measure the liquid level from the outside. Maybe a flow sensor on the oil line from the tank to the boiler is a good solution.

So you need to look for sensors that can be used in your particular situation, and you probably need to do some Analog-Digital conversions as well. Everything you need is out there, but you need do some searching and some engineering to make it work.

Thanks for this and I’d actually previously looked at getting a flow meter but the price for one was horrendous.

Sogoing back to the clamp idea you’ve mentioned above, would this plug into the PI and what would be the steps after this?

Did I mention clamp? I am not sure what you mean here.
Looking at it some more I agree with other posters that making modifications to the boiler installation has some safety issues.
Which makes the idea of some light sensor looking at the flame inspection window a very attractive one.
Prices for hobby flow sensors for water are somewhere in the 5-10 euro range, but for oil/petrol/diesel they are quite a bit higher.

For the oil level sensor I looked at level sensors for fuel tanks for yachts. They work with a float, similar to fuel tanks for cars. Probably not precise enough for measuring the actual consumption, but at least you have an indication of the oil level.

For the Analog-Digital conversion there are, again, many options. I have an Explorer HAT Pro lying next to my keyboard. This device has 4 analog inputs (0-5 Volt) and 4 digital inputs and comes with a Python library, could be just the thing you need.