The Fife Coast Railway was a railway line running round the southern and eastern part of Fife, in Scotland. It was built in stages by four railway companies:
St Andrews itself had already been reached from Leuchars in 1852 by The St. Andrews Railway.
As well as the textile industries, the line served fishing and agriculture, and an important passenger traffic built up. The lines had been engineered by Thomas Bouch and some difficulties were experienced with inadequately specified technical equipment.
Coal exports assumed a huge importance in the last decades of the nineteenth century, and harbours at Leven and Methil were extended considerably.
The line thrived up until 1939, but road transport took its toll on both passenger and freight business, and the importance of coal declined, and the line closed to passengers in 1965 and to goods traffic in 1966.
Following the success of the Edinburgh and Glasgow Railway, Scotland's first trunk railway, which opened in 1842, promoters started to think of ambitious schemes for other Scottish lines. The easy availability of money as the economy improved resulted in a frenzy of railway promotion and the 1845 Parliamentary session saw a huge number of authorisations. Among them was the Edinburgh and Northern Railway, which was planned to link Edinburgh and Dundee, with an arm to Perth. Bridging the Firths of Forth and Tay was not technologically feasible and ferry crossings at both ends were to be part of the journey, for passengers and for goods.
The Edinburgh and Northern soon changed its name to the Edinburgh, Perth and Dundee Railway and it opened its lines progressively in 1847 - 1848. The route ran through Kirkcaldy, Markinch and Ladybank, forking there for Ferryport-on-Craig via Leuchars, and Perth.
The original prospectus for the line had included a branch line from Leuchars to St Andrews, but this was dropped from the scheme as actually authorised, and it fell to local people in St Andrews to build their own branch line from Leuchars. They did so, and the St Andrews Railway opened in 1852.
Immediately following the authorisation of the Edinburgh and Northern Railway in 1845, a prospectus was issued for an East of Fife Railway. It would either leave the E&NR at Thornton and follow the valley of the River Leven, or leave it at Markinch and follow the valley of the River Orr (often spelt "Ore"). Either way, the line would pass through Cameron Bridge and run close to the coast as far as Anstruther, a distance of about twenty miles. The easy topography of the area was such that the line would be "free from tunnelling or embanking".