Make a URL Call with parameters and return value

My site needs a digital download serial number. I have to be able to call a URL and then Get the return value. The URL has parameters I need to pass with it. Currently, I use a custom function that calls a PHP page hosted on the site and then returns the value, except this is problematic and sometimes very slow. I wondered if there is a way to do this with a server action. I have gone through the documentation. I haven’t figured this out independently, and I could use some feedback. Thanks in advance.

Hello!
Maybe I don’t fully understand

Is this what you need?