Hiking-Logbook

Hiking Logbook Public API Documentation

Overview

The Hiking Logbook Public API provides hiking data and statistics to external developers and systems. This API enables third-party applications to integrate hiking community data without building their own database.

Purpose and Value Proposition

What Makes This API Public-Facing

Unlike our internal app (which users access directly through the web interface), this Public API provides value to:

  1. External Developers - Build hiking-related apps using our community data
  2. Fitness Platforms - Integrate hiking statistics into broader fitness tracking systems
  3. Tourism Websites - Display popular hiking locations and trends
  4. Research Projects - Access anonymized hiking data for analysis
  5. Third-Party Devices - GPS watches, fitness trackers can submit hike data to our platform

Key Differentiator from Internal App

Our internal app (frontend) is for hikers to log and track their own personal hikes. The public API allows external systems to:

Getting Started

Available Endpoints

Public Endpoints (No Authentication Required)

Method Endpoint Description External Use Case
GET /api/public/health Check if the API is working API monitoring, uptime checks
GET /api/public/stats Global hiking statistics across all users Tourism sites showing hiking trends
GET /api/public/badges See available achievement badges Gamification systems, external apps
GET /api/public/locations Get popular hiking locations Travel apps, recommendation engines

Protected Endpoints (API Key Required)

Method Endpoint Description External Use Case
POST /api/public/hikes Submit hike data from external systems GPS watches, fitness trackers, other hiking apps
GET /api/public/key-info Get information about your API key API usage monitoring, debugging

Unique Value for External Developers

What the Public API Provides That the Internal App Does NOT:

What it does differently:

Why it’s unique: The internal app doesn’t have a “popular locations” feature - users can’t see what locations other hikers are visiting most. This data is ONLY accessible via the public API.

2. Global Statistics Endpoint (/api/public/stats)

What it does differently:

Why it’s unique: Individual users in the app cannot see global community statistics - they only see their personal dashboard. Public API exposes this aggregated data.

3. Badge/Achievement Definitions (/api/public/badges)

What it does differently:

Why it’s unique: While users see their earned badges, they don’t get structured metadata about ALL possible achievements. External developers need this to build compatible systems.

4. External Hike Submission (/api/public/hikes)

What it does differently:

Why it’s unique: This is a completely different data ingestion path - it’s for machine-to-machine communication, not human users. External systems can contribute to our hiking database without requiring users to manually re-enter data.

Authentication

Most endpoints don’t need authentication. Only when you want to submit hike data do you need an API key.

Test API Keys:

How to use API Keys: Add this header to your request:

X-API-Key: demo-key-12345

Response Format

Success Response

{
  "success": true,
  "data": { ... },
  "message": "Operation successful"
}

Error Response

{
  "success": false,
  "error": "Error type",
  "message": "Detailed error message"
}

Data Submission

Submit Hike Data

Endpoint: POST /api/public/hikes

Headers you need:

Required information:

Optional information:

Example Request:

{
  "externalUserId": "user123",
  "title": "Morning Mountain Trail",
  "location": "Table Mountain, Cape Town",
  "distance": 12.5,
  "elevation": 800,
  "difficulty": "Moderate",
  "date": "2024-01-15T08:00:00Z",
  "duration": 4.5,
  "weather": "Sunny, 22°C",
  "notes": "Beautiful views at the summit!"
}

Testing the API

Using Postman

  1. Open Postman
  2. Create a new request
  3. Set the URL to http://localhost:3001/api/public/health
  4. Click Send
  5. You should get a success response!

Using curl (Command Line)

curl http://localhost:3001/api/public/health

Common Error Codes

Code What it means
200 Success
201 Created (successful data submission)
400 Bad Request (missing or invalid data)
401 Unauthorized (missing or wrong API key)
403 Forbidden (API key doesn’t have permission)
404 Not Found (wrong URL)
500 Server Error (something went wrong on our end)

Data Privacy

Need Help?


Last Updated: October 2025
API Version: 1.0.0