sok.apis.video.imdb_api
IMDb API Implementation (via OMDb) OMDb API (Open Movie Database) is a RESTful API for retrieving movie information.
Documentation: https://www.omdbapi.com/ Note: OMDb requires a free or paid API key depending on usage.
IMDBApi
class IMDBApi(api_key: str)Bases: BaseAPI
OMDb API implementation for accessing IMDb data.
OMDb provides movie and TV series data from IMDb, with a simple and easy-to-use API.
Note: The free API is limited to 1000 requests per day.
Initialize OMDb API.
Parameters
| Name | Type | Description |
|---|---|---|
api_key | str | OMDb 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 item details via IMDb ID.
Parameters
| Name | Type | Description |
|---|---|---|
item_id | str | IMDb ID (e.g., 'tt0133093'). |
content_type | ContentType | Content type. |
Returns
Dict[str, Any]Item details in standardized format.
get_related_itemsasync
async def get_related_items( item_id: str, content_type: ContentType, **kwargs,) -> List[Dict[str, Any]]:Get season episodes.
Parameters
| Name | Type | Description |
|---|---|---|
item_id | str | Series IMDb ID. |
content_type | ContentType | Content type. |
**kwargs | season_number for episodes. |
Returns
List[Dict[str, Any]]Episodes list.
get_season_episodesasync
async def get_season_episodes( series_id: str, season_number: int,) -> List[Dict[str, Any]]:Get episodes from specific season.
Parameters
| Name | Type | Description |
|---|---|---|
series_id | str | Series IMDb ID. |
season_number | int | Season number. |
Returns
List[Dict[str, Any]]Episodes list.
searchasync
async def search( query: str, content_type: ContentType, **kwargs,) -> Dict[str, Any]:Search on OMDb/IMDb.
Parameters
| Name | Type | Description |
|---|---|---|
query | str | Search term. |
content_type | ContentType | Content type. |
**kwargs | Additional arguments (year, type, etc.). |
Returns
Dict[str, Any]Search results in standardized format.
search_by_titleasync
async def search_by_title( title: str, year: Optional[int] = None, content_type: str = 'movie',) -> Optional[Dict[str, Any]]:Direct search by exact title (faster).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
title | str | Exact title. | |
year | Optional[int] | None | Release year. |
content_type | str | 'movie' | 'movie' or 'series'. |
Returns
Optional[Dict[str, Any]]Item details or None.
Attributes
| Name | Value |
|---|---|
logger | logging.getLogger(__name__) |