A few months back we quietly rolled out a data service called TrailAPI, offering developers access to many parts of the Singletracks trail database. TrailAPI also integrates data from other outdoor websites in our network with thousands of campgrounds, hiking trails, and even trail running spots in the US and Canada.
If you’re not a developer-type, here’s the takeaway: TrailAPI allows people to build cool websites and apps using the extensive trail information contained in the Singletracks trail database. Got a cool idea for using the Singletracks trail data but don’t know how to build a website? Tell us about your idea in the comments!
For those who are willing to get their hands dirty, TrailAPI serves up basic information for every trail in the catalog: name, lat/lon, description, directions, rating, photo, length (miles), city, state, and country. You can build queries based on location, activity, length, or place name and all results are returned in JSON format. Today there are more than 16,000 trails, campgrounds, and ski resorts available within the data service and we’re adding hundreds more each month.
We put together a few basic examples over on the TrailAPI website to help developers get started. In one example, we build a photo collage (below) based on outdoor photos within a state. And in another example, we place pins on a Google Map showing outdoor recreation areas within a given search radius. In each case, just a few lines of code brings the entire Singletracks trail database to your website!

We’re even using TrailAPI on singletracks to show links to campgrounds close to mountain bike trails (for example, at the bottom of this page). And on Tripleblaze.com we’re using TrailAPI to give us links to outdoor activities like hiking and biking near campgrounds.
So if you have an idea for a website or app that uses mountain bike trail information, TrailAPI can help you get started! Once you build your site, we’d love to hear about it–hit up the comments here and we’ll feature some of the most interesting TrailAPI sites we come across this spring. Happy trails!
Pretty cool stuff, but your photo example gives an error and the other example crashes Firefox and Chrome because of too much recursion errors.
Photo error: ReferenceError: preventDefault is not defined.
Try e.preventDefault() in conjunction with $(‘#loc_link’).click(function(e) instead.
Yes, good catch. The samples have been updated with much improved JQuery code (thanks Josh S!).
Very nice! Stoked to see this officially rolling out!
Super cool, I didn’t even know that this existed.
Is there any further documentation on how to use TrailAPI? I would love to see if I can’t implement it with TexasMountainBikeTrails.com to help cover some of the trails I haven’t been able to leave reviews on yet.
Nice! Usage is pretty straightforward–this page details all the possible query types, including the ability to query by state name and activity: http://www.trailapi.com/faq.php
If you have any specific questions, post ’em up to the Singletracks support forum here: http://help.singletracks.com/support/discussions
I wish you much success with this codie cryptic technical stuff. I’m sticking to the green circle level of computing.