/ trailapi

Discussions

24
All
Questions
Answers
Newest
A
1
Apologies, there is a mistake in the documentation. The Map GPX endpoint needs a **Map ID**, not a **Trail ID**. Many trails have more than one map, so first you'll need to get a list of maps for the trail, and choose which one you want. (For example, one map might show a race course, while another is a more complete map of all the trails in a park.) First, get a list of available maps for a trail (in this example, we're using **Trail ID** 7, Captain Jack's in Colorado): https://trailapi-trailapi.p.rapidapi.com/trails/7/maps/ This returns: [{"name":"Captain Jack’s: Official Map","id":"2491","description":"","updated":"2020-06-17T12:30:19+00:00","elevation_gain":"471","start_location":"38.796915,-104.898390","distance":"11230"},{"name":"Captain Jack’s: Cpt jacks leg stretcher","id":"17605","description":"","updated":"2020-06-17T12:20:55+00:00","elevation_gain":"458","start_location":"38.798185,-104.892715","distance":"8926"}] Generally the first JSON result is the most complete map. In this case, it's **Map ID** 2491. To get this GPX file, call: https://trailapi-trailapi.p.rapidapi.com/trails/map/2491/gpx/ Note: The GPX endpoint returns a GPX-formatted file, rather than JSON data like the other endpoints. Edit: Actually, the documentation was correct all along, though perhaps not worded clearly: > Input (id) is a map ID, not a trail ID. To get the map ID, call /maps with the trail ID.
Tue 2:48 12/10/21
A
1
Trail data is populated via a number of sources (government data, open data sources, UGC, etc.) and unfortunately it is not 100% complete for some areas. Also note that the level of detail provided varies between trail systems which will affect the number of results. For example, a system like Galbraith might just have a single entry for the whole system, or it might have dozens of individual trails nested beneath the parent.
Fri 12:54 8/10/21
A
1
Trail IDs are returned for search results. For example, you would use the 'Find Bike Trails' endpoint to get a list of trails and their IDs. The 'find' response includes basic info about each trail; if you need more details about each trail in the results, you would plug each ID into the 'Bike Trail Info' endpoint to get that info.
Thu 4:56 9/9/21
A
1
Thank you for pointing that out. We are working on a fix and will post here once it is complete.
Tue 1:03 24/8/21
A
1
Strange. Sounds like a Javascript error. Please post the code you are using, along with the URL of the endpoint you're testing.
Mon 6:10 9/8/21
A
1
It doesn't look like you are sending the required 'x-rapidapi-key' header. Be sure to check out the RapidAPI examples like this one: const settings = { "async": true, "crossDomain": true, "url": "https://trailapi-trailapi.p.rapidapi.com/trails/map/%7Bid%7D/gpx/", "method": "GET", "headers": { "x-rapidapi-key": "YOUR_API_KEY", "x-rapidapi-host": "trailapi-trailapi.p.rapidapi.com" } }; $.ajax(settings).done(function (response) { console.log(response); });
Wed 1:05 7/7/21