> ## 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 Installs

> Read game installs by the channel, source, or campaign that brought the players, with the revenue of those players.

Returns one row per group with `installs`, `payers`, and `revenue`. This endpoint needs the `attribution:read` scope. It is the table of **Attribution**, **Installs**. See [install attribution](https://docs.manalens.dev/attribution/installs.md) for how an install is matched to a website visit.

* An install is the first `game_open` with `is_first_open: true` in the date range.
* A certain link comes first: the same user ID on the website and in the game, a cross-domain link, or a browser game. Then the Google Play install referrer of an Android install. Else the network match is used.
* `group_by` is `channel_type` (the acquisition channel), `source` (the default), `medium`, `campaign`, `content`, `paid_source`, `referrer`, `ref`, or `click_id`.
* `model` is `last_non_direct` (the default), `first_touch`, `last_touch`, `linear`, `position_based`, or `time_decay` (with `half_life_days`, 1 to 30, default 7). The multi-touch models split each install over its touches, so `installs`, `payers`, and `revenue` can be fractional.
* `min_confidence` is `low` (the default), `medium`, or `high`. Weaker network matches are `(unattributed)`.
* `(unattributed)` is an install with no website visit in the lookback.

## Revenue

`revenue` is the net revenue of the players of the installs in the group. It runs from the first install of each player to `date_to`, in `currency` (default USD). `payers` counts the players with revenue.

* A player with payment records (Stripe, Paddle, or itch.io) counts those records. A refund subtracts.
* Else the `revenue` property of the player's own events counts.
* A player with two installs in the date range counts under the first install.

To see which channels bring players who keep playing, use [Get Retention](https://docs.manalens.dev/api/query/retention.md) with `breakdown=install_channel_type`.


## OpenAPI

````yaml GET /v0/projects/{projectId}/query/installs
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, player deletes 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/installs:
    get:
      tags:
        - Query
      summary: Get installs
      description: >-
        Game installs (first opens) by the website touch that brought the
        player, with the players of those installs who paid and their net
        revenue from the install to date_to. A certain link (the same user ID, a
        cross-domain link, or a browser game) comes first, then the network
        match. An install with no credited touch is (unattributed).
      operationId: getInstalls
      parameters:
        - name: projectId
          in: path
          required: true
          description: The project ID
          schema:
            type: string
            format: uuid
        - $ref: '#/components/parameters/date_from'
        - $ref: '#/components/parameters/date_to'
        - name: model
          in: query
          required: false
          description: >-
            Default: last_non_direct. linear, position_based and time_decay
            split each install over the touches of its visitor, so installs,
            payers and revenue can be fractional.
          schema:
            type: string
            enum:
              - first_touch
              - last_touch
              - last_non_direct
              - linear
              - position_based
              - time_decay
        - name: group_by
          in: query
          required: false
          description: 'Default: source. channel_type is the acquisition channel.'
          schema:
            type: string
            enum:
              - channel_type
              - source
              - medium
              - campaign
              - content
              - paid_source
              - referrer
              - ref
              - click_id
        - name: lookback_days
          in: query
          required: false
          description: >-
            Days before the install that a page view can get credit: 1 to 365.
            Default: 30.
          schema:
            type: string
            pattern: ^\d{1,3}$
        - name: half_life_days
          in: query
          required: false
          description: 'time_decay only: 1 to 30. Default: 7.'
          schema:
            type: string
            pattern: ^\d{1,2}(\.\d+)?$
        - name: min_confidence
          in: query
          required: false
          description: >-
            The weakest network match that counts: low (default), medium or
            high. Weaker matches are (unattributed).
          schema:
            type: string
            enum:
              - low
              - medium
              - high
        - name: app_platform
          in: query
          required: false
          schema:
            type: string
            pattern: ^[a-z0-9_-]{1,32}$
        - name: app_storefront
          in: query
          required: false
          schema:
            type: string
            pattern: ^[a-z0-9_-]{1,32}$
        - $ref: '#/components/parameters/country'
        - $ref: '#/components/parameters/currency'
        - $ref: '#/components/parameters/currency_mode'
      responses:
        '200':
          description: The report
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportRows'
        '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 Scale 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}$
    country:
      name: country
      in: query
      required: false
      description: ISO 3166-1 alpha-2 country code
      schema:
        type: string
        pattern: ^[A-Za-z]{2}$
    currency:
      name: currency
      in: query
      required: false
      description: 'Report currency for revenue (ISO 4217). Default: USD.'
      schema:
        type: string
        pattern: ^[A-Z]{3}$
    currency_mode:
      name: currency_mode
      in: query
      required: false
      description: >-
        `convert` (default) converts other currencies with the rate of the event
        day. `only` counts the report currency alone.
      schema:
        type: string
        enum:
          - convert
          - only
  schemas:
    ReportRows:
      type: object
      properties:
        date_from:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
          description: First day of the report
        date_to:
          type: string
          pattern: ^\d{4}-\d{2}-\d{2}$
          description: Last day of the report
        rows:
          type: array
          items:
            type: object
            propertyNames:
              type: string
            additionalProperties: {}
      required:
        - date_from
        - date_to
        - rows
    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.