Introduction

The Crystal Cave Physics API provides programmatic access to our booking systems, tour information, membership management, and real-time cave monitoring data. Our REST API returns JSON responses and uses standard HTTP status codes.

Base URL

All API requests should be made to:

https://api.crystalcave.physics/v1

API Versioning

Our API is versioned to ensure stability. The current version is v1. We maintain backwards compatibility within major versions and provide at least 12 months notice before deprecating any endpoint.

Authentication

Authentication to the Crystal Cave Physics API is performed using API keys. Include your API key in the Authorization header of all requests.

HEADER Authorization: Bearer cc_live_xxxxxxxxxxxxx
Parameter Type Description
Authorization string Bearer token containing your API key
Content-Type string Must be application/json

Quick Start Guide

Get up and running with the Crystal Cave Physics API in minutes. Follow these steps to make your first API request.

Step 1: Get Your API Key

Sign in to your dashboard and navigate to Settings → API Keys. Generate a new key and store it securely. Never expose your API key in client-side code.

Step 2: Make Your First Request

Fetch available tour times using a simple GET request:

curl -X GET https://api.crystalcave.physics/v1/tours \
  -H "Authorization: Bearer cc_live_xxxxxxxxxxxxx" \
  -H "Content-Type: application/json"

Step 3: Parse the Response

A successful response returns a JSON object with tour data:

{
  "data": [
    {
      "id": "tour_abc123",
      "name": "Amethyst Cathedral Tour",
      "duration": "90 minutes",
      "available_slots": 12,
      "price": 45.00
    }
  ],
  "meta": {
    "total": 24,
    "page": 1
  }
}

Bookings API

Create, manage, and track bookings for cave tours and experiences.

POST /bookings

Create a new booking with guest details and tour selection:

Parameter Type Description
tour_id string Unique identifier of the tour
date string ISO 8601 date format (YYYY-MM-DD)
guests integer Number of guests (1-15)
email string Contact email for confirmation