Need the functionality on a site I'm making to get a user's electoral ward & constituency from a UK postcode which has been entered.
I have been using https://www.uk-postcodes.com/ where you'd make a simple file_get_contents() call like https://www.uk-postcodes.com/postcode/postcode.json but that site has recently gone down (CloudFlare Bad Gateway) - which I always knew was a risk of using an external service, but I took it anyway.
How can I get this same information directly from the ONS website? I honestly can't find anything related to this at all, never mind where to make this call.
One thing to note: I don't want to have to include a whole library for this. I'd prefer a much more minimalistic approach to this.
I'd be very grateful for any advice or help on this.