Chastity Tracker API Documentation: User data

  1. πŸ” Authentication

    All API requests must be authenticated via https using a bearer token.

    Generating a Token

    • Users can generate a secure API token from their profile page.
    • Tokens are shown only once and must be stored securely.
    • Only hashed versions are stored on the server.

    Usage

    URL

    https://www.chastitytracker.org

    HEADER

    GET /api/userstats.php HTTP/2
    Host: www.chastitytracker.org
    Authorization: Bearer {YOUR_API_TOKEN}
  2. πŸ“Œ Endpoint: GET /api/userstats.php

    Returns json formatted public profile data for the user associated with the token.

    Response Example

    {
      "nick":"alescan",
      "profile_url":"localhost\/pprofile.php?user=alescan",
      "locked":true,
      "current_lock_start":"2025-03-23 09:00:00 UTC",
      "scheduled_end":null,
      "current_lock_time":"1 months 18 days 10 hours",
      "total_locked_since":"4 months 10 days 9 hours",
      "since_date":"2025-01-01 00:00:00",
      "link_game":null,
      "last_full":"2025-03-23",
      "last_ruined":"2025-02-09",
      "last_ted":"2025-04-06",
      "last_milking":null
    }
  3. Possible Fields

    Errors

    {
      "error": {One of the following}
    }

    Status Codes

  4. ⚠️ Security Notes

    • Tokens must be stored securely by third parties.
    • Users can revoke or regenerate tokens at any time.
    • Never share a user’s token or sensitive info.
  5. πŸ“… Changelog

    • 2025-05-09: Initial public API version released
    • 2025-06-06: Removed "Connection: close" requirement and updated returned status codes

To go back to documentation index click here.