PHPackages                             cmdev/mturk-php - 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. cmdev/mturk-php

ActiveLibrary[API Development](/categories/api)

cmdev/mturk-php
===============

Provides a simple library to communicate with the Amazon Mechanical Turk API. This is a fork of ctrlcctrlv/mturk-php

1491PHP

Since Feb 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/crowdmetricdevs/mturk-php)[ Packagist](https://packagist.org/packages/cmdev/mturk-php)[ RSS](/packages/cmdev-mturk-php/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

mturk-php
=========

[](#mturk-php)

Complete Mechanical Turk API written in PHP that uses the same names as the official documentation

mturk.php is a small library that sends requests to Mechanical Turk. It is much simpler than other libraries which redefine every function that Mechanical Turk recognizes. This saves you time so you don't have to worry about the library, just the Mechanical Turk API.

mturk.php is written in the spirit of my original mTurk library, [mturk.py](https://github.com/ctrlcctrlv/mturk-python). Most names are kept the same between the two.

Read the official mTurk API docs [here](http://docs.aws.amazon.com/AWSMechTurk/latest/AWSMturkAPI/Welcome.html).

Installation
------------

[](#installation)

Install by adding mturk-php to your composer.json file:

```
require : {
    "cmdev/mturk-php": "dev-master"
}

```

or with a composer command:

```
composer require "cmdev/mturk-php": "dev-master"

```

**Example configuration file (mturk.php)**

```
$config = [
    "use_sandbox" => false,
    "verify_mturk_ssl" => true,
    "aws_key" => "ACCESSID",
    "aws_secret_key" => "PASSWORD"
];
```

**Getting your balance**

```
$m = new MechanicalTurk();
$r = $m->request('GetAccountBalance');
if (MechanicalTurk::is_valid($r))
    echo 'Your balance is: ' . MechanicalTurk::get_response_element($r, 'Amount');
```

**Creating a HIT**

```

    answer

      Hello world :^)

QUESTION;

$qual = array(
    array('QualificationTypeId' => MechanicalTurk::N_APPROVED,
          'Comparator' => 'GreaterThan',
          'IntegerValue' => 18),
    array('QualificationTypeId' => MechanicalTurk::P_APPROVED,
          'Comparator' => 'GreaterThan',
          'IntegerValue' => 75)
);

$reward = array(array('Amount' => 5, 'CurrencyCode' => 'USD'));

$createhit = array("Title" => "Testing mturk-php API",
                   "Description" => "https://github.com/ctrlcctrlv/mturk-php",
                   "Keywords" => "testing, one, two, three",
                   "Reward" => $reward,
                   "Question" => $question,
                   "QualificationRequirement" => $qual,
                   "AssignmentDurationInSeconds" => 90,
                   "LifetimeInSeconds" => (60*60*24));

$m = new MechanicalTurk();
$r = $m->request('CreateHIT', $createhit);
var_dump($r);
var_dump(MechanicalTurk::is_valid($r));
?>
```

If you find any bugs please open a new issue.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% 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/f87d54c5a606589bced94fd0e2801441e6d8579a67497cbdf7d21a9139416459?d=identicon)[developers.crowdmetric](/maintainers/developers.crowdmetric)

---

Top Contributors

[![crowdmetricdevs](https://avatars.githubusercontent.com/u/9566812?v=4)](https://github.com/crowdmetricdevs "crowdmetricdevs (14 commits)")[![ctrlcctrlv](https://avatars.githubusercontent.com/u/838783?v=4)](https://github.com/ctrlcctrlv "ctrlcctrlv (2 commits)")

### Embed Badge

![Health badge](/badges/cmdev-mturk-php/health.svg)

```
[![Health](https://phpackages.com/badges/cmdev-mturk-php/health.svg)](https://phpackages.com/packages/cmdev-mturk-php)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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