Wolfram Language

Systems-Level Functionality

Deploy and Use a Cloud-Based API on the Command Line

WolframScript is able to execute functions deployed using APIFunction with only the UUID as an argument. Start by deploying a simple API to the cloud.

In[1]:=
Click for copyable input
myapi = CloudDeploy[ APIFunction["ticker" -> "TickerSymbol", EntityValue[#ticker, EntityProperty["Financial", "Last"]] &]];

Save the associated UUID to a file.

In[2]:=
Click for copyable input
Put[ScriptForm[URLParse[myapi]["Path"][[3]]], FileNameJoin[{$HomeDirectory, "examples", "my_api_file"}]]

Call the API from the command line with WolframScript.

Alternatively, try running the API using a cloud-based kernel instead.

Related Examples

de es fr ja ko pt-br ru zh