OpenAny
Get API keyAPI Key
APIDataTravel

alltrails logo
AllTrails Trail Search API

Search AllTrails trails by keywords and geographic filters via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as limit, output, q, and retrieve structured data including source trail identifier, trail length in kilometres, source difficulty label, and source user-rating value for trail comparison, and nearby discovery.

Selected price
$0.002 / billing creditPublished pricing
Sellers / APIs
1 / 1
Requests · 30d
0Selected implementation · last 30 days
Success rate · 30d
—No requests in this period
USE THIS API

AllTrails Trail Search API

Prepare your request, then continue with your agent.

Pricing

$0.002 / billing credit

Calculated from input parameters and actual returned quantities. Estimate the maximum cost before calling.

Provider
API
Pricing
Connect your agent
On this page

Overview

Overview
AllTrails Trail Search API

AllTrails Trail Search API

Use q with supported place IDs or lat/lng filters. Length filters use kilometres and elevation-gain filters metres; preserve difficulty, difficulty_rating and user rating as separate source properties.

Quick Facts

Fact Value
Access OpenAny REST
Authentication OpenAny API key in the Authorization header
Core inputs Required: q. Optional: difficulty, length_min_km, length_max_km, elevation_gain_min_m, elevation_gain_max_m, route_type, activities, features, rating_min, open_only, park_id, city_id, state_id, country_id, lat, lng, radius_km, page, limit. JSON output; fresh=1 bypasses cache and raw=0 omits raw source blocks.
Selected implementation apish · AllTrails trail search API
Billing See the pricing area for the selected implementation and request options

What You Can Build

  • Trail comparison: Keep source difficulty and user ratings separate.
  • Nearby discovery: Retain query coordinates, radius and metric filter units.

Returned Data

Field Meaning
trails[].id Source trail identifier
trails[].length_km Trail length in kilometres
trails[].elevation_gain_m Cumulative elevation gain in metres
trails[].difficulty Source difficulty label
trails[].rating Source user-rating value
next_page Next source result page when present

Quick Start

  1. Set OPENANY_API_KEY to your OpenAny API key.
  2. Review the selected implementation and pricing, then adapt the request below to your target.
  3. Check the HTTP response and business result before reading optional fields.
bash
curl --request GET --get \
  https://api.openany.si/v1/agent-apis/apish/alltrails/v1/search \
  -H "Authorization: Bearer ${OPENANY_API_KEY}" \
  --data-urlencode limit=1 \
  --data-urlencode output=json \
  --data-urlencode 'q=half dome' \
  --data-urlencode raw=0

Request and Response Examples

The response example is a documentation reference and may be abbreviated. The documented request is a calling template; use the published contract and returned response for the selected implementation.

Published AllTrails Trail Search API implementation contract.

Pricing and Billing

The pricing area reflects the selected API implementation. Review its billing unit and any request-dependent rules before calling; a source service's public availability does not determine OpenAny billing.

Frequently Asked Questions

View FAQ

Related APIs

Playground

Run sends a real API request. Charges follow the published API contract.

Request parameters
Keywords (trail, park or place name), e.g. `half dome`. Optional when a place filter or `lat`/`lng` is given.
Optional parameters (24)
easy, moderate, hard, strenuous; comma separated for several.
Shortest trail length in kilometres.
Longest trail length in kilometres.
Least elevation gain in metres.
Most elevation gain in metres.
loop, out_and_back, point_to_point; comma separated.
Any of these activities, comma separated: hiking, walking, trail-running, mountain-biking, road-biking, backpacking, camping, birding, fishing, horseback-riding, rock-climbing, skiing, cross-country-skiing, snowshoeing, scenic-driving, paddle-sports, off-road-driving, via-ferrata.
Features every trail must have, comma separated: dogs, dogs-leash, dogs-no, kids, ada, strollers, paved, partially-paved, views, waterfall, lake, river, beach, forest, cave, wild-flowers, wildlife, hot-springs, historic-site, rails-trails, city-walk.
Least average rating (0-5).
`true`: leave out closed trails.
Trails in this park (id from /alltrails/v1/places or a trail's `park`).
Trails near this city (id from /alltrails/v1/places or a trail's `city`).
Trails in this state or region (e.g. `5` for California).
Trails in this country (e.g. `313` for the United States).
Latitude of a point: trails around it, nearest first.
Longitude of the point.
Search radius around the point in km (default 25, max 500).
Page (default 1). Pass `next_page` back as `page`; null on the last page. The site lists at most 1,000 results per search.
Results per page (default 24, max 100).
0 leaves out the bulky `raw` source blocks (often 10-30x smaller).
Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.
1 skips the 24-hour cache and fetches live.
JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.
With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row.

Sample response

Run a request to see the actual response. Published samples are in Examples.

Response result

Sellers

SellerPricingRequests · 30dPerformanceAccess
apishCurrent
AllTrails trail search API · GET · View API reference
$0.002 / billing credit0
—successP50—
Selected implementation traffic · 11/3/2026 – 12/3/2026 (UTC)
Selected pricing · apishUSD / billing credit
Pricing
$0.002

Calculated from input parameters and actual returned quantities. Estimate the maximum cost before calling.

Statistics use persisted gateway logs from the last 30 days up to now, including today.
Success rate = successful requests / all requests;
P50 = median latency of successful requests.
Prices reflect the published API contract. Contract revision: 3. Price update time: not supplied.

API

Method
GET
Endpoint
https://api.openany.si/v1/agent-apis/apish/alltrails/v1/search
Content type
application/json
Authentication
Authorization: Bearer $OPENANY_API_KEY
View request and response examples

Input parameters

Fields in this listing; additional options and input encoding can vary by provider.

ParameterLocationTypeRequiredDescription
qURL query parametersquerystringYes

Keywords (trail, park or place name), e.g. `half dome`. Optional when a place filter or `lat`/`lng` is given.

difficultyURL query parametersquerystringNo

easy, moderate, hard, strenuous; comma separated for several.

length_min_kmURL query parametersquerynumberNo

Shortest trail length in kilometres.

length_max_kmURL query parametersquerynumberNo

Longest trail length in kilometres.

elevation_gain_min_mURL query parametersquerynumberNo

Least elevation gain in metres.

elevation_gain_max_mURL query parametersquerynumberNo

Most elevation gain in metres.

route_typeURL query parametersquerystringNo

loop, out_and_back, point_to_point; comma separated.

activitiesURL query parametersquerystringNo

Any of these activities, comma separated: hiking, walking, trail-running, mountain-biking, road-biking, backpacking, camping, birding, fishing, horseback-riding, rock-climbing, skiing, cross-country-skiing, snowshoeing, scenic-driving, paddle-sports, off-road-driving, via-ferrata.

featuresURL query parametersquerystringNo

Features every trail must have, comma separated: dogs, dogs-leash, dogs-no, kids, ada, strollers, paved, partially-paved, views, waterfall, lake, river, beach, forest, cave, wild-flowers, wildlife, hot-springs, historic-site, rails-trails, city-walk.

rating_minURL query parametersquerynumberNo

Least average rating (0-5).

open_onlyURL query parametersquerystringNo

`true`: leave out closed trails.

enum: "true", "false"

park_idURL query parametersqueryintegerNo

Trails in this park (id from /alltrails/v1/places or a trail's `park`).

city_idURL query parametersqueryintegerNo

Trails near this city (id from /alltrails/v1/places or a trail's `city`).

state_idURL query parametersqueryintegerNo

Trails in this state or region (e.g. `5` for California).

country_idURL query parametersqueryintegerNo

Trails in this country (e.g. `313` for the United States).

latURL query parametersquerynumberNo

Latitude of a point: trails around it, nearest first.

lngURL query parametersquerynumberNo

Longitude of the point.

radius_kmURL query parametersquerynumberNo

Search radius around the point in km (default 25, max 500).

pageURL query parametersqueryintegerNo

Page (default 1). Pass `next_page` back as `page`; null on the last page. The site lists at most 1,000 results per search.

limitURL query parametersqueryintegerNo

Results per page (default 24, max 100).

rawURL query parametersquerystringNo

0 leaves out the bulky `raw` source blocks (often 10-30x smaller).

enum: "0", "1"

fieldsURL query parametersquerystringNo

Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.

freshURL query parametersquerystringNo

1 skips the 24-hour cache and fetches live.

enum: "1"

outputURL query parametersquerystringNo

JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.

enum: "json"

recordsURL query parametersquerystringNo

With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row.

Required markers inside a nested object or variant apply when that object or variant is used.

Response structure

Inferred from examples
  • applied_filtersobject
  • cachedboolean
  • countinteger
  • credits_usedinteger
  • fetched_atstring
  • limitinteger
  • next_pageinteger
  • pageinteger
  • qstring
  • totalinteger
  • trailsobject[]
    • activitiesstring[]
    • alert_idsinteger[]
    • cityobject
      • idinteger
      • namestring
      • urlstring
    • closedboolean
    • collectionsstring[]
    • countryobject
      • idinteger
      • namestring
    • created_atstring
    • descriptionstring
    • difficultystring
    • difficulty_ratinginteger
    • elevation_gain_ftinteger
    • elevation_gain_minteger
    • featuresstring[]
    • highest_point_minteger
    • idinteger
    • latitudenumber
    • length_kmnumber
    • length_minteger
    • length_miinteger
    • locationstring
    • longitudenumber
    • monthly_popularityobject
      • month_1integer
      • month_10integer
      • month_11integer
      • month_12integer
      • month_2integer
      • month_3integer
      • month_4integer
      • month_5integer
      • month_6integer
      • month_7integer
      • month_8integer
      • month_9integer
    • namestring
    • parkobject
      • idinteger
      • namestring
      • urlstring
    • photostring
    • photosinteger
    • popularitynumber
    • private_propertyboolean
    • ratingnumber
    • recordingsinteger
    • reviewsinteger
    • route_typestring
    • slugstring
    • stateobject
      • idinteger
      • namestring
    • text_reviewsinteger
    • urlstring
    • visitor_usageinteger

Composite rule pricing

Calculated from input parameters and actual returned quantities. Estimate the maximum cost before calling.

Base fee: $0.000000. One matching variant replaces the base fee. Matching add-ons and quantity charges are added.

Fee itemPriceMetering sourceWhenQuantity limit
Actual API.SH credits consumed$0.002000 / billing creditResponse · /credits_used · Numeric valueAlways1 billing credit · Decimal places: 0

Each quantity charge is rounded before summing: ceil. Requests exceeding this cost limit are rejected; it is not a price cap: $0.002000.

Response quantities settle after the response. Before execution, the maximum quantity determines the reservation; unused reservation is released. Missing or invalid quantities are not treated as zero.

Pricing parameters and defaults
[]

Agent integration

Copy the resource contract without sharing an API key.

Download MDView API Markdown

Error handling

StatusNext step
400Check the offering and request fields.
401 / 403Verify your credentials and access permissions.
402Inspect the selected access mode and returned payment requirements.
429Respect the returned rate limit and retry guidance.
5xxInspect the error and usage record before retrying a paid operation.

Examples

Official example · Live API.SH response · Minimal request

Example from the provider's documentation. Field values in your results will differ.

  1. Prepare your environment

    Use a terminal with cURL installed.

    Use an OpenAny API key with shared-balance access. Confirm availability and price before running; a call may charge your balance.

    Set the key in your terminal using the hidden prompt below. Keep its value out of source files and logs.

    Terminal · macOS / Linux
    printf 'OpenAny API key: '
    read -r -s OPENANY_API_KEY
    export OPENANY_API_KEY
    printf '\n'
  2. Run the request

    Paste the complete command below into your terminal.

    Values to replace before running 25

    Review these request fields before running. Keep the published provider and request method unchanged.

    q
    Keywords (trail, park or place name), e.g. `half dome`. Optional when a place filter or `lat`/`lng` is given.
    difficulty
    easy, moderate, hard, strenuous; comma separated for several.
    length_min_km
    Shortest trail length in kilometres.
    length_max_km
    Longest trail length in kilometres.
    elevation_gain_min_m
    Least elevation gain in metres.
    elevation_gain_max_m
    Most elevation gain in metres.
    route_type
    loop, out_and_back, point_to_point; comma separated.
    activities
    Any of these activities, comma separated: hiking, walking, trail-running, mountain-biking, road-biking, backpacking, camping, birding, fishing, horseback-riding, rock-climbing, skiing, cross-country-skiing, snowshoeing, scenic-driving, paddle-sports, off-road-driving, via-ferrata.
    features
    Features every trail must have, comma separated: dogs, dogs-leash, dogs-no, kids, ada, strollers, paved, partially-paved, views, waterfall, lake, river, beach, forest, cave, wild-flowers, wildlife, hot-springs, historic-site, rails-trails, city-walk.
    rating_min
    Least average rating (0-5).
    open_only
    `true`: leave out closed trails.
    park_id
    Trails in this park (id from /alltrails/v1/places or a trail's `park`).
    city_id
    Trails near this city (id from /alltrails/v1/places or a trail's `city`).
    state_id
    Trails in this state or region (e.g. `5` for California).
    country_id
    Trails in this country (e.g. `313` for the United States).
    lat
    Latitude of a point: trails around it, nearest first.
    lng
    Longitude of the point.
    radius_km
    Search radius around the point in km (default 25, max 500).
    page
    Page (default 1). Pass `next_page` back as `page`; null on the last page. The site lists at most 1,000 results per search.
    limit
    Results per page (default 24, max 100).
    raw
    0 leaves out the bulky `raw` source blocks (often 10-30x smaller).
    fields
    Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.
    fresh
    1 skips the 24-hour cache and fetches live.
    output
    JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.
    records
    With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row.
    Terminal · cURL
    curl \
      'https://api.openany.si/v1/agent-apis/apish/alltrails/v1/search?limit=1&output=json&q=half+dome&raw=0' \
      -X GET \
      -H "Authorization: Bearer $OPENANY_API_KEY" \
      -H 'Content-Type: application/json'
  3. Check the response

    Sample response · Documented HTTP 200

    Sample response
    {
      "applied_filters": {},
      "cached": false,
      "count": 1,
      "credits_used": 1,
      "fetched_at": "2026-11-19T12:28:30.740Z",
      "limit": 1,
      "next_page": 2,
      "page": 1,
      "q": "half dome",
      "total": 35,
      "trails": [
        {
          "activities": [
            "camping",
            "hiking",
            "rock-climbing",
            "via-ferrata"
          ],
          "alert_ids": [
            171,
            20017,
            20019,
            41302
          ],
          "city": {
            "id": 1036,
            "name": "Yosemite Valley",
            "url": "https://www.alltrails.com/us/california/yosemite-valley"
          },
          "closed": false,
          "collections": [
            "waterfalls",
            "trending",
            "views",
            "trees",
            "rivers",
            "wildflowers"
          ],
          "country": {
            "id": 313,
            "name": "United States"
          },
          "created_at": "2020-02-13T23:08:35.000Z",
          "description": "Half Dome is a serious endurance hike taking you 4,800 feet above the Yosemite Valley to spectacular views of Vernal and Nevada Falls, Liberty Cap, the Yosemite Valley, and the High Sierra. This is one of Yosemite National Park’s most iconic hikes. You must obtain a permit to hike to the summit of Half Dome. \n\nPreparation and safety are key to having a fantastic experience. This hike requires you to be in good shape. Most people take 10 to 12 hours to hike to Half Dome and back, depending on the way you choose to come down. Plan to leave around sunrise (or earlier) and then have a non-negotiable turnaround time. The trail is fairly well marked, but make sure to watch for all trail signs, as it can be easy to miss them.\n\nThe elevation gain is very strenuous, starting with a steep climb to Vernal Falls, followed by another steep climb to the top of Nevada Falls. There is about 1 mile of fairly level hiking before reaching Little Yosemite Campground, followed by steep switchbacks through the forest. At about 7 miles into your trip, you’ll reach a break in the trees with a beautiful view of Half Dome and the valley below. Some steep switchbacks carved like stairs into the rock guide the way up to the top of what is known as Sub Dome. Once you walk across the rocky surface of Sub Dome, you’ll arrive at the base of the cables with only 400 feet to go. These last 400 feet are the most challenging, but also the most rewarding (although you may not realize it until you are comfortably back on the valley floor).\n\nThe part of this journey that makes the ascent up Half Dome famous is the cable route. Two steel cables allow hikers to climb the last 400 feet to the summit without rock climbing equipment. The cables are around a 45-55 degree angle, with wooden supports every 10 to 20 feet to rest and maintain your balance. Using gloves is highly recommended to get a better grip and avoid painful blisters. Some choose to bring a harness, carabiners, and slings to secure themselves to the cables as they ascend for extra safety. Be sure to tightly secure your water bottles and cameras for the climb up because you will want them once at the top. Once you have reached the summit, take the time to rest for a while and take in the incredible panoramic views. The Half Dome cables usually go up the Friday before Memorial Day (conditions permitting) and come down the day after Columbus Day.\n\nCompared to the hike up, the return journey flies by, and before you know it, you will be back at the top of Nevada Falls. You have 2 options here: the Mist Trail, which is how you came up, is about 3.4 miles (5.5km), or the John Muir Trail for a slight change of scenery (about 0.5 miles further). The waterfalls suddenly seem much more pleasant as you hike down compared to the earlier climb, and it's hard to hold back a smile as you reach the Vernal Falls footbridge, where you can refill your water (there are also facilities here). About 30 minutes later, you are back at the trailhead, where you can catch a free shuttle to your car or anywhere else in the valley (there is a concession stand near the bus stop where you can buy cold drinks and ice cream).",
          "difficulty": "strenuous",
          "difficulty_rating": 7,
          "elevation_gain_ft": 5101,
          "elevation_gain_m": 1555,
          "features": [
            "forest",
            "river",
            "views",
            "waterfall",
            "wild-flowers",
            "wildlife",
            "dogs-no"
          ],
          "highest_point_m": 2691,
          "id": 10005585,
          "latitude": 37.73282,
          "length_km": 27.36,
          "length_m": 27359,
          "length_mi": 17,
          "location": "Yosemite National Park, California",
          "longitude": -119.55778,
          "monthly_popularity": {
            "month_1": 105,
            "month_10": 2195,
            "month_11": 402,
            "month_12": 96,
            "month_2": 98,
            "month_3": 213,
            "month_4": 483,
            "month_5": 1855,
            "month_6": 3387,
            "month_7": 3293,
            "month_8": 3448,
            "month_9": 3642
          },
          "name": "Half Dome via the John Muir Trail (JMT)",
          "park": {
            "id": 10106838,
            "name": "Yosemite National Park",
            "url": "https://www.alltrails.com/parks/us/california/yosemite-national-park"
          },
          "photo": "https://images.alltrails.com/eyJidWNrZXQiOiJhc3NldHMuYWxsdHJhaWxzLmNvbSIsImtleSI6InVwbG9hZHMvcGhvdG8vaW1hZ2UvMTMxMTA3MDI5L2NkNmU2MzNmOGI1MmEwMjgzYmM4MzA3MWNkY2NhOGZmLmpwZyIsImVkaXRzIjp7InRvRm9ybWF0IjoianBlZyIsInJlc2l6ZSI6eyJ3aWR0aCI6MTIwMCwiaGVpZ2h0IjoxMjAwLCJmaXQiOiJpbnNpZGUifX19",
          "photos": 63583,
          "popularity": 99.9951,
          "private_property": false,
          "rating": 4.9,
          "recordings": 29812,
          "reviews": 19043,
          "route_type": "out_and_back",
          "slug": "trail/us/california/half-dome-via-the-john-muir-trail-jmt",
          "state": {
            "id": 5,
            "name": "California"
          },
          "text_reviews": 5175,
          "url": "https://www.alltrails.com/trail/us/california/half-dome-via-the-john-muir-trail-jmt",
          "visitor_usage": 4
        }
      ]
    }

Common questions

How can I scope the geographic search?

Use supported park, city, state or country IDs, or lat/lng with radius_km, default 25 and maximum 500.

Are difficulty and rating the same?

No. Keep source difficulty labels and difficulty_rating separate from user rating.

How do activities and features combine?

activities matches any listed activity; features requires every listed feature. Preserve literal source filter values.

How do I paginate the source search?

limit defaults to 24 and accepts up to 100. Follow next_page; the source search exposes at most 1,000 results.

How do I bypass cached results?

Pass fresh=1. A cache bypass retrieves available source data; it does not make unpublished or restricted records available.

Can I request CSV or NDJSON?

This OpenAny implementation serves JSON only. Omit output or set output=json.

Use AllTrails Trail Search API with your agent

Inspect endpoint contracts and confirm availability and pricing before a paid call.