# games.gamesgamesgamesgames.putPopularity

> Published by [trezy.codes](https://lexicon.garden/identity/did:plc:4jrld6fwpnwqehtce56qshzv)

## Links

- [View on Lexicon Garden](https://lexicon.garden/lexicon/did:plc:4jrld6fwpnwqehtce56qshzv/games.gamesgamesgamesgames.putPopularity)
- [Documentation](https://lexicon.garden/lexicon/did:plc:4jrld6fwpnwqehtce56qshzv/games.gamesgamesgamesgames.putPopularity/docs)
- [Examples](https://lexicon.garden/lexicon/did:plc:4jrld6fwpnwqehtce56qshzv/games.gamesgamesgamesgames.putPopularity/examples)

## Definitions

### `games.gamesgamesgamesgames.putPopularity`

**Type**: `procedure`

Upsert game popularity data (concurrent player counts). Requires admin auth.

#### Input

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `games` | `array` | Yes | List of games with popularity data to upsert. |

#### Output

**Encoding**: `application/json`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `upserted` | `integer` | Yes | Number of records upserted. |

### `games.gamesgamesgamesgames.putPopularity#gamePopularity`

**Type**: `object`

| Property | Type | Required | Description |
|----------|------|----------|-------------|
| `ccu` | `integer` | Yes | Concurrent player count. |
| `steamId` | `string` | Yes | Steam app ID. |

## Raw Schema

```json
{
  "id": "games.gamesgamesgamesgames.putPopularity",
  "defs": {
    "main": {
      "type": "procedure",
      "input": {
        "schema": {
          "type": "object",
          "required": [
            "games"
          ],
          "properties": {
            "games": {
              "type": "array",
              "items": {
                "ref": "#gamePopularity",
                "type": "ref"
              },
              "description": "List of games with popularity data to upsert."
            }
          }
        },
        "encoding": "application/json"
      },
      "output": {
        "schema": {
          "type": "object",
          "required": [
            "upserted"
          ],
          "properties": {
            "upserted": {
              "type": "integer",
              "description": "Number of records upserted."
            }
          }
        },
        "encoding": "application/json"
      },
      "description": "Upsert game popularity data (concurrent player counts). Requires admin auth."
    },
    "gamePopularity": {
      "type": "object",
      "required": [
        "steamId",
        "ccu"
      ],
      "properties": {
        "ccu": {
          "type": "integer",
          "minimum": 0,
          "description": "Concurrent player count."
        },
        "steamId": {
          "type": "string",
          "description": "Steam app ID."
        }
      }
    }
  },
  "$type": "com.atproto.lexicon.schema",
  "lexicon": 1
}
```
