Skip to content

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

NameTypeDescription
api_keystrFanart.tv API key.
Source

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

NameTypeDescription
item_idstrExternal ID (TMDB, TVDB, or MusicBrainz).
content_typeContentTypeType of content.
**kwargsAdditional parameters.

Returns

  • Dict[str, Any]Artwork URLs and metadata.
Source

get_game_artworkasync

async def get_game_artwork(game_id: str) -> Dict[str, Any]:

Get artwork for a video game.

Parameters

NameTypeDescription
game_idstrGame ID (platform-specific).

Returns

  • Dict[str, Any]Game artwork dictionary.
Source

get_movie_artworkasync

async def get_movie_artwork(tmdb_id: str) -> Dict[str, Any]:

Get artwork for a movie using TMDB ID.

Parameters

NameTypeDescription
tmdb_idstrTMDB movie ID.

Returns

  • Dict[str, Any]Movie artwork (posters, backgrounds, logos, etc.).
Source

get_music_artworkasync

async def get_music_artwork(mbid: str) -> Dict[str, Any]:

Get artwork for a music artist using MusicBrainz ID.

Parameters

NameTypeDescription
mbidstrMusicBrainz artist ID.

Returns

  • Dict[str, Any]Artist artwork (backgrounds, logos, thumbs, etc.).
Source
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

NameTypeDescription
item_idstrItem identifier.
content_typeContentTypeType of content.
**kwargsAdditional parameters.

Returns

  • List[Dict[str, Any]]Empty list as Fanart.tv doesn't support related items.
Source

get_tv_artworkasync

async def get_tv_artwork(tvdb_id: str) -> Dict[str, Any]:

Get artwork for a TV show using TVDB ID.

Parameters

NameTypeDescription
tvdb_idstrTVDB series ID.

Returns

  • Dict[str, Any]TV show artwork (posters, backgrounds, logos, etc.).
Source
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

NameTypeDescription
querystr
content_typeContentType
Source
Built with Kiln