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](assets.en/deploy-and-use-a-cloud-based-api-on-the-command-li/In_73.png)
myapi = CloudDeploy[
APIFunction["ticker" -> "TickerSymbol",
EntityValue[#ticker, EntityProperty["Financial", "Last"]] &]];
Save the associated UUID to a file.
In[2]:=
![Click for copyable input](assets.en/deploy-and-use-a-cloud-based-api-on-the-command-li/In_74.png)
Put[ScriptForm[URLParse[myapi]["Path"][[3]]],
FileNameJoin[{$HomeDirectory, "examples", "my_api_file"}]]
Call the API from the command line with WolframScript.
![](assets.en/deploy-and-use-a-cloud-based-api-on-the-command-li/O_59.png)
Alternatively, try running the API using a cloud-based kernel instead.
![](assets.en/deploy-and-use-a-cloud-based-api-on-the-command-li/O_60.png)