Matchmakings API Resource
Relevant source files
The following files were used as context for generating this wiki page:
The Matchmakings API Resource provides an interface for interacting with FACEIT matchmaking data. It allows you to fetch details for specific matchmaking configurations using unique identifiers. This resource is part of the faceit.api.data module and supports both synchronous and asynchronous execution modes.
Access to this resource is managed through the Data Resource Aggregator, which exposes the matchmaking endpoints under the matchmakings and raw_matchmakings attributes.
Sources: src/faceit/api/data/matchmakings.py:1-77, src/faceit/api/data/init.py:81-88
Architecture and Components
The matchmaking resource follows the standard architecture of the faceit-python library, utilizing a base abstract class to define common logic and final implementations for sync and async clients.
Class Hierarchy
The resource is structured into three primary classes:
BaseMatchmakings: An abstract base class that sets the resource path to"matchmakings".SyncMatchmakings: The implementation for synchronous requests, usingSyncClient.AsyncMatchmakings: The implementation for asynchronous requests, usingAsyncClient.
The diagram shows the inheritance structure where game-specific resources inherit from BaseResource.
Sources: src/faceit/api/data/matchmakings.py:27-40, src/faceit/api/base.py:46-52
Data Retrieval Logic
The resource currently supports retrieving matchmaking information by ID. The get method is the primary entry point for this operation.
Request Flow
When you call the get method, the following sequence occurs:
- The
matchmaking_idis validated to ensure it is a valid UUID. - The resource constructs a request to the
matchmakings/{matchmaking_id}endpoint. - The underlying HTTP client (Sync or Async) executes the GET request.
- The response is validated against the requested format (Raw or Model).
The diagram illustrates the data flow from the user request to the FACEIT API response.
Sources: src/faceit/api/data/matchmakings.py:42-77, src/faceit/http/client.py:456-487
API Reference
Methods
| Method | Parameters | Return Type | Description |
|---|---|---|---|
get | matchmaking_id: str | RawAPIItem | ModelNotImplemented | Fetches details for a specific matchmaking ID. |
__call__ | matchmaking_id: str | Same as get | Alias for the get method, allowing the resource to be called directly. |
Configuration and Constants
The resource is bound to the following constants and types:
- Resource Path:
matchmakings - ID Type:
ValidUUID(Validated as a string during the API call). - Response Format: Determined by the generic
APIResponseFormatT(eitherRaworModel).
Sources: src/faceit/api/data/matchmakings.py:17-30
Implementation Details
The resource utilizes Pydantic's @validate_call for runtime type checking of input parameters. Currently, the Model response format returns ModelNotImplemented because concrete Pydantic models for matchmaking objects are still under development. Users requiring data now should use the raw_matchmakings interface to receive RawAPIItem (typed dictionaries).
# src/faceit/api/data/matchmakings.py:42-59
@final
class SyncMatchmakings(BaseMatchmakings[SyncClient], Generic[APIResponseFormatT]):
__slots__ = ()
@overload
def get(
self: SyncMatchmakings[Raw], matchmaking_id: _MatchmakingID
) -> RawAPIItem: ...
@validate_call
def get(
self, matchmaking_id: _MatchmakingIDValidated
) -> RawAPIItem | ModelNotImplemented:
return self._validate_response(
self._client.get(
self.__class__.PATH / str(matchmaking_id), expect_item=True
),
ModelPlaceholder,
)
Sources: src/faceit/api/data/matchmakings.py:42-59, src/faceit/api/base.py:38
Summary
The Matchmakings API Resource allows programmatic access to FACEIT's matchmaking configurations. It enforces strict UUID validation for identifiers and provides both synchronous and asynchronous methods. While full model parsing is not yet available, the resource provides stable access to raw API data through the standard library interface.