> ## Documentation Index
> Fetch the complete documentation index at: https://docs.seraph.si/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch Minecraft Player Data

> Retrieves a Minecraft player's UUID by username or username by UUID. The function utilizes a caching mechanism for performance and stores fetched player data in the database.



## OpenAPI

````yaml https://stash.seraph.si/json get /mojang/{player}
openapi: 3.1.0
info:
  contact:
    email: support@seraph.si
    name: API Support
    url: https://discord.gg/seraph
  title: Seraph API
  version: '4.0'
servers: []
security: []
externalDocs:
  description: ''
  url: ''
paths:
  /mojang/{player}:
    get:
      tags:
        - Mojang
        - Player
      summary: Fetch Minecraft Player Data
      description: >-
        Retrieves a Minecraft player's UUID by username or username by UUID. The
        function utilizes a caching mechanism for performance and stores fetched
        player data in the database.
      parameters:
        - description: Minecraft player username or UUID
          in: path
          name: player
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/minecraft.MojangResponse'
          description: Successfully retrieved player data
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/validation.ErrorResponse'
          description: Bad request, e.g., invalid Minecraft username or UUID format
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/validation.ErrorResponse'
          description: >-
            Internal server error, e.g., issues with database or external Mojang
            API
components:
  schemas:
    minecraft.MojangResponse:
      properties:
        errorMessage:
          type: string
        id:
          type: string
        name:
          type: string
        path:
          type: string
      type: object
    validation.ErrorResponse:
      properties:
        cause:
          type: string
        code:
          type: integer
        documentation:
          type: string
        extra:
          items:
            $ref: '#/components/schemas/validation.ErrorObject'
          type: array
          uniqueItems: false
        msTime:
          type: integer
        success:
          type: boolean
      type: object
    validation.ErrorObject:
      properties:
        code:
          type: integer
        developer_reason:
          type: string
        name:
          type: string
        reason:
          type: string
      type: object

````