PHPackages                             oceanapplications/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. oceanapplications/mturk\_php

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

oceanapplications/mturk\_php
============================

mTurk\_PHP wrapper

v1.2(10y ago)1187MITPHP

Since Aug 13Pushed 10y ago1 watchersCompare

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

READMEChangelog (3)DependenciesVersions (4)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).

**Example configuration file (mturkconfig.json)**

```
{
"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

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 77.8% 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.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

3931d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/58f943d2f265e822ed311a9c234d1121190cf61c411b57cd49c61410d00c8330?d=identicon)[oceanapplications](/maintainers/oceanapplications)

---

Top Contributors

[![oceanapplications](https://avatars.githubusercontent.com/u/2704923?v=4)](https://github.com/oceanapplications "oceanapplications (7 commits)")[![ctrlcctrlv](https://avatars.githubusercontent.com/u/838783?v=4)](https://github.com/ctrlcctrlv "ctrlcctrlv (2 commits)")

---

Tags

mturk

### Embed Badge

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

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

PHPackages © 2026

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