I have a GitHub repo with a CSV and JSON file with this data in it:
https://github.com/davwheat/uk-railway-stations/
It's hand-curated and updated, which means that there is admittedly a delay between a station opening and me remembering to add it (...or someone else opening a PR and shaming me for missing it!).
Make sure to check the license — it originated from a Trainline open data set, so you have to attribute them too.
There are a number of other sources out there which come from upstream rail systems, too. Their licenses might be more relaxed.
David