API Documentation

Access the Code to Adventure API to retrieve referral codes.

Overview

The Code to Adventure API provides programmatic access to referral codes. All requests must use HTTPS.

Base URL: https://codetoadventure.com/api.php

Authentication

Currently, the API uses IP-based rate limiting and does not require authentication.

Endpoints

1. Fetch Random Referral Code

GET /api.php?path=random

Example Response:

{
    "name": "John Doe",
    "username": "johndoe123",
    "referral_code": "ABC123",
    "link": "https://rivian.com/configurations/list?reprCode=ABC123"
}

2. Fetch All Referral Codes

GET /api.php?path=codes

Example Response:

[
    {
        "name": "John Doe",
        "username": "johndoe123",
        "referral_code": "ABC123",
        "link": "https://rivian.com/configurations/list?reprCode=ABC123"
    }
]

Rate Limiting

Limits: 100 requests per minute per IP address.

Response Headers:

X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1635789600

Error Responses

{
    "error": {
        "code": "ERROR_CODE",
        "message": "Human readable message"
    }
}

HTTP Status Codes

  • 200 - Success
  • 404 - Not Found
  • 429 - Rate Limit Exceeded
  • 500 - Server Error

Caching

Responses are cached for 5 minutes. Use the ETag header for conditional requests.