MTB Project Logo

Developer API


Original Post
Anatoly Geyfman · · Portland · Joined Jan 2014 · Points: 0

I working on a web project with NWTA (Northwest Trail Alliance) and I'd love to use your trail search to create an interactive web application (embedded on NWTA's site) that shows trails within a certain amount of driving distance from Portland, OR. This is both an advocacy effort (look how much gas is wasted since there are so few places within riding distance!) and a trail discovery mechanism (I'd love to drive

calitradclimber · · Unknown Hometown · Joined Aug 2001 · Points: 0

Sorry for the slow response here... this isn't something we can support at the moment, but you might want to check out our free widgets for displaying our content on another website. mtbproject.com/widget

Andrew W · · Novato, CA · Joined May 2014 · Points: 19

Any updates to this? I'm considering building a helper that prompts me to check-in and give trail condition feedback when I complete a ride that touches trails in your database. Would really prefer an API to scraping your website as I am familiar with the pain that entails.

Brian Smith · · Boulder, CO · Joined Dec 2014 · Points: 5,544

Andrew - don't quote me on this, but we'll likely make an API available sometime this spring. Sounds like a cool project that you have in mind!

Thanks,
Brian

Andrew W · · Novato, CA · Joined May 2014 · Points: 19

Thanks for the reply Brian. Hoping for good news in the spring and keep me updated if you hear something. Same goes for anyone else reading this ;)

Dan Kaste · · Unknown Hometown · Joined May 2017 · Points: 0

I realize this thread is a few years old, but I also am interested in an API. Specifically I'm building an Alexa Skill for reporting trail conditions.


Thanks,

Dan

Tom Robson · · Boulder, CO · Joined Mar 2015 · Points: 5,903
Matt Meyer · · Unknown Hometown · Joined Jun 2016 · Points: 0

Awesome of you guys to provide an API.  Got my ESP8266 talking with your server today.  A buddy and I are planning on making a fixture that will grab trail conditions from our local trails and display them via an RGB LED.  

Tom Robson · · Boulder, CO · Joined Mar 2015 · Points: 5,903

Awesome, Matt! When you're done, please share the results with us   

Chicken Baby · · Unknown Hometown · Joined Mar 2017 · Points: 0

Is there somewhere that one could download all of the trail data at once (in json format, or otherwise)? The maxResults and maxDistance limits (500, and 200, respectively) prevent one from doing this with the API. Thanks!

Nick Wilder · · Boulder, CO · Joined Jan 2005 · Points: 9,760

Sorry Chicken Baby, but we don't make all our data available at once.

Bradley Lawrence · · Cleveland, OH · Joined Jun 2018 · Points: 0

Is there a plan to create an endpoint to update trail conditions?

Dev Dev · · Unknown Hometown · Joined Dec 2018 · Points: 0

Can we get a full-description field in the API? We're developing our website to provide info on the go-to trails in our area, but rather than curating our own descriptions, we'd rather use those that many of our users have already fed into MTBProject. Currently, all I can get via the API is the summary... which is nice, but not enough.

Scott Z · · Richmond Va · Joined Mar 2018 · Points: 0

I am working on a website that I am planning to use both the api and one of the widgets. I'd like the call the widget programatically with the trail ID, but the widget seems to also require a coordinate. Problem is the coordinates provided by the api are lat lon, while the coordinate in the widget is something else. What is the coordinate system of the widget?

Thanks

--Scott 

Nick Wilder · · Boulder, CO · Joined Jan 2005 · Points: 9,760
Scott Z wrote: I am working on a website that I am planning to use both the api and one of the widgets. I'd like the call the widget programatically with the trail ID, but the widget seems to also require a coordinate. Problem is the coordinates provided by the api are lat lon, while the coordinate in the widget is something else. What is the coordinate system of the widget?

Thanks

--Scott 

Scott, if you have a valid trail ID, the lat/lon (or x/y) will be ignored.  When creating the URL for widgets with trails, you can skip those coordinates entirely.

If for some reason you DID want to translate lat/lon to x/y and vice versa, here are the functions:

lon2x(lon) {
    return Math.round(lon * .017453292 * 6378137.0);
}

lat2y(lat) {
    return Math.round(Math.log(Math.tan(0.78539816 + lat * .017453292 / 2.0)) * 6378137.0);
}

x2lon(x) {
    return Math.round(57.295779 * x / 6378137.0 * 100000) / 100000;
}

y2lat(y) {
    return Math.round(57.295779 * (2.0 * Math.atan(Math.exp(y / 6378137.0)) - 1.5707963267948966192) * 100000) / 100000;
}
Scott Z · · Richmond Va · Joined Mar 2018 · Points: 0

Thank you very much Nick.

--Scott

Gary Schweisthal · · Unknown Hometown · Joined Sep 2013 · Points: 104
Bradley Lawrence wrote: Is there a plan to create an endpoint to update trail conditions?

I would rather have the MTB Project site scan an IMBA chapter site and "scrape" it from there.  I sent in feedback via the form.

Guideline #1: Don't be a jerk.

MTB Project Feedback & Suggestions
Post a Reply to "Developer API"

Log In to Reply