PHPackages                             wimkumpen/algorithmia-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. wimkumpen/algorithmia-php-sdk

ActiveLibrary[API Development](/categories/api)

wimkumpen/algorithmia-php-sdk
=============================

This is a php sdk for the algorithmia.com API

08PHP

Since Jun 4Pushed 7y ago1 watchersCompare

[ Source](https://github.com/wimkumpen/algorithmia-php-sdk)[ Packagist](https://packagist.org/packages/wimkumpen/algorithmia-php-sdk)[ RSS](/packages/wimkumpen-algorithmia-php-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHP SDK FOR ALGORITHMIA API
===========================

[](#php-sdk-for-algorithmia-api)

This is a php sdk for the algorithmia.com API. It only supports curl at this moment and give response back as an array.

Setup:
------

[](#setup)

Add a `composer.json` file to your project:

```
{
  "require": {
      "wimkumpen/algorithmia-php-sdk": "dev-master"
  }
}

```

Then provided you have [composer](http://getcomposer.org/) installed, you can run the following command:

```
$ composer.phar install

```

Or install by:

```
composer.phar require wimkumpen/algorithmia-php-sdk:dev-master

```

That will fetch the library and its dependencies inside your vendor folder. Then you can add the following to your .php files in order to use the library

```
require_once __DIR__.'/vendor/autoload.php';

```

Then you need to `use` the relevant classes, for example:

```
use Algorithmia\Algo;     // for calls to algorithmes
use Algorithmia\Connector // for the data connections

```

Basic usage Algo:
-----------------

[](#basic-usage-algo)

```
$app = new \Algorithmia\Algo(array(
    'default_access_token' => 'YOUR_API_KEY',
    'version' => 'v1',
    false
));

```

Make your alogirthm calls, this will return Algorithmia\\Http\\DataResponse object

```
try {
    // basic algorithm 1
    $algorithmia = $app->algo("demo/Hello", ['yourname']);
    $response = $algorithmia->call();

    // basic algorithm 2
    $algorithmia = $app->algo("WebPredict/ListAnagrams/0.1", ["transformer", "terraforms", "retransform"]);
    $response = $algorithmia->call();

    // call algorithm with file
    $curlFile = new \CurlFile("/path/to/file/test.jpg");

    $algorithmia = $app->algo("opencv/SmartThumbnail/0.1", $curlFile, ["Content-Type" => "application/octet-stream"]);
    $response = $algorithmia->call();

} catch(\Algorithmia\Exceptions\ResponseException $e) {
    var_dump($e->getMessage());die;
} Catch(\Algorithmia\Exceptions\AuthorizationException $e) {
    var_dump($e->getMessage());die;
}

```

Basic usage Connector:
----------------------

[](#basic-usage-connector)

```
$app = new \Algorithmia\Connector(array(
    'default_access_token' => 'YOUR_API_KEY',
    'version' => 'v1',
    false
));

```

Api folder request, returning a \\Algorithmia\\Http\\DirectoryResponse instance

```
try {
    $response = $app->getDir("data" ,".my", "", false);
    $response = $app->createDir("data" ,".my", ['name' => 'elvis', 'acl' => ['read' => []]]);
    $response = $app->updateDir("data" ,".my/elvis", ['acl' => ['read' => []]]);
    $response = $app->deleteDir("data" ,".my/elvis", true);
} catch(\Algorithmia\Exceptions\ResponseException $e) {
    var_dump($e->getMessage());die;
} Catch(\Algorithmia\Exceptions\AuthorizationException $e) {
    var_dump($e->getMessage());die;
}

```

Api file request, returning a \\Algorithmia\\Http\\FileResponse instance

```
try {
    $response = $app->uploadFile("data" ,".my/elvis/testfile.txt", array("file content"));
    $response = $app->deleteFile("data" ,".my/elvis/testfile.txt");
    $response = $app->fileExist("data" ,".my/elvis/testfile.txt");
    $response = $app->getFile("data" ,".my/elvis/testfile.txt");

    $file = new CURLFile("/path/to/file/newfile.txt");
    $response = $app->uploadFile("data" ,".my/elvis/newfile.txt", [$file], ["Content-Type" => "application/x-www-form-urlencoded"]);
} catch(\Algorithmia\Exceptions\ResponseException $e) {
    var_dump($e->getMessage());die;
} Catch(\Algorithmia\Exceptions\AuthorizationException $e) {
    var_dump($e->getMessage());die;
}

```

Todo:
-----

[](#todo)

- Clean some code out;
- Create examples
- Exceptions;
- Automated tested;
- Implement other Http Clients;
- Define requirements;

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/aaace6f7ce6117f5ff27fb2956037d9a2776d6386d9be31bdd87004800d33c24?d=identicon)[wimkumpen](/maintainers/wimkumpen)

---

Top Contributors

[![wimkumpen](https://avatars.githubusercontent.com/u/2332639?v=4)](https://github.com/wimkumpen "wimkumpen (4 commits)")

### Embed Badge

![Health badge](/badges/wimkumpen-algorithmia-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/wimkumpen-algorithmia-php-sdk/health.svg)](https://phpackages.com/packages/wimkumpen-algorithmia-php-sdk)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M186](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M33](/packages/facebook-php-business-sdk)[microsoft/microsoft-graph

The Microsoft Graph SDK for PHP

65723.5M95](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
