We deliver solutions for the AI eraâcombining symbolic computation, data-driven insights and deep technical expertise
Make Wolfram Language functions available as cloud APIs that can be called from other programming languages or embedded on webpages.
Create an APIFunctionCreate an APIFunction that returns the distance between two cities. In this example, TravelDistance returns a Quantity. Applying QuantityMagnitude to that result extracts just the numeric value, which is easier for an external program to process than a Quantity:
Deploy the APIFunction to the Wolfram CloudDeploy the function to the cloud with Permissions->"Public" to make the API available to anyone:
Test the API from a browserVerify that an API works as you expect it to by calling it from a browser. To construct a URL that calls the API, right-click the URL in the CloudObject output of CloudDeploy and choose Copy Address:
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 (&)—for example, "?city1=Chicago&city2=Miami":
Call the API from a non-Wolfram languageGet the code for calling the API from Python:
Paste the embed code into a Python script:
Run the Python script:
$ ./APITest.pyNotes Calls to APIs deployed in your account use your Cloud Credits. Parameters can be any Interpreter type, including countries, currencies, colors, dates and email addresses. You can specify what format the API should use when returning its results: To call an API function programmatically from the Wolfram Language, use URLExecute, giving the API arguments in a list:
1378.25516483735
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4