Skip to main content

kinopoisk unofficial API

This is simple python package for getting data from unofficial kinopoisk API.

Installing

pip

pip install kinopoisk-unofficial-api

poetry

poetry add kinopoisk-unofficial-api

Getting token

Why this not work. What the token and why this require it from me? For interact to API you should getting api token. That get it you need sign up to their site. After register go to profile and save your token somewhere.

How to use

For begin you should create the KPClient instance.

from kinopoisk import KPClient

client = KPClient(<your token>)

When you have client you can used all functional this library.

Getting movie

matrix = await client.get_movie_data(301)
print(matrix)

You can get e.g. name, release date, raiting, length of this movie and more.

matrix.name.en
'The Matrix'
matrix.year
1999
matrix.length
136

If you not know movie id (that to be often) may use another method named search_movie

answer = await client.search_movie('Mr. Robot')
mr_robot = answer[0] # If you search popular movie, that usually this movie should be to first

Getting data of movie

In previous example we got tv series. By default it take without it seasons. That load it you should get it id and call to method of client get_seasons_data

seasons = await client.get_seasons_data(mr_robot.id.kinopoisk)
for season in seasons:
	print(season.episodes)

Yet this not exactly conveniently. Store seasons and it tv series between it may be not good idea. So that, you may not splitting data, for it need call tv series method load_seasons.

await mr_robot.load_seasons(client)
for season in mr_robot.seasons:
    print(season.episodes)
# Or just
for season in mr_robot:
    print(season.episodes)

Season have a episodes (Seriously?) that may be get it same way.

for season in mr_robot:
    for episode in season:
        print(episode.name.en)
		# First episode named 'eps1.0_hellofriend.mov'

Getting facts and bloopers of movie

for fact in await client.get_facts(mr_robot.id.kinopoisk):
	print(fact.text)

Getting persons

bc = (await client.search_person('Benedict Cumberbatch'))[0]
await bc.get_all_data(client)
print(bc.birthday.strftime("%d %B, %Y"))
# Output 19 July, 1976

Or you can get persons of some movie

persons = await mr_robot.get_persons(client)
actors = []
for person in persons:
    if person.is_actor:
        actors.append(person)
for actor in actors[:10]: print(f'{actor.name.en}: {actor.character}')

Getting reviews

reviews = await mr_robot.get_reviews(client)
for review in reviews: print(f'{review.author} - {review.title}:\n{review.text}')

Getting similars movies

movies = await mr_robot.get_similars(client)
for movie in movies:
    print(movie.name.en)
Fight Club
Who Am I - Kein System ist sicher
The Matrix
Dexter
A Beautiful Mind
Hackers
The Social Network
The Fifth Estate
V for Vendetta
Black Mirror
23

Getting images

You can get different images e.g. posters wallpapers, backstage photo and more

images = await mr_robot.get_images(client, ImageTypes.poster)
for image in images:
    print(image.big)

### Getting some tops

Best 250

for movie in (await client.get_top(TopTypes.best_250))[:5]:
	print(movie.name.en)

Popular 100

for movie in (await client.get_top(TopTypes.popular_100))[:5]:
	print(movie.name.en)

Future

for movie in (await client.get_top(TopTypes.best_250))[:5]:
	print(movie.name.en)

Release files for kinopoisk-unofficial-api 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kinopoisk-unofficial-api 0.7.0
File Size Uploaded
kinopoisk-unofficial-api-0.7.0.tar.gz 26.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kinopoisk-unofficial-api 0.7.0
File Interpreter ABI Platform
kinopoisk_unofficial_api-0.7.0-py3-none-any.whl Python 3 none any Details

Total release size: 61.0 kB

Release files / kinopoisk-unofficial-api-0.7.0.tar.gz

Download URL kinopoisk-unofficial-api-0.7.0.tar.gz
Size 26.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0f7d4ec861b0ab2e2c19148eb688f65fc73408f4f1468e36a1ff678a25cf3787
BLAKE2b-256 checksum
How to use checksums
f5f496fda3b1b469c3fb12af4a85df74956404272980d77eb667d3fe5ad3f459
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.1 Linux/5.10.98-1-MANJARO

Release files / kinopoisk_unofficial_api-0.7.0-py3-none-any.whl

Download URL kinopoisk_unofficial_api-0.7.0-py3-none-any.whl
Size 34.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86125e37832156582c9bd38decd71bc782fab07ce1c676ca44fba028b5d9fb62
BLAKE2b-256 checksum
How to use checksums
fd311062a5aa69ccc1d87e67483e806b994266e5e9e70b38f0f6c540caa8945d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.12 CPython/3.10.1 Linux/5.10.98-1-MANJARO

Release history Release notifications | RSS feed

This release

0.7.0 This release

2 release files

0.6.5

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page