Deploy a web API that requires specifying a permissions key to use it.
Create an APIFunction
Create an APIFunction that computes the distance between two cities specified by name:
- See the workflow Deploy a Web API for complete details about how to deploy a web API.
Deploy the APIFunction to the Wolfram Cloud with a permissions key
Deploy the APIFunction to the cloud, requiring a permissions key to use it:
Test the API from a browser
Paste the address into a browser search field and append a question mark (?) followed by the names and values of the parameters separated by ampersands (&) and finally, the permissions key preceded by “_key=”; for example, "?city1=Chicago&city2=Miami&_key=fish23":
Call the API from a non-Wolfram language
Use EmbedCode to get the code for calling the API from Python. Click Copy to Clipboard to copy the embed code:
Paste the embed code into a Python script and add the permissions key to the cloud call:
Run the Python script: