TrailAPI

FREEMIUM
By trailapi | Updated 9 days ago | Travel
Popularity

9.3 / 10

Latency

1,143ms

Service Level

100%

Health Check

N/A

Back to All Discussions

Same results regardless of query location

Rapid account: Cavealix
cavealix
7 years ago

I’ve made successful queries to the API with locations across different states in the US, however the results are always the same trails which are nowhere near the coordinates I queried for.

Rapid account: Trailapi
trailapi Commented 7 years ago

The trailhead coordinates are included in the response, when available at the “place” level. Here is a sample response. In this example, you’ll note the mountain bike activity info includes an attribute called “length” plus a thumbnail image, and a rating (on a scale of 1-5, 1 being bad, 5 being great.) Depending on the activity type, there are different attributes included.

{
places: [
{
city: “Avon”,
state: “Colorado”,
country: “United States”,
name: “Beaver Creek Ski Resort”,
parent_id: null,
unique_id: 721,
directions: “From Denver, take I-70 West to exit 167, Avon. Follow the signs to the Beaver Creek Ski resort. There is no parking once you’re up the mountain so be sure to make arrangements.”,
lat: 39.63121,
lon: -106.52535,
description: null,
date_created: null,
children: [ ],
activities: [
{
name: “Beaver Creek Ski Resort”,
unique_id: “1-711”,
place_id: 721,
activity_type_id: 5,
activity_type_name: “mountain biking”,
url: “http://www.singletracks.com/bike-trails/beaver-creek-ski-resort.html”,
attribs: {“length”: "“5"”},
description: “There are tons of trails here but only a few are serviced by the summer lift. If you are in great shape (or too cheap to buy a ticket), skip the lift and ride up the mountain (all 2000 vertical feet). The “Blue” trails are the singletrack options and they can be pretty challenging for most riders. The singletrack was mostly washed out and very rooty and steep in sections. If you choose the “Green” trails, be prepared to take the road all the way to the bottom. Overall, not one of the best lift serviced downhills available. Go to Keystone instead (although the scenery is tough to beat).”,
length: 5,
activity_type: {
created_at: “2012-08-15T16:12:35Z”,
id: 5,
name: “mountain biking”,
updated_at: “2012-08-15T16:12:35Z”
},
thumbnail: “http://www.singletracks.com/images/uploads/2011/07/IMG_0416-0-thumb.jpg”,
rank: null,
rating: 3.8
},
{ … },
{ … },
{ … },
{ … }
]
},
{ … }
]
}

Rapid account: Cavealix
cavealix Commented 7 years ago

I apologize. Something on my end was off as I now have it working though I had given up on it after multiple attempts. Thank you for the confirmation. Is there any plan to add the trail coordinates and other relevant info to the trails?

Rapid account: Trailapi
trailapi Commented 7 years ago

Also, these queries for different states in the US also appear to be returning the correct trails within those states.

https://trailapi-trailapi.p.mashape.com/?q[state_cont]=Georgia

https://trailapi-trailapi.p.mashape.com/?q[state_cont]=California

Rapid account: Trailapi
trailapi Commented 7 years ago

Hi cavealix, can you post a couple of the queries you’re attempting?

For example, these queries for different lat/lon pairs are correctly returning different sets of trails.

https://trailapi-trailapi.p.mashape.com/?lat=34&lon=-83&radius=100

https://trailapi-trailapi.p.mashape.com/?lat=34&lon=-84&radius=100

Join in the discussion - add comment below:

Login / Signup to post new comments