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

# Get Player

> Read one player, identified or anonymous: the Players list row, the browsers and game installs, and the traits with the source of each.

Returns one player. This endpoint needs the `profiles:read` scope.

The `playerKey` is `user:<user_id>` for an identified player (the user ID that you send with `identify`), or `anon:<anonymous_id>` for an anonymous one. URL-encode it, for example `user%3Aplayer_42`. An anonymous ID that links to exactly one user returns that user, so `player_key` in the response is the canonical key.

The optional `date_from`, `date_to`, and `currency` parameters set the range and the currency of the `player` row.

| Field | Notes |
| - | - |
| `player_key` | The canonical player key |
| `kind` | `identified` or `anonymous` |
| `player` | The row of the [Players](https://docs.manalens.dev/features/players.md) list in the date range, or `null` when the player has no page view or custom event in the range |
| `anonymous_ids` | The browsers and game installs of the player, with `first_seen` and `last_seen` over all time, `game`, and `shared` (1 for an ID that more than one user identified on) |
| `traits` | The merged traits of the player: from `identify` and [`traits`](https://docs.manalens.dev/data/events/traits) events, the [player traits API](https://docs.manalens.dev/api/players/update-traits.md), and dashboard edits. For an identified player, the user trait wins; otherwise the newest anonymous trait across the player's browsers and game installs. A shared device gives its anonymous traits to none of its users. |
| `trait_sources` | One entry per trait: `{ "source", "scope", "updated_at" }`. `source` is the channel of the value (`web`, `app`, `server`, `api` or `dashboard`). `scope` is `user`, or `anonymous` for a trait set before sign-in. |
| `profile_first_seen_at`, `profile_updated_at` | When the traits were first written and last changed |

The response is `404` `NOT_FOUND` when the project has no such player. A trait write shows here after a few seconds.


## OpenAPI

````yaml GET /v0/projects/{projectId}/query/players/{playerKey}
openapi: 3.1.0
info:
  title: Manalens API
  version: 0.1.0
  description: >-
    The public API of Manalens: event ingestion, Steam account links, player
    traits and the Query API. Success bodies are the resource, with no envelope.
    Errors use the `Error` format. See https://docs.manalens.dev/api/overview.
servers:
  - url: https://api.manalens.dev
    description: API
  - url: https://events.manalens.dev
    description: Event ingestion
security: []
tags:
  - name: Events
    description: Send website, game and server events
  - name: Accounts
    description: Link the Steam account of a player to the game install
  - name: Players
    description: Set and delete the traits of identified players
  - name: Query
    description: Read analytics reports with an API key
paths:
  /v0/projects/{projectId}/query/players/{playerKey}:
    get:
      tags:
        - Query
      summary: Get player
      description: >-
        One player, identified or anonymous: the Players list row in the date
        range, the linked browsers and game installs, and the traits of the
        player with the source of each value. 404 when the project has no such
        player.
      operationId: getPlayer
      parameters:
        - name: projectId
          in: path
          required: true
          description: The project ID
          schema:
            type: string
            format: uuid
        - name: playerKey
          in: path
          required: true
          description: >-
            user:<user_id> (the user ID that you send with identify) or
            anon:<anonymous_id>. URL-encode it.
          schema:
            type: string
            minLength: 6
            maxLength: 260
        - $ref: '#/components/parameters/date_from'
        - $ref: '#/components/parameters/date_to'
        - $ref: '#/components/parameters/currency'
      responses:
        '200':
          description: The player
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Player'
        '400':
          description: >-
            `INVALID_QUERY`: a parameter or the body is not valid. The message
            names the problem.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: >-
            `UNAUTHORIZED`: the API key is missing, malformed, unknown or
            revoked
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            `SUBSCRIPTION_REQUIRED`: the workspace has no active subscription or
            trial. `PLAN_UPGRADE_REQUIRED`: API keys need the Studio plan
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            `FORBIDDEN`: the key does not have the scope, its creator left the
            workspace, or the request came from a browser.
            `WORKSPACE_SUSPENDED`: the workspace is suspended.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            `NOT_FOUND`: the key belongs to another project, or the resource
            does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: '`TOO_MANY_REQUESTS`: the key or workspace budget is used up'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
          headers:
            Retry-After:
              description: Seconds to wait before a retry
              schema:
                type: integer
            RateLimit-Limit:
              description: The limit of the window, when it is known
              schema:
                type: integer
            RateLimit-Policy:
              description: '`<limit>;w=<window seconds>`, when the limit is known'
              schema:
                type: string
            RateLimit-Remaining:
              description: Always 0 on a 429
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the window resets (the same as Retry-After)
              schema:
                type: integer
        '500':
          description: '`INTERNAL`: an unexpected error. The body has a `request_id`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKey: []
components:
  parameters:
    date_from:
      name: date_from
      in: query
      required: false
      description: 'First day (UTC) as YYYY-MM-DD. Default: 29 days before date_to.'
      schema:
        type: string
        pattern: ^\d{4}-\d{2}-\d{2}$
    date_to:
      name: date_to
      in: query
      required: false
      description: >-
        Last day (UTC) as YYYY-MM-DD. Default: today. The range is at most 367
        days.
      schema:
        type: string
        pattern: ^\d{4}-\d{2}-\d{2}$
    currency:
      name: currency
      in: query
      required: false
      description: 'Report currency for revenue (ISO 4217). Default: USD.'
      schema:
        type: string
        pattern: ^[A-Z]{3}$
  schemas:
    Player:
      type: object
      properties:
        player_key:
          type: string
          description: >-
            The canonical player key: user:<user_id>, or anon:<anonymous_id>. An
            anonymous ID that links to exactly one user returns that user
        kind:
          type: string
          enum:
            - identified
            - anonymous
        player:
          anyOf:
            - type: object
              propertyNames:
                type: string
              additionalProperties: {}
            - type: 'null'
          description: >-
            The Players list row in the date range: first and last seen,
            lifecycle stage, sessions, playtime_seconds, revenue, active days,
            devices, and lifetime first and last acquisition touch. Null when
            the player has no page or custom event in the range
        anonymous_ids:
          type: array
          items:
            type: object
            propertyNames:
              type: string
            additionalProperties: {}
          description: >-
            The browsers and game installs of the player, with first and last
            seen over all time. shared 1 marks an ID that more than one user
            identified on
        traits:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            type:
              - string
              - number
              - boolean
              - 'null'
          description: >-
            The traits of the player: a user trait (identify, the traits API)
            wins, else the newest anonymous trait (traits events of the player's
            browsers and game installs)
        trait_sources:
          type: object
          propertyNames:
            type: string
          additionalProperties:
            type: object
            properties:
              source:
                type: string
                description: >-
                  The event channel of the value: web, app, server, api,
                  dashboard, ...
              scope:
                type: string
                enum:
                  - user
                  - anonymous
              updated_at:
                type: string
            required:
              - source
              - scope
              - updated_at
          description: Where each trait value came from
        accounts:
          type: array
          items:
            type: object
            properties:
              provider:
                type: string
                description: steam, discord, itch, epic or gog
              verified:
                type: boolean
                description: >-
                  True when the game proved the account (a Steam ticket checked
                  with Steam). False for a claimed steam_id or discord_id trait
              method:
                type: string
                description: >-
                  ticket (verified in the game), claimed (from a trait), openid,
                  oauth or import
              linked_at:
                type: string
              verified_at:
                type:
                  - string
                  - 'null'
              account_id:
                description: The account ID. Never a SteamID64 here
                type: string
            required:
              - provider
              - verified
              - method
              - linked_at
              - verified_at
          description: Store and community accounts linked to the player
        products:
          type: array
          items:
            type: object
            properties:
              provider:
                type: string
              product_id:
                type: string
                description: The Steam App ID
              name:
                type: string
              role:
                type: string
                enum:
                  - base
                  - demo
                  - dlc
                  - soundtrack
                  - other
              owns:
                type: boolean
              license:
                type: string
                enum:
                  - permanent
                  - borrowed
                  - trial
                  - temporary
                  - site
                  - none
                description: >-
                  borrowed: Steam Family Sharing; trial: a timed trial;
                  temporary: owned but not permanent (a developer comp licence,
                  a free weekend or a beta key); site: a PC cafe licence
              owned_since:
                type:
                  - string
                  - 'null'
              checked_at:
                type: string
                description: When Steam was last asked (at a verified link)
            required:
              - provider
              - product_id
              - name
              - role
              - owns
              - license
              - owned_since
              - checked_at
          description: What the verified Steam account owns of the project's apps
        profile_first_seen_at:
          type:
            - string
            - 'null'
        profile_updated_at:
          type:
            - string
            - 'null'
      required:
        - player_key
        - kind
        - player
        - anonymous_ids
        - traits
        - trait_sources
        - accounts
        - products
        - profile_first_seen_at
        - profile_updated_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: A stable, machine-readable code. Branch on it.
            message:
              type: string
              description: A human-readable text. The wording can change.
            request_id:
              description: 'INTERNAL only: quote it when you contact support'
              type: string
            issues:
              description: 'INVALID_EVENT only: up to five validation issues'
              type: array
              items:
                type: object
                properties:
                  path:
                    type: string
                    description: Where the problem is, such as `events.0.properties`
                  message:
                    type: string
                    description: What is wrong, such as `at most 50 keys`
                required:
                  - path
                  - message
            refused:
              description: >-
                INVALID_EVENT when no event of the batch is accepted: each
                refused event (the same list as `errors`, kept for SDKs that
                read it here)
              type: array
              items:
                type: object
                properties:
                  index:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: The position of the event in the batch
                  message_id:
                    description: The message_id of the event, or null when it has none
                    type:
                      - string
                      - 'null'
                  code:
                    type: string
                    description: >-
                      The reason code, such as `INVALID_EVENT`,
                      `SESSION_ID_REQUIRED` or `FORBIDDEN`
                  message:
                    type: string
                    description: 'What is wrong, such as `properties: at most 50 keys`'
                required:
                  - index
                  - message_id
                  - code
                  - message
            results:
              description: 'INVALID_TRAITS of a batch trait update: the result of each item'
              type: array
              items:
                type: object
                properties:
                  index:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  user_id:
                    type: string
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                      message:
                        type: string
                    required:
                      - code
                      - message
                required:
                  - index
            feature:
              description: >-
                PLAN_UPGRADE_REQUIRED only: the plan feature that the request
                needs
              type: string
            billing_url:
              description: 'PLAN_UPGRADE_REQUIRED only: the billing page of the workspace'
              type: string
          required:
            - code
            - message
      required:
        - error
      description: >-
        The error format of every endpoint. See
        https://docs.manalens.dev/api/errors.
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: >-
        An API key (`mana_api_...`) with scopes. It reads reports and writes
        player traits.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.