PHPackages                             jpcaparas/trademe-php-api - 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. jpcaparas/trademe-php-api

ActiveLibrary[API Development](/categories/api)

jpcaparas/trademe-php-api
=========================

A PHP client for the Trade Me API

v0.2(7y ago)21.2k2[2 PRs](https://github.com/jpcaparas/trademe-php-api/pulls)MITPHPPHP ^7.1

Since Apr 12Pushed 3y agoCompare

[ Source](https://github.com/jpcaparas/trademe-php-api)[ Packagist](https://packagist.org/packages/jpcaparas/trademe-php-api)[ RSS](/packages/jpcaparas-trademe-php-api/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (5)Versions (7)Used By (0)

Trade Me PHP API
================

[](#trade-me-php-api)

[![Build Status](https://camo.githubusercontent.com/fa6e856b81944837fcc5b165d1edede7c5f862ac2fcefa93532c1f11ab4bb752/68747470733a2f2f7472617669732d63692e6f72672f6a70636170617261732f74726164656d652d7068702d6170692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jpcaparas/trademe-php-api) [![Coverage Status](https://camo.githubusercontent.com/68a61532e6e2d0bbb8e7f7cffe0f27aca1aa8b9d1a4d0b88378ee92b2b55dfb0/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6a70636170617261732f74726164656d652d7068702d6170692f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/jpcaparas/trademe-php-api?branch=master)

An unofficial PHP client to make it easy to interface with Trade Me's [API platform](https://developer.trademe.co.nz/).

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

[](#installation)

```
composer require jpcaparas/trademe-php-api

```

Authorizing
-----------

[](#authorizing)

#### Getting temporary access tokens (Step 1)

[](#getting-temporary-access-tokens-step-1)

```
$config = [
    'sandbox' => true,
    'oauth' => [
        'consumer_key' => 'foo',
        'consumer_secret' => 'bar',
    ],
];

$client = new \JPCaparas\TradeMeAPI\Client($config);

['oauth_token' => $tempAccessToken, 'oauth_token_secret' => $tempAccessTokenSecret] = $client->getTemporaryAccessTokens();

```

#### Getting the OAuth token verifier to validate temporary access tokens (Step 2)

[](#getting-the-oauth-token-verifier-to-validate-temporary-access-tokens-step-2)

```
$tokenVerifierUrl = $client->getAccessTokenVerifierURL($tempOAuthToken); // Visit this URL and store the verifier code

```

#### Getting the final access tokens (Step 3)

[](#getting-the-final-access-tokens-step-3)

```
// The config values are a culmination of steps 1 and 2
$config = [
    'temp_token' => 'baz',
    'temp_token_secret' => 'qux',
    'token_verifier' => 'quux'
];

['oauth_token' => $accessToken, 'oauth_token_secret' => $accessTokenSecret] = $client->getFinalAccessTokens($config);

```

Making API calls
----------------

[](#making-api-calls)

You can make API calls once you've gotten your final access tokens:

#### Selling an item

[](#selling-an-item)

```
$config = [
    'sandbox' => true,
    'oauth' => [
        'consumer_key' => 'foo',
        'consumer_secret' => 'bar',
        'token' => 'baz',
        'token_secret' => 'qux',
        'token_verifier' => 'quu',
    ],
];

$client = new Client($config);

$params = [
    'Category' => 'TestCategory',
    'Title' => 'TestTitle',
    'Description' => ['TestDescriptionLine1'],
    'Duration' => 1,
    'BuyNowPrice' => 99,
    'StartPrice' => 90,
    'PaymentMethods' => [2, 4],
    'Pickup' => 1,
    'ShippingOptions' => [
        ['Type' => 1],
    ],
];

$client->sellItem($params);

```

Tests
-----

[](#tests)

```
vendor/bin/phpunit

```

References
----------

[](#references)

- OAuth 1.0 PLAINTEXT workflow [(link)](https://developer.trademe.co.nz/api-overview/example-plaintext-workflow/)
- API reference [(link)](https://developer.trademe.co.nz/api-reference/)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2583d ago

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

apiphpsdktrademetrade metrademe

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jpcaparas-trademe-php-api/health.svg)

```
[![Health](https://phpackages.com/badges/jpcaparas-trademe-php-api/health.svg)](https://phpackages.com/packages/jpcaparas-trademe-php-api)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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