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

# Find Lobbies

> Find all the lobbies that match certain criteria.

Allowed entity token types: game_server, title_player_account

## Error codes

This operation may return the following PlayFab errors:

| Error | Code |
| --- | --- |
| LobbyBadRequest | 13007 |
| LobbyRateLimitExceeded | 13001 |




## OpenAPI

````yaml /services/playfab/api-references/rest/multiplayer/multiplayer.openapi.json post /Lobby/FindLobbies
openapi: 3.0.0
info:
  version: '260922'
  title: PlayFab Multiplayer API
  description: >-
    API methods for managing multiplayer servers. API methods for managing
    parties. The lobby service helps players group together to play multiplayer
    games. It is often used as a rendezvous point for players to share
    connection information. The TrueSkill service helps titles to estimate a
    player's skill based on their match results. The player skill values from
    this service are commonly used by a matchmaking service to provide players
    with balanced matches.
  termsOfService: https://playfab.com/terms/
  contact:
    url: https://community.playfab.com/index.html
  license:
    name: Apache 2.0
    url: https://github.com/PlayFab/API_Specs/blob/master/LICENSE
servers:
  - url: https://{titleId}.playfabapi.com
    description: PlayFab title endpoint
    variables:
      titleId:
        default: your_title_id
        description: Your PlayFab title ID (hex).
security: []
tags:
  - name: Lobby
    description: ''
  - name: Matchmaking
    description: Matchmaking APIs
  - name: Matchmaking Admin
    description: Matchmaking Admin APIs
  - name: MultiplayerServer
    description: Multiplayer Server APIs
  - name: PubSub
    description: PlayFab PubSub APIs
  - name: TrueSkill
    description: TrueSkill APIs
  - name: TrueSkill Admin
    description: TrueSkill Admin APIs
paths:
  /Lobby/FindLobbies:
    post:
      tags:
        - Lobby
      summary: Find Lobbies
      description: |
        Find all the lobbies that match certain criteria.

        Allowed entity token types: game_server, title_player_account

        ## Error codes

        This operation may return the following PlayFab errors:

        | Error | Code |
        | --- | --- |
        | LobbyBadRequest | 13007 |
        | LobbyRateLimitExceeded | 13001 |
      operationId: FindLobbies
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FindLobbiesRequest'
        description: Request to find lobbies.
      responses:
        '200':
          $ref: '#/components/responses/FindLobbiesResult'
        '400':
          $ref: '#/components/responses/ApiErrorWrapper'
      security:
        - EntityToken: []
components:
  schemas:
    FindLobbiesRequest:
      description: Request to find lobbies.
      type: object
      properties:
        CustomTags:
          description: >-
            The optional custom tags associated with the request (e.g. build
            number, external trace identifiers, etc.).
          type: object
        Filter:
          description: >-
            OData style string that contains one or more filters. Only the
            following operators are supported: "and" (logical and), "eq"
            (equal), "ne" (not equals), "ge" (greater than or equal), "gt"
            (greater than), "le" (less than or equal), and "lt" (less than). The
            left-hand side of each OData logical expression should be either a
            search property key (e.g. string_key1, number_key3, etc) or one of
            the pre-defined search keys all of which must be prefixed by
            "lobby/": lobby/memberCount (number of players in a lobby),
            lobby/maxMemberCount (maximum number of players allowed in a lobby),
            lobby/memberCountRemaining (remaining number of players who can be
            allowed in a lobby), lobby/membershipLock (must equal 'Unlocked' or
            'Locked'), lobby/amOwner (required to equal "true"), lobby/amMember
            (required to equal "true").
          type: string
        OrderBy:
          description: >-
            OData style string that contains sorting for this query in either
            ascending ("asc") or descending ("desc") order. OrderBy clauses are
            of the form "number_key1 asc" or the pre-defined search key
            "lobby/memberCount asc", "lobby/memberCountRemaining desc" and
            "lobby/maxMemberCount desc". To sort by closest, a moniker
            `distance{number_key1 = 5}` can be used to sort by distance from the
            given number. This field only supports either one sort clause or one
            distance clause.
          type: string
        Pagination:
          allOf:
            - $ref: '#/components/schemas/PaginationRequest'
          description: Request pagination information.
      example:
        Filter: string_key1 eq 'Wizard' and number_key5 gt 5
        OrderBy: number_key5 desc
        Pagination:
          ContinuationToken: ''
          PageSizeRequested: 20
    PaginationRequest:
      type: object
      properties:
        ContinuationToken:
          description: >-
            Continuation token returned as a result in a previous FindLobbies
            call. Cannot be specified by clients.
          type: string
        PageSizeRequested:
          description: >-
            The number of lobbies that should be retrieved. Cannot be specified
            by servers, clients may specify any value up to 50
          type: number
          x-actualtype: uint32
    FindLobbiesResult:
      type: object
      properties:
        Lobbies:
          description: Array of lobbies found that matched FindLobbies request.
          type: array
          items:
            $ref: '#/components/schemas/LobbySummary'
          x-isclass: true
        Pagination:
          allOf:
            - $ref: '#/components/schemas/PaginationResponse'
          description: Pagination response for FindLobbies request.
      required:
        - Lobbies
        - Pagination
    ApiErrorWrapper:
      description: The basic wrapper around every failed API response
      type: object
      properties:
        code:
          description: Numerical HTTP code
          type: integer
        status:
          description: String HTTP code
          type: string
        error:
          description: Playfab error code
          type: string
        errorCode:
          description: Numerical PlayFab error code
          type: integer
        errorMessage:
          description: Description for the PlayFab errorCode
          type: string
        errorDetails:
          description: Detailed description of individual issues with the request object
          type: object
      required:
        - code
        - errorCode
    LobbySummary:
      type: object
      properties:
        ConnectionString:
          description: >-
            A string used to join the lobby.This field is populated by the Lobby
            service.Invites are performed by communicating this connectionString
            to other players.
          type: string
        CurrentPlayers:
          description: The current number of players in the lobby.
          type: number
          x-actualtype: uint32
        LobbyId:
          description: Id to uniquely identify a lobby.
          type: string
        MaxPlayers:
          description: The maximum number of players allowed in the lobby.
          type: number
          x-actualtype: uint32
        MembershipLock:
          allOf:
            - $ref: '#/components/schemas/MembershipLock'
          description: >-
            A setting indicating whether members are allowed to join this lobby.
            When Locked new members are prevented from joining.
        Owner:
          allOf:
            - $ref: '#/components/schemas/EntityKey'
          description: The client or server entity which owns this lobby.
        SearchData:
          description: Search data.
          type: object
      required:
        - LobbyId
        - Owner
        - MaxPlayers
        - CurrentPlayers
        - ConnectionString
    PaginationResponse:
      type: object
      properties:
        ContinuationToken:
          description: Continuation token returned by server call. Not returned for clients
          type: string
        TotalMatchedLobbyCount:
          description: The number of lobbies that matched the search request.
          type: number
          x-actualtype: uint32
    MembershipLock:
      type: string
      enum:
        - Unlocked
        - Locked
    EntityKey:
      description: >-
        Combined entity type and ID structure which uniquely identifies a single
        entity.
      type: object
      properties:
        Id:
          description: Unique ID of the entity.
          type: string
        Type:
          description: >-
            Entity type. See
            https://learn.microsoft.com/gaming/playfab/features/data/entities/available-built-in-entity-types
          type: string
      required:
        - Id
  responses:
    FindLobbiesResult:
      description: ''
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                type: integer
                description: >-
                  The Http status code. If X-ReportErrorAsSuccess header is set
                  to true, this will report the actual http error code.
              status:
                type: string
                description: The Http status code as a string.
              data:
                $ref: '#/components/schemas/FindLobbiesResult'
    ApiErrorWrapper:
      description: This is the outer wrapper for all responses with errors
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ApiErrorWrapper'
  securitySchemes:
    EntityToken:
      type: apiKey
      in: header
      name: X-EntityToken
      description: >-
        This API requires an Entity Session Token, available from the Entity
        GetEntityToken method.

````

## Related topics

- [Find lobbies](/services/playfab/multiplayer/lobby/find-lobbies.md)
- [Find Lobbies](/services/playfab/api-references/rest/multiplayer/lobby/find-lobbies.md)
- [Integrate Party with Lobby using Multiplayer SDK](/services/playfab/multiplayer/networking/party-lobby-integration.md)
- [Multiplayer Unity plugin quickstart](/services/playfab/multiplayer/lobby/lobby-matchmaking-sdks/multiplayer-unity-plugin-quickstart.md)
- [Moving from MPSD to PlayFab Multiplayer and MPA](/services/xbox-services/multiplayer/mpsd/concepts/live-mpsd-to-mlp.md)
