Website logo

Search by image

Converts a photo into a search that can be executed to find listings that are similar to the given photo.

URL: https://api.trademe.co.nz/v1/Photos/ImageSearch.{file_format}
HTTP Method: POST
Requires Authentication? Yes
Permission Required: None
Supported Formats: XML, JSON
Rate Limited? Yes

URL parameters

file_format Enumeration (required) The format of the response.
xml Serialize responses into XML.
json Serialize responses into JSON.

POST Data

<ImageSearchRequest>

PhotoData String (required) PhotoData
PreviousVersion Boolean (optional) PreviousVersion

Returns

<ImageSearchResponse>

SearchApi Enumeration SearchApi
General 0 General
UsedMotors 1 UsedMotors
MotorBoat 2 MotorBoat
MotorBike 3 MotorBike
Residential 4 Residential
Rental 5 Rental
CommercialSale 6 CommercialSale
CommercialLease 7 CommercialLease
Rural 8 Rural
Lifestyle 9 Lifestyle
Flatmate 10 Flatmate
OpenHomes 11 OpenHomes
Retirement 12 Retirement
Job 13 Job
NewHomes 14 NewHomes
Caravan 15 Caravan
Motorhome 16 Motorhome
SearchString String or null SearchString

Example XML Request (switch to JSON)

<ImageSearchRequest xmlns="http://api.trademe.co.nz/v1">
  <PhotoData>ABC</PhotoData>
  <PreviousVersion>false</PreviousVersion>
</ImageSearchRequest>

Example JSON Request (switch to XML)

{
  "PhotoData": "ABC",
  "PreviousVersion": false
}

Example XML Response (switch to JSON)

<ImageSearchResponse xmlns="http://api.trademe.co.nz/v1">
  <SearchApi>General</SearchApi>
  <SearchString>ABC</SearchString>
</ImageSearchResponse>

Example JSON Response (switch to XML)

{
  "SearchApi": 0,
  "SearchString": "ABC"
}