Skip to main content
GET
/
api
/
routes
List Routes
curl --request GET \
  --url https://api.example.com/api/routes
{
  "success": true,
  "count": 123,
  "data": [
    {
      "id": "<string>",
      "name": "<string>",
      "slug": "<string>",
      "image": "<string>",
      "approximateDistance": "<string>",
      "description": "<string>",
      "gpxFileUrl": {},
      "mapEmbedUrl": {},
      "level": [
        {}
      ],
      "averageRating": 123,
      "createdAt": "<string>",
      "updatedAt": "<string>",
      "_count": {
        "reviews": 123,
        "favorites": 123,
        "routeCalls": 123,
        "photos": 123
      }
    }
  ]
}

Overview

Retrieve all predefined routes ordered alphabetically by name. Each route includes counts for reviews, favorites, route calls, and photos, along with the calculated average rating. Authentication: Not required

Request

curl https://api.losinmaduros.com/api/routes

Response

success
boolean
required
Indicates if the request was successful
count
number
required
Total number of routes returned
data
array
required
Array of route objects

Example Response

{
  "success": true,
  "data": [
    {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Casa de Campo Loop",
      "slug": "casa-de-campo-loop",
      "image": "https://example.com/routes/casa-de-campo.jpg",
      "approximateDistance": "12 km",
      "description": "A beautiful loop through Casa de Campo park...",
      "gpxFileUrl": "https://example.com/gpx/casa-de-campo.gpx",
      "mapEmbedUrl": "https://maps.google.com/embed/...",
      "level": ["BEGINNER", "INTERMEDIATE"],
      "averageRating": 4.5,
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-02-20T14:22:00.000Z",
      "_count": {
        "reviews": 42,
        "favorites": 127,
        "routeCalls": 18,
        "photos": 89
      }
    },
    {
      "id": "660f9511-f3ac-52e5-b827-557766551111",
      "name": "Madrid Rio Trail",
      "slug": "madrid-rio-trail",
      "image": "https://example.com/routes/madrid-rio.jpg",
      "approximateDistance": "8 km",
      "description": "Scenic route along the Manzanares River...",
      "gpxFileUrl": null,
      "mapEmbedUrl": null,
      "level": ["BEGINNER"],
      "averageRating": 4.2,
      "createdAt": "2024-01-10T09:15:00.000Z",
      "updatedAt": "2024-02-18T11:45:00.000Z",
      "_count": {
        "reviews": 31,
        "favorites": 95,
        "routeCalls": 12,
        "photos": 54
      }
    }
  ],
  "count": 2
}

Build docs developers (and LLMs) love