This article is devoted to the detection of leaks in oil pipelines and the elimination of accidents. During the transportation of hydrocarbons through the main pipeline, losses classified as operational losses such as evaporation of oil products in tanks, leakage from connecting fittings and pumps were reported. At the same time, during the transportation by the main oil pipeline, the occurrence of accidental losses as a result of the loss of hermeticity of the technological and main pipelines was also noted. Accidental spills have been shown to result in loss of injected product, subsequent additional costs for restoration and repair work, serious environmental damage, and pollution of the atmosphere, soil, and water bodies.