Any suggestions for a tour company for a day trip from Edinburgh to St. Andrews?
Rabbies. Https://www.rabbies.com
Or just take the bus there yourself. There are frequent departures between Edinburgh and St Andrews.
In September 2023, we took Rabbie's "St. Andrews and the Fishing Villages of Fife" day tour from Edinburgh, and highly recommend it. The golf course was surprisingly enjoyable - we got to walk on the course since we were there on a Sunday and it was closed. The "Chariots of Fire" beach is adjacent to the course.
The stop in Anstruther was basically a pit stop/photo op, but it worked well for both. I really enjoyed the longer stop in Falkland on the way back. I'm not much of an Outlander fan, but even I recognized The Covenanter Hotel/Mrs. Baird's Guesthouse.
There is also train to Leuchars and bus (or taxi) from there to St Andrews. You don't need a tour company to do this!
There is also the new hourly train from Edinburgh Waverley to Leven, then the bus #95 through the coastal villages to St Andrew's. That is a double deck bus so good for sightseeing.
One of the buses from Edinnburgh (the #X60) also goes round the coast, so a half hourly frequency up the Fife Coast.
The bus station at Leven is opposite the railway station.
It is perfectly possible to route via Leuchars one way, and via Leven the other way
Another vote for the train then the bus. It drops you off right at St. Andrews. Everything is walkable from there; we never used a tour company and had a great time.