classModrinth#
- class Modrinth(
- user_agent: str | None = None,
- *,
- session: Session | None = None,
- base_url: str = 'https://api.modrinth.com/v2',
Modrinth. No API key is needed.
- Parameters:
- base_url#
The API’s base URL.
- search(
- query: str,
- *,
- project_type: Literal['mod', 'modpack', 'resourcepack', 'shader'] = 'modpack',
- game_version: str | None = None,
- loader: str | None = None,
- offset: int = 0,
- limit: int = 20,
Search Modrinth’s catalogue.
- Parameters:
query (str) – The search text.
project_type (Literal['mod', 'modpack', 'resourcepack', 'shader']) – The kind of project to find.
game_version (str | None) – Only match this Minecraft version.
loader (str | None) – Only match this mod loader.
offset (int) – How many results to skip.
limit (int) – The maximum number of results to return.
- Returns:
One page of results.
- Raises:
NetworkError – Modrinth could not be reached.
- Return type:
- get_project( ) Project#
Look up a project by id, slug or URL.
- Parameters:
- Returns:
The project.
- Raises:
NetworkError – Modrinth could not be reached or does not know the project.
- Return type:
- iter_releases(
- project: Project,
- *,
- game_version: str | None = None,
- loader: str | None = None,
- release_only: bool = False,
Yield a project’s releases, newest first, reading pages as needed.
- Parameters:
- Yields:
Each release, once.
- Raises:
NetworkError – Modrinth could not be reached.