(optional) cURL and the CLI

As seen in the last section, you can call an Algorithm from just about any language. But there are also two command-line tools which can be useful for this task.

cURL

cURL ("client URL") is a command-line tool which comes preinstalled on most OSX and Linux systems. On Windows, it may need to be separately installed.

On each Algorithm's page, under "Install and Use", you can click the cURL icon and copy the sample command:

Paste this into a console/terminal to test out the Algorithm, changing the input to whatever value you wish to use.

The Algorithmia CLI

Algorithmia's CLI is a collection of tools which make it easy to run Algorithms from the command line. It can even be used to create new Algorithms, but for now we'll focus on running them.

One advantage of using the CLI is that you don't need to keep copying your API Key into each command.  After installing the CLI, you run the command "algo auth" just once; this saves your API Key so you don't need to type it again.

Then, you can call any algorithm with a command of the form "algo run algoname/version -d 'input'" -- or click the CLI button under "Install and Use" for a cut-and-paste example.

More info is available in the CLI docs.

Next, let's learn what the Input and Output of an Algorithm call look like.

 


NEXT