API Documentation

This page documents the APIs available for integration with my services. The APIs are protected by a proxy system that provides authentication, rate limiting, and security features.

The API is designed with a proxy architecture that provides several benefits:

  • Security: The proxy layer handles authentication and blocks malicious requests
  • Rate Limiting: Prevents abuse by limiting request frequency
  • Simplified Access: Provides a unified interface to multiple backend services

Proxy Base URL: https://www.dev.proxy.alexanderfields.me

All API endpoints should be accessed through the proxy service directly.

Full endpoint format: https://www.dev.proxy.alexanderfields.me/[endpoint]

Swagger Documentation: https://www.dev.proxy.alexanderfields.me/swagger

These endpoints manage audio files for the website's music player functionality. Files are stored using MongoDB GridFS to handle large audio files efficiently.

EndpointMethodDescriptionAuth Required
/audio/:filenameGETRetrieves an audio file by filenameNo
/audio/uploadPOSTUploads a new audio file (multipart/form-data)Yes

Technical Details

  • Storage: Audio files are compressed with gzip before storage to save space
  • Decompression: Files are automatically decompressed when served
  • Format: Supports WAV audio files
  • Size Limit: Maximum file size is 500MB (configured in Next.js)
  • GridFS: Uses MongoDB GridFS for automatic chunking of large files

The audio files are used in the Personality and Products pages for background music.

These endpoints provide access to Google Calendar functionality with JWT-based authentication. First validate your daily code to receive a JWT token, then use that token for all calendar operations.

EndpointMethodDescriptionAuth
/api/proxy/calendar/validate-accessPOSTValidate daily code and receive JWT tokenNone
/api/proxy/calendar/eventsGETRetrieve calendar eventsBearer JWT
/api/proxy/calendar/available-slotsPOSTGet available meeting slots for a specific dateBearer JWT
/api/proxy/calendar/create-eventPOSTSchedule a meeting on the calendarBearer JWT

Authentication Flow

  1. Validate Access: POST to /api/proxy/calendar/validate-access with your daily code
    POST /api/proxy/calendar/validate-access
    {
      "code": "your-daily-code"
    }
  2. Receive JWT Token: On successful validation, you'll receive a JWT token
    {
      "success": true,
      "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
    }
  3. Use Token: Include the JWT token in the Authorization header for all subsequent requests
    Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Access Requirements

  • Valid daily code or permanent code required for initial authentication
  • JWT tokens expire after 24 hours
  • IP ban after 10 failed authentication attempts
  • Available meeting slots: 9 AM - 6 PM Eastern Time
  • Automatic Google Meet links added to events

Example: Get Available Slots

POST /api/proxy/calendar/available-slots
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

{
  "date": "2025-07-25",
  "duration": 60  // Optional, default 60 minutes
}

Example: Create Calendar Event

POST /api/proxy/calendar/create-event
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

{
  "eventData": {
    "title": "Meeting with John",
    "description": "Discuss project requirements",
    "startTime": "2025-07-25T14:00:00",
    "endTime": "2025-07-25T15:00:00",
    "attendeeEmail": "john@example.com",
    "timeZone": "America/New_York",  // Optional
    "addMeetLink": true  // Optional, default true
  }
}

Example: Get Calendar Events

GET /api/proxy/calendar/events?startDate=2025-07-01&endDate=2025-07-31
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

Protected endpoints require authentication using API keys. Improper authentication attempts may result in temporary or permanent IP bans.

Security Features

  • IP Blocking: The system maintains a blocklist of IPs that have made unauthorized attempts
  • Automatic Banning: IPs making multiple failed authentication attempts are automatically banned
  • Intrusion Detection: Attempts to access sensitive files or endpoints result in immediate IP bans

To request API access, please contact me through the Contact Page.

EndpointMethodDescriptionAuth Required
/api/proxy/bots/trading/logsGETRetrieves paginated trading bot logs (parquet format)No
/api/proxy/github-statsGETReturns GitHub language statistics with percentages and colorsNo
/api/proxy/historical-dataGETReturns list of available trading symbols with metadata and download linksNo
/api/proxy/historical-data-symbolsGETRedirects to /historical-data (deprecated)No
/api/proxy/historical-data/:symbolGETReturns metadata OR actual trading data (use ?format=json for data)No
/api/proxy/historical-data/:symbol/downloadGETDownloads the raw parquet file for a specific symbolNo
/deployment/infoGETReturns deployment timestamp and uptimeNo
/productsGETRetrieves all available productsNo
/products?type=amazonGETRetrieves Amazon marketplace listingsNo
/products?type=ebayGETRetrieves eBay marketplace listingsNo

GitHub Statistics Response Format

The /api/proxy/github-stats endpoint returns language statistics in the following JSON format:

{
  "stats": [
    {
      "name": "Java",
      "value": 33.78,
      "color": "#b07219"
    },
    {
      "name": "C#", 
      "value": 25.76,
      "color": "#178600"
    }
    // ... more languages
  ]
}
  • name: Programming language name
  • value: Percentage of code written in that language
  • color: Hex color code for visualization

Trading Bot Logs API (Parquet Format)

The /api/proxy/bots/trading/logs endpoint provides access to trading bot activity logs stored in efficient parquet format. Logs are now stored similarly to historical trading data for optimal performance and storage.

Query Parameters:

  • page: Page number (default: 1)
  • limit: Items per page (default: 50, max: 200)
  • sortBy: Field to sort by (default: 'LogMessage.timeStamp')
  • sortOrder: Sort order - 'asc' or 'desc' (default: 'desc')
  • startDate: Filter logs from this date (ISO format)
  • endDate: Filter logs until this date (ISO format)
  • messageType: Filter by message type
  • messageSource: Filter by message source

Example Request:

/api/proxy/bots/trading/logs?page=1&limit=50&messageType=ERROR

Trading Logs Response Format:

{
  "success": true,
  "data": [
    {
      "_id": "65abc123def456789",
      "LogMessage": {
        "timeStamp": "2025-07-11T10:30:45.123Z",
        "messageSource": "TradingEngine",
        "localOperationName": "ProcessOrder",
        "messageType": "INFO",
        "message": "Order processed successfully"
      }
    }
    // ... more log entries
  ],
  "pagination": {
    "currentPage": 1,
    "totalPages": 20,
    "totalItems": 1000,
    "itemsPerPage": 50,
    "hasNextPage": true,
    "hasPrevPage": false
  }
}

Historical Trading Data API (Parquet Format)

Historical trading data is stored in efficient parquet format for optimal performance and storage. The API provides three main endpoints for accessing this data:

  • /api/proxy/historical-data: Get list of all available symbols with metadata
  • /api/proxy/historical-data/:symbol: Get metadata for a specific symbol
  • /api/proxy/historical-data/:symbol/download: Download raw parquet file
  • /api/proxy/historical-data/:symbol/csv: Stream data as CSV format

Example Requests:

  • /api/proxy/historical-data - List all symbols
  • /api/proxy/historical-data/SPY - Get SPY metadata only
  • /api/proxy/historical-data/SPY?format=json - Get SPY actual trading data
  • /api/proxy/historical-data/SPY?format=json&page=2&limit=100 - Get page 2 of SPY data
  • /api/proxy/historical-data/SPY/download - Download SPY parquet file
  • /api/proxy/historical-data/SPY/csv - Stream SPY data as CSV

Symbols List Response Format:

Endpoint: /api/proxy/historical-data

{
  "success": true,
  "symbols": [
    {
      "symbol": "A",
      "lastUpdated": "2025-07-11T14:54:26.818Z",
      "rowCount": 264,
      "startDate": "2024-12-23T09:00:00.000Z",
      "endDate": "2025-02-05T17:00:00.000Z",
      "dataSize": 15670,
      "downloadUrl": "/api/historical-data/A/download"
    },
    {
      "symbol": "AA",
      "lastUpdated": "2025-07-11T14:54:48.089Z",
      "rowCount": 315,
      "startDate": "2024-12-23T11:00:00.000Z",
      "endDate": "2025-01-29T13:00:00.000Z",
      "dataSize": 17472,
      "downloadUrl": "/api/historical-data/AA/download"
    }
    // ... more symbols
  ],
  "count": 1174
}

Single Symbol Response Formats:

Endpoint: /api/proxy/historical-data/:symbol

Default (Metadata Only):
{
  "success": true,
  "symbol": "SPY",
  "metadata": {
    "format": "parquet-v1",
    "lastUpdated": "2024-12-23T09:00:00.000Z",
    "rowCount": 201,
    "startDate": "2024-01-01T00:00:00.000Z",
    "endDate": "2024-12-23T23:59:59.000Z",
    "dataSize": 8881
  },
  "downloadUrl": "/api/historical-data/SPY/download"
}
With format=json (Actual Trading Data):

Request: /api/proxy/historical-data/SPY?format=json&page=1&limit=100

Query Parameters:

  • format=json - Required to get actual data instead of metadata
  • page - Page number (default: 1)
  • limit - Records per page (default: 500, max: 500)
  • sortOrder - 'asc' or 'desc' by date (default: desc)
{
  "success": true,
  "data": [
    {
      "symbol": "SPY",
      "timeUtc": "2025-01-14T19:00:00.000Z",
      "open": 456.78,
      "high": 457.89,
      "low": 455.67,
      "close": 456.34,
      "volume": 1234567,
      "vwap": 456.45,
      "tradeCount": 12345,
      "exchange": "US",
      "otc": false
    }
    // ... more data points
  ],
  "pagination": {
    "currentPage": 1,
    "totalPages": 3,
    "totalItems": 201,
    "itemsPerPage": 100,
    "hasNextPage": true,
    "hasPrevPage": false
  }
}

Response Fields Explanation:

  • symbol: Trading symbol (e.g., SPY, AAPL)
  • lastUpdated: When the data was last updated
  • rowCount: Number of data points in the parquet file
  • startDate/endDate: Date range of the data
  • dataSize: Size of the parquet file in bytes
  • downloadUrl: Direct download link for the parquet file

Parquet File Download:

Endpoint: /api/proxy/historical-data/:symbol/download

Returns the raw parquet file as binary data with appropriate headers:

  • Content-Type: application/octet-stream
  • Content-Disposition: attachment; filename="SYMBOL_historical_data.parquet"
  • Content-Length: Size of the file in bytes

These files can be opened with any parquet-compatible tool (Python pandas, Apache Arrow, etc.).

CSV Data Streaming:

Endpoint: /api/proxy/historical-data/:symbol/csv

For browser-friendly data access, this endpoint converts parquet data to CSV format on-the-fly. Perfect for frontend applications that need to process large datasets without complex parquet parsing libraries.

  • Content-Type: text/csv
  • Content-Disposition: attachment; filename="SYMBOL_historical_data.csv"
  • Format: Standard CSV with headers
CSV Format Example:
symbol,timeUtc,open,high,low,close,volume,vwap,tradeCount,exchange,otc
SPY,2023-07-14T13:30:00.000Z,438.72,439.66,438.51,438.75,13723707,0,137237,US,false
SPY,2023-07-14T14:30:00.000Z,438.75,439.04,437.87,438.72,10988957,0,109889,US,false
SPY,2023-07-14T15:30:00.000Z,438.72,439.13,438.06,438.09,7679355,0,76793,US,false

Benefits: Easy to parse in JavaScript, smaller than JSON, streamable for large datasets, compatible with all browsers and data processing tools.

These endpoints manage daily codes that are generated automatically each day at 9 AM Eastern Time. All daily code endpoints require authentication.

EndpointMethodDescription
/api/proxy/daily-code/currentGETReturns the current daily code (admin only)
/api/proxy/daily-code/usePOSTMarks a code as used by a specific user
/api/proxy/daily-code/validatePOSTValidates if a code is valid and unused
/api/proxy/resume/downloadPOSTDownloads Alexander's resume PDF after code validation (auth handled internally)

Daily Code Object Format

Daily codes are alphanumeric strings between 5-15 characters:

{
  "success": true,
  "code": "aBc123XyZ",
  "date": "Wed Jul 22 2025"
}

Validation Request Format

To validate a code, send a POST request with:

{
  "code": "aBc123XyZ"
}

Use Code Request Format

To mark a code as used, send a POST request with:

{
  "code": "aBc123XyZ",
  "usedBy": "user@example.com"
}

Daily codes are automatically generated each day and included in the 9 AM issues report email.

Resume Download Request Format

To download the resume, send a POST request with a valid code:

POST /api/proxy/resume/download
{
  "code": "aBc123XyZ"
}

Success Response: Returns a PDF file with appropriate headers:

  • Content-Type: application/pdf
  • Content-Disposition: attachment; filename="Alexander-Fields-Resume.pdf"

Error Responses:

  • 400: Code is required
  • 401: Invalid or already used code
  • 404: Resume file not found
  • 502: Backend error

These endpoints provide access to authenticated GitHub data. All endpoints in this section require API authentication.

EndpointMethodDescription
/api/proxy/github-issuesGETReturns all GitHub issues assigned to the authenticated user

GitHub Issues Response Format

The /api/proxy/github-issues endpoint returns comprehensive issue data:

{
  "total_count": 15,
  "open_count": 10,
  "closed_count": 5,
  "issues_by_repository": {
    "owner/repo-name": {
      "repository": {
        "name": "repo-name",
        "full_name": "owner/repo-name",
        "owner": "owner",
        "html_url": "https://github.com/owner/repo-name",
        "private": true
      },
      "issues": [
        {
          "number": 123,
          "title": "Issue title",
          "state": "open",
          "html_url": "https://github.com/owner/repo-name/issues/123",
          "created_at": "2025-07-01T12:00:00Z",
          "updated_at": "2025-07-07T15:30:00Z",
          "closed_at": null,
          "labels": [
            {
              "name": "bug",
              "color": "d73a4a",
              "description": "Something isn't working"
            }
          ],
          "milestone": {
            "title": "v1.0",
            "due_on": "2025-08-01T00:00:00Z"
          },
          "pull_request": false
        }
      ]
    }
  },
  "summary": {
    "total_repositories": 8,
    "retrieved_at": "2025-07-07T16:45:00Z"
  }
}
  • total_count: Total number of issues assigned to you
  • open_count: Number of open issues
  • closed_count: Number of closed issues
  • issues_by_repository: Issues grouped by repository with full issue details
  • summary: Summary information including total repositories and retrieval timestamp

This endpoint fetches issues from all repositories you have access to, including personal repos and organization repos.

These endpoints manage dynamic hyperlinks used throughout the website. Links can be updated in the database without modifying code. Only modification endpoints (POST/PUT/DELETE) require authentication.

EndpointMethodDescriptionAuth Required
/api/proxy/hyperlinksGETRetrieves all hyperlinksNo
/api/proxy/hyperlinksPOSTCreates a new hyperlinkYes
/api/proxy/hyperlinks/:idDELETEDeletes a hyperlinkYes
/api/proxy/hyperlinks/:idGETRetrieves a specific hyperlink by IDNo
/api/proxy/hyperlinks/:idPUTUpdates an existing hyperlinkYes

Hyperlink Object Format

Each hyperlink object contains the following fields:

{
  "_id": "microcenter_pc_build",
  "link": "https://www.microcenter.com/...",
  "description": "Alexander's desired PC build",
  "category": "personal",
  "lastUpdated": "2025-07-08T19:39:21.974Z"
}
  • _id: Unique identifier for the hyperlink (e.g., "github_profile", "paypal_support")
  • link: The actual URL
  • description: Human-readable description of the link
  • category: Link category (personal, social, support, charity)
  • lastUpdated: Timestamp of last modification

Currently managed hyperlinks include social media profiles, donation links, and personal project links.

These endpoints allow authorized users to manage Minecraft server settings and backups. All Minecraft endpoints require authentication.

Server Configuration

EndpointMethodDescription
/games/minecraft/operatorsGETGets server operators
/games/minecraft/operatorsPOSTUpdates server operators
/games/minecraft/whitelistGETGets the server whitelist
/games/minecraft/whitelistPOSTUpdates the server whitelist

World Save Management

EndpointMethodDescription
/games/minecraft/savePOSTUploads a new world save
/games/minecraft/save/:fileIdDELETEDeletes a specific save
/games/minecraft/save/:fileIdGETDownloads a specific world save
/games/minecraft/save/keep/:countDELETEKeeps only the specified number of recent saves
/games/minecraft/save/older-than/:amountDELETEDeletes saves older than a specified age
/games/minecraft/savesGETGets all world saves

These endpoints allow for automated backup and restoration of Minecraft worlds.

These endpoints facilitate payment processing through PayPal integration:

EndpointMethodDescription
/paypal/create-orderPOSTCreates a new PayPal payment order
/paypal/capture-orderPOSTCaptures (finalizes) a PayPal payment

These endpoints are primarily used by the shopping cart system on this website.

These endpoints allow authorized users to manage Minecraft server settings and backups. All Minecraft endpoints require authentication.

Server Configuration

EndpointMethodDescription
/games/minecraft/operatorsGETGets server operators
/games/minecraft/operatorsPOSTUpdates server operators
/games/minecraft/whitelistGETGets the server whitelist
/games/minecraft/whitelistPOSTUpdates the server whitelist

World Save Management

EndpointMethodDescription
/games/minecraft/savePOSTUploads a new world save
/games/minecraft/save/:fileIdDELETEDeletes a specific save
/games/minecraft/save/:fileIdGETDownloads a specific world save
/games/minecraft/save/keep/:countDELETEKeeps only the specified number of recent saves
/games/minecraft/save/older-than/:amountDELETEDeletes saves older than a specified age
/games/minecraft/savesGETGets all world saves

These endpoints allow for automated backup and restoration of Minecraft worlds.

To prevent abuse, the API enforces rate limits on requests. Exceeding these limits may result in temporary blocking.

Default rate limit: 45 requests per minute per IP address.

If you need higher rate limits for a legitimate application, please contact me through the Contact Page.

© 2025 Alexander Fields. All rights reserved. If you want to see the code request access @ GitHub