Website logo

Save a search, category or seller to your favourites

Saves a search to the currently authenticated user's list of favourite searches. Can also be used to save a favourite category or seller with the option of specifying basic filters (condition, Buy Now, Pay Now) and sort order.

URL: https://api.trademe.co.nz/v1/favourites/search.{file_format}
HTTP Method: POST
Requires Authentication? Yes
Permission Required: MyTradeMeWrite: Maintain your watchlist, answer questions and post comments.
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

<SaveSearchRequest>

Email Enumeration (required) EmailOptions
None 0 None
Daily 1 Daily
Every3Days 3 Every3Days
Weekly 7 Weekly
Push Enumeration (optional) PushFrequency
None 0 None
Instant 1 Instant
SearchString String (required) SearchString
Type Enumeration (required) SearchType
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

Returns

<SavedFavouriteResponse>

Details of the saved favourite, including the ID.

SearchId Integer SearchId
Response String or null Response
Saved Boolean Saved
FavouriteType Enumeration FavouriteType
None 0 None
Category 1 Category
Search 3 Search
AttributeSearch 4 AttributeSearch
Seller 6 Seller

Examples

Example of a saving a simple keyword search:

<SaveSearchRequest xmlns="http://api.trademe.co.nz/v1">
<Email>None</Email>
<SearchString>search_string=Karen%20Walker</SearchString>
<Type>General</Type>
</SaveSearchRequest>

Example of a saving a simple keyword search sorted by highest number of bids:

<SaveSearchRequest xmlns="http://api.trademe.co.nz/v1">
<Email>None</Email>
<SearchString>search_string=Karen%20Walker&amp;sort_order=BidsMost</SearchString>
<Type>General</Type>
</SaveSearchRequest>

Example of a saving a motors search with price range and automatic transmission filters:

<SaveSearchRequest xmlns="http://api.trademe.co.nz/v1">
<Email>None</Email>
<SearchString>price_min=20000&amp;price_max=30000&amp;transmission=Automatic</SearchString>
<Type>UsedMotors</Type>
</SaveSearchRequest>

Example of a saving a category (with a daily email):

<SaveSearchRequest xmlns="http://api.trademe.co.nz/v1">
<Email>Daily</Email>
<SearchString>category=4295</SearchString>
<Type>General</Type>
</SaveSearchRequest>

Example of saving a category with a region filter:

<SaveSearchRequest xmlns="http://api.trademe.co.nz/v1">
<Email>None</Email>
<SearchString>category=4295&amp;user_region=12</SearchString>
<Type>General</Type>
</SaveSearchRequest>

Example of a saving a seller (with a weekly email):

<SaveSearchRequest xmlns="http://api.trademe.co.nz/v1">
<Email>Weekly</Email>
<SearchString>member_listing=158286</SearchString>
<Type>General</Type>
</SaveSearchRequest>

Example of saving a seller with a Buy Now filter:

<SaveSearchRequest xmlns="http://api.trademe.co.nz/v1">
<Email>None</Email>
<SearchString>member_listing=158286&amp;buy=BuyNow</SearchString>
<Type>General</Type>
</SaveSearchRequest>

Example XML Request (switch to JSON)

<SaveSearchRequest xmlns="http://api.trademe.co.nz/v1">
  <Email>None</Email>
  <Push>None</Push>
  <SearchString>ABC</SearchString>
  <Type>General</Type>
</SaveSearchRequest>

Example JSON Request (switch to XML)

{
  "Email": 0,
  "Push": 0,
  "SearchString": "ABC",
  "Type": 0
}

Example XML Response (switch to JSON)

<SavedFavouriteResponse xmlns="http://api.trademe.co.nz/v1">
  <SearchId>123</SearchId>
  <Response>ABC</Response>
  <Saved>false</Saved>
  <FavouriteType>None</FavouriteType>
</SavedFavouriteResponse>

Example JSON Response (switch to XML)

{
  "SearchId": 123,
  "Response": "ABC",
  "Saved": false,
  "FavouriteType": 0
}