AllTrails APIalltrails.com ↗
Search hiking trails, retrieve detailed trail stats, AI review summaries, and paginated user reviews from AllTrails via a simple REST API.
What is the AllTrails API?
The AllTrails API gives developers access to 3 endpoints covering trail search, detailed trail profiles, and user reviews. Use search_trails to query trails by keyword and optional coordinates, then pull full trail data — including elevation stats, route type, activity attributes, and an AI-generated review summary — with get_trail_details. Each response surfaces concrete fields like elevationGain, avgRating, difficulty, and trailCounts for filtering and display.
curl -X GET 'https://api.parse.bot/scraper/00ff888e-47b1-497a-9be0-4e715bb70de8/search_trails?lat=37.7&lng=-119.6&limit=5&query=Yosemite+Falls' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace alltrails-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: AllTrails SDK — discover trails, inspect details, read reviews."""
from parse_apis.alltrails_trail_discovery_api import AllTrails, RouteType, TrailNotFound
client = AllTrails()
# Search for trails near Yosemite — limit caps total items fetched.
for trail in client.trailsummaries.search(query="Yosemite Falls", lat=37.7, lng=-119.6, limit=5):
print(trail.name, trail.rating, trail.route_type)
# Drill into the first result's full details via the summary→detail nav op.
summary = client.trailsummaries.search(query="Half Dome", lat=37.7, lng=-119.6, limit=1).first()
if summary:
detail = summary.details()
print(detail.name, detail.avg_rating, detail.trail_geo_stats.elevation_gain)
print(detail.trail_counts.review_count, "reviews")
# Walk the trail's reviews sub-resource.
for review in detail.reviews.list(limit=3):
print(review.user.username, review.rating, review.comment[:80] if review.comment else "")
# Fetch a trail directly by ID.
try:
trail = client.trails.get(trail_id="10005895")
print(trail.name, trail.overview[:100] if trail.overview else "")
except TrailNotFound as exc:
print(f"Trail not found: {exc}")
print("exercised: trailsummaries.search / summary.details / trails.get / reviews.list")
Full-text search for hiking trails by keyword. Returns trail summaries including name, location, rating, difficulty, and length. Results are geo-biased by proxy IP location unless latitude and longitude are explicitly provided to center the search. Paginates as a single page up to the specified limit.
| Param | Type | Description |
|---|---|---|
| lat | number | Latitude to center the search and avoid geo-bias from proxy IP location |
| lng | number | Longitude to center the search and avoid geo-bias from proxy IP location |
| limit | integer | Maximum number of results to return |
| queryrequired | string | Search keyword (e.g., 'Yosemite Falls', 'Half Dome') |
{
"type": "object",
"fields": {
"count": "integer, number of results returned",
"query": "string, the search keyword used",
"results": "array of trail summary objects with id, name, slug, location, rating, reviews_count, difficulty, length, elevation_gain, route_type"
}
}About the AllTrails API
Trail Search
The search_trails endpoint accepts a required query string (e.g., 'Half Dome' or 'PCT Section J') and returns an array of trail summary objects. Each result includes the trail's id, slug, name, location, rating, reviews_count, difficulty, length, elevation_gain, and route_type. Without coordinates, results may reflect the proxy server's geographic location; pass lat and lng to anchor the search to a specific area. A limit parameter caps the result count.
Trail Details
get_trail_details accepts either a numeric trail_id or a slug (e.g., 'us/california/upper-yosemite-falls-trail') and returns a full trail profile. Key response fields include overview (descriptive text), avgRating, routeType, trailGeoStats (length, elevation start/gain/max, estimated duration in minutes), attributes (activities, features, and obstacles arrays), and trailCounts (review, photo, track, and completed counts). The response also includes an AI-generated review summary derived from user-submitted content.
User Reviews
get_trail_reviews returns paginated user reviews for a trail, identified by trail_id or slug. Each page delivers up to 100 review objects containing comment, date, rating, difficulty, user info, and ratingAttributes / difficultyAttributes for structured condition data. The pageInfo field carries pagination cursor information for sequential traversal; meta reports the item count and response timestamp.
The AllTrails API is a managed, monitored endpoint for alltrails.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when alltrails.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official alltrails.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a trail recommendation engine filtered by
difficulty,length, andelevation_gainfromsearch_trailsresults. - Populate a hiking app's trail profile pages using
overview,trailGeoStats, andattributesfromget_trail_details. - Aggregate user sentiment by collecting
ratingandcommentfields across paginated review pages fromget_trail_reviews. - Display AI-generated review summaries alongside structured stats for quick trail evaluation.
- Monitor trail condition reports by parsing
ratingAttributesanddifficultyAttributesin recent reviews. - Compare elevation profiles across a region by extracting
elevationGainandelevationMaxfrom multiple trail detail calls. - Geocode trail starting points using
latitudeandlongitudefrom thelocationobject in trail detail responses.
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does AllTrails have an official developer API?+
What does `get_trail_details` return that `search_trails` does not?+
search_trails returns lightweight summaries — name, location, rating, difficulty, length, and elevation gain. get_trail_details adds the full overview text, the trailGeoStats object (including elevationStart, elevationMax, and durationMinutes), structured attributes arrays for activities, features, and obstacles, trailCounts for reviews and photos, and an AI-generated summary of user reviews.How does pagination work for trail reviews?+
get_trail_reviews returns up to 100 reviews per page. The pageInfo field in the response carries cursor information you use to request subsequent pages via the page parameter. The meta object reports the item count per response so you can determine when you've reached the last page.Does the API return trail photos or GPX/track files?+
photoCount and trackCount within trailCounts in get_trail_details, but does not return photo URLs or downloadable track data. You can fork this API on Parse and revise it to add endpoints that retrieve those assets.Are results from `search_trails` always globally unbiased?+
lat and lng parameters, search results may be geo-biased toward the proxy server's location. Pass explicit coordinates to center results on the region you care about — for example, latitude and longitude for a national park — and the results will reflect that geography.