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.
Unlike our internal app (which users access directly through the web interface), this Public API provides value to:
Our internal app (frontend) is for hikers to log and track their own personal hikes. The public API allows external systems to:
Base URL: https://hiking-logbook-hezw.onrender.com (Production) |
http://localhost:3001 (Development) |
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 |
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 |
/api/public/locations
)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.
/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.
/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.
/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.
Most endpoints don’t need authentication. Only when you want to submit hike data do you need an API key.
Test API Keys:
demo-key-12345
(can read and submit data)readonly-key-67890
(can only read data)How to use API Keys: Add this header to your request:
X-API-Key: demo-key-12345
{
"success": true,
"data": { ... },
"message": "Operation successful"
}
{
"success": false,
"error": "Error type",
"message": "Detailed error message"
}
Endpoint: POST /api/public/hikes
Headers you need:
Content-Type: application/json
X-API-Key: demo-key-12345
Required information:
externalUserId
(string): Your user IDtitle
(string): Name of the hikelocation
(string): Where the hike happenedOptional information:
distance
(number): Distance in kilometerselevation
(number): Elevation gain in metersdifficulty
(string): Easy, Moderate, or Harddate
(string): When the hike happenedduration
(number): How long it took (hours)weather
(string): Weather conditionsnotes
(string): Any extra notesExample 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!"
}
http://localhost:3001/api/public/health
curl http://localhost:3001/api/public/health
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) |
Last Updated: October 2025
API Version: 1.0.0