sok.apis.images.fanart_api
Fanart.tv API implementation.
API Documentation: https://fanarttv.docs.apiary.io/ Note: Requires API key for full access. Personal key provides higher rate limits.
FanartApi
class FanartApi(api_key: str)Bases: BaseAPI
Fanart.tv API implementation for high-quality artwork.
Provides access to fan-created artwork for movies, TV shows, music artists, and video games including posters, backgrounds, logos, and more.
Initialize Fanart.tv API.
Parameters
| Name | Type | Description |
|---|---|---|
api_key | str | Fanart.tv API key. |
supported_content_typesproperty
List[ContentType]
Get supported content types.
supported_media_typesproperty
List[MediaType]
Get supported media types.
get_detailsasync
async def get_details( item_id: str, content_type: ContentType, **kwargs,) -> Dict[str, Any]:Get artwork details for a media item.
Parameters
| Name | Type | Description |
|---|---|---|
item_id | str | External ID (TMDB, TVDB, or MusicBrainz). |
content_type | ContentType | Type of content. |
**kwargs | Additional parameters. |
Returns
Dict[str, Any]Artwork URLs and metadata.
get_game_artworkasync
async def get_game_artwork(game_id: str) -> Dict[str, Any]:Get artwork for a video game.
Parameters
| Name | Type | Description |
|---|---|---|
game_id | str | Game ID (platform-specific). |
Returns
Dict[str, Any]Game artwork dictionary.
get_movie_artworkasync
async def get_movie_artwork(tmdb_id: str) -> Dict[str, Any]:Get artwork for a movie using TMDB ID.
Parameters
| Name | Type | Description |
|---|---|---|
tmdb_id | str | TMDB movie ID. |
Returns
Dict[str, Any]Movie artwork (posters, backgrounds, logos, etc.).
get_music_artworkasync
async def get_music_artwork(mbid: str) -> Dict[str, Any]:Get artwork for a music artist using MusicBrainz ID.
Parameters
| Name | Type | Description |
|---|---|---|
mbid | str | MusicBrainz artist ID. |
Returns
Dict[str, Any]Artist artwork (backgrounds, logos, thumbs, etc.).
get_related_itemsasync
async def get_related_items( item_id: str, content_type: ContentType, **kwargs,) -> List[Dict[str, Any]]:Get related items (not supported by Fanart.tv).
Parameters
| Name | Type | Description |
|---|---|---|
item_id | str | Item identifier. |
content_type | ContentType | Type of content. |
**kwargs | Additional parameters. |
Returns
List[Dict[str, Any]]Empty list as Fanart.tv doesn't support related items.
get_tv_artworkasync
async def get_tv_artwork(tvdb_id: str) -> Dict[str, Any]:Get artwork for a TV show using TVDB ID.
Parameters
| Name | Type | Description |
|---|---|---|
tvdb_id | str | TVDB series ID. |
Returns
Dict[str, Any]TV show artwork (posters, backgrounds, logos, etc.).
searchasync
async def search( query: str, content_type: ContentType, **kwargs,) -> Dict[str, Any]:Fanart.tv doesn't support search - use TMDB/TVDB/MusicBrainz IDs directly.
This method returns empty results as Fanart.tv requires external IDs. Use get_artwork_by_id() methods instead.
Parameters
| Name | Type | Description |
|---|---|---|
query | str | |
content_type | ContentType |