I don't believe I am hardcording the website into the code. Let me rewrite and explain the code a bit.
This line defines an APIFunction expression called "f". The APIFunction "f" takes an argument called Website which it will interpret as a "SemanticURL". This means it'll convert input like "Facebook" automatically to "https://www.facebook.com/". It tries to convert anything reasonable into a website url. The second argument is a function that takes that URL and does something with it. The third argument specified how the function should be returned. In this case, it'll be returned as a "JPEG":
f = APIFunction[{"Website" -> "SemanticURL"}, First@Import[#Website, "Images"] &, "JPEG"]
Here is an example how we would call f in Mathematica (running locally on your computer). In this case we call f with google:
f[<|"Website" -> "http://www.google.com"|>]
or
f[<|"Website" -> "google"|>]
We can deploy f to the wolfram cloud with CloudDeploy. This will allow us to run the APIFunction in the cloud as an API:
myDeployment = CouldDeploy[f]
This will return a CloudObject with a url. If you go to the URL by clicking it, you'll see some instructions on how to use it. Let's say that the URL was:
https://www.wolframcloud.com/objects/SomeString
We could call the API with this URL. It says to call the function with the value "Website" -> "Google":
https://www.wolframcloud.com/objects/SomeString?Website=Google
The bad news is that the Import function doesn't seem to work right now on the cloud side. So this example won't work until that's fixed - I'm not aware of a workaround. I've forwarded the issue to the relevant people to make sure they're aware of it. I included the code above to hopefully give a better example of how APIFunction works.