Developer Center

Resources to get you started with Algorithmia



We offer a vanilla JavaScript client for calling algorithms in the marketplace.


You can download our JavaScript client from:

You can include the JavaScript file as a script tag:

<script src="//" type="text/javascript"></script>

Call an Algorithm

Next, login to Algorithmia to get your API key:

Now import the Algorithmia library and create the Algorithmia client:

var client = Algorithmia.client("YOUR_API_KEY");

After setting your API key, you can then use the client variable from the above line to call algorithms.

The format for calling an algorithm is client.algo() with the algorithm name passed in. To pass input to the algorithm, use the .pipe method.


Here is an example of how to authenticate and call an algorithm in JavaScript:

var input = 41;
var client = Algorithmia.client("YOUR_API_KEY");
client.algo("docs/JavaAddOne").pipe(input).then(function(output) {
  if(output.error) return console.error("error: " + output.error);


Your account can make up to 80 Algorithmia requests at the same time (this limit can be raised if needed).

Note: Working with Files

Because of security concerns, the JavaScript client does not implement the Data API which other clients use to move files into and out of Data Sources. This can be a problem if you call an algorithm which writes its output to a file (instead of returning it directly). However, there are workarounds:

For smaller files, the util/Cat and ANaimi/Base64DataConverter algorithms can be used for retrieving file contents.

For larger files, you can set up an Amazon S3 Connector to an S3 bucket with public read access. Then, direct the algorithms you call to write their output into that S3 connector (or use s3utilities/UploadFiletoS3/ to move it there). Once it is in the S3 bucket, you can access the file via its publicly-readable URL.

Alternately, you could implement a small piece of backend code in another language and use it to retrieve the file for you.