/index/search
From EveryTrail API Developer Documentation
Contents |
URL
/api/index/search
Semantics
Search for trips and guides on EveryTrail.com
Parameters
| Parameter name | Parameter format | Required | Description |
|---|---|---|---|
| q | string | no | The term to search. |
| activities | array of ints (comma separated) | no | a list of activities to search. |
| lat | double | no | The latitude coordinate to search near |
| lon | double | no | The longitude coordinate to search near |
| proximity | double | no | The proximity (in miles) of the trip from the (lat,lon) location. |
| address | string | no | An address to search near (when proximity is specified) |
| min_length | double | no | The minimum length of a trip in meters |
| max_length | double | no | The maximum length of a trip in meters |
| sort | string | no | How to sort the results (recent_popularity, trip_date, creation_date, votes, proximity*, trip_length. Default is recent popularity) |
| order | string | no | How to order the results (DESC, ASC). Default is ASC) |
| guide_limit | int | no | The maximum number of guides to return |
| trip_limit | int | no | The maximum number of trips to return) |
| limit | int | no | The maximum number of results to return (default is 20) |
| media_filter_mode | int | no | See Media Filter Enumeration |
| min_duration (trips) | int | no | The minimum duration of a trip in seconds |
| max_duration (trips) | int | no | The maximum duration of a trip in seconds |
| durations (guides) | bitmask | no | A bitwise OR of the durations (see below), default is all |
| difficulties (guides) | bitmask | no | A bitwise OR of the difficulties (see below), default is all |
| options_whitelist (guides) | bitmask | no | A bitwise OR of the other options to include (see below), default is none |
| options_blacklist (guides) | bitmask | no | A bitwise OR of the other options to not include (see below), default is none |
| guide_partner_id (guides) | int | no | ID of guide partner. Only guides created by this partner will be returned |
- If you search based on proximity, you MUST include either lat AND lon, OR address
- if you sort by proximity, you MUST include either lat AND lon, OR address
Limits
There are several different ways to specify the number of guides and trips returned:
- if "limit" is set, the total number of returned items will never exceed that number
| guide_limit set | trip_limit set | Outcome |
|---|---|---|
| 0 | 0 | up to limit guides are returned, the remaining spots are filled with as many trips as possible |
| 0 | 1 | up to limit guides are returned, the remaining spots are filled with up to trip_limit trips |
| 1 | 0 | up to guide_limit guides are returned, the remaining spots are fulled with as many trips as possible |
| 1 | 1 | up to guide_limit guides are returned, up to trip_limit trips are returned |
Durations
- 0x0: unknown
- 0x1: less than 1 hour
- 0x2: 1-3 hours
- 0x4: half day
- 0x8: full day
- 0x16: multiple days
Difficulties
- 0x0: unknown
- 0x1: easy
- 0x2: moderate
- 0x4: strenuous
Other Options
Guides contain other option, such as dog friendly, family friendly, bikes allowed, etc.
- The whitelist signals all options which MUST be present in the returned results (ie, kid friendly)
- The blacklist signals all options with MUST NOT be present in the returned results (ie horses allowed on trail)
Success Response
<etSearchResponse status="success"> <guides totalCount="" returnedCount=""> ${guideXML} </guides> <trips totalCount="" returnedCount=""> ${tripXML} </trips> </etTripSearchResponse>
- ${guideXML} - see Guide XML Format
- ${tripXML} - see Trip XML Format
Error Response
<etSearchResponse status="error"> ${error response} </etSearchResponse>
${error response}: See format in Error Reponse Format
Error Codes
110 - The specified address could not be geocoded
