TradeMe Jobs API


Posted By: Thomas Shaw, 11:20am Monday 29 November 2010

It seems everyone is releasing APIs at the moment. TradeMe's public API has been out for a few weeks now and I have finally managed to get around to building some examples. The TradeMe API is built on a simple RESTful standard. It uses HTTP request methods to GET/POST data via XML/JSON.

I have created a simple job board example using the TradeMe API at http://www.mobilejobs.co.nz/trademe.php The example is designed for a mobile device (ie iPhone or Android). There are still a few small bugs in the TradeMe API so I have included the original REST URL for you to double check the returned XML.

For example, if I wanted my application to search all jobs in the "Accounting" category in "Auckland" the request URL is built using some parameters.

https://api.trademe.co.nz/v1/Search/Jobs.xml?rows=20&page=1&sort_order=Default&category=5001&region=1&salary_min=0&salary_max=10000000

rows=20 (number of rows to display)
page=1 (what page of results to display)
sort_order=Default (default sort time. Can also be date posted/title etc)
category=5001 (job category for "Accounting")
region=1 (location for "Auckland")
salary_min=0 (search from min salary $0)
salary_max=10000000 (search to max salary $10000000)

Now that I have found some search results, how do I find out more information about the job? You will then need to individually call the listing's details. For this example we are going to find all the fields in the "National Sales Manager" role at TradeMe using the following URL. Note the format of the URL with [LISTINGID].XML

https://api.trademe.co.nz/v1/Listings/334951800.xml

If you are thinking about building an application using the API, make sure you read all the developer documentation. TradeMe has enforced API call limiting and any calls using member data requires oAuth, https:// and application registration.