PHPackages                             xhboke/douban - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. xhboke/douban

ActiveProject[API Development](/categories/api)

xhboke/douban
=============

the api of douban movie

2.1(4y ago)112321[6 issues](https://github.com/xhboke/douban/issues)[1 PRs](https://github.com/xhboke/douban/pulls)MITPHPPHP &gt;=7.4

Since Dec 12Pushed 4y ago1 watchersCompare

[ Source](https://github.com/xhboke/douban)[ Packagist](https://packagist.org/packages/xhboke/douban)[ Docs](https://api.xhboke.com/doc/movie)[ GitHub Sponsors](https://github.com/[user1)[ GitHub Sponsors](https://github.com/user2)[ RSS](/packages/xhboke-douban/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

[![](https://camo.githubusercontent.com/fe42b62b10cb971920d47d6390060de466f57725a718a52a385e450195156ab5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2545382542312538362545372539332541332545372539342542352545352542442542312d4150492d666666)](https://camo.githubusercontent.com/fe42b62b10cb971920d47d6390060de466f57725a718a52a385e450195156ab5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2545382542312538362545372539332541332545372539342542352545352542442542312d4150492d666666)[![](https://camo.githubusercontent.com/7d99088f523b66849cda8626a22e90852424bc680ba2c66fdf3584eefcfb3208/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f7868626f6b652f646f7562616e3f7374796c653d736f6369616c)](https://camo.githubusercontent.com/7d99088f523b66849cda8626a22e90852424bc680ba2c66fdf3584eefcfb3208/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f7868626f6b652f646f7562616e3f7374796c653d736f6369616c)[![](https://camo.githubusercontent.com/44f4bcbaae6fbe9cf5e46f1e9aaaf4935f63fdf6fbbfc8ba45b3f72dfe2ab927/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f7868626f6b652f646f7562616e3f7374796c653d736f6369616c266c6162656c3d466f726b)](https://camo.githubusercontent.com/44f4bcbaae6fbe9cf5e46f1e9aaaf4935f63fdf6fbbfc8ba45b3f72dfe2ab927/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f7868626f6b652f646f7562616e3f7374796c653d736f6369616c266c6162656c3d466f726b)[![](https://camo.githubusercontent.com/ea6e2954d6564277362ec22c607da674c5845affe82cbad56899632758a79461/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f746f702f7868626f6b652f646f7562616e)](https://camo.githubusercontent.com/ea6e2954d6564277362ec22c607da674c5845affe82cbad56899632758a79461/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c616e6775616765732f746f702f7868626f6b652f646f7562616e)[![GitHub](https://camo.githubusercontent.com/51aabf6b0bb4e8a71c3fe6ebefe9fad77f65f97c6c28448bc810bdc12e8601f3/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f6c2f657870726573732e737667)](https://camo.githubusercontent.com/51aabf6b0bb4e8a71c3fe6ebefe9fad77f65f97c6c28448bc810bdc12e8601f3/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f6c2f657870726573732e737667)

安装说明
----

[](#安装说明)

- Python

```
pip install doubanlib

```

```
from doubanlib.movies import DouBan
from doubanlib.movies import MovieInfo

# Set the headers
headers = {'User-Agent': 'Hello'}
DouBan.set_headers(headers=headers)
# You can also set the optional proxy
# DouBan.set_proxy(proxy={'http': '203.89.126.250:80'})

# Doctor Strange in the Multiverse of Madness which id is 30304994(https://movie.douban.com/subject/30304994)
obj = MovieInfo(30304994)

# Print the description of the movie
print('Description:{}'.format(obj.description))

# Print all the information of the movie.
print(
    'ID:{}\nName:{}\nChinese_Name:{}\nYear:{}\nGenre:{}\nRegions:{}\nLanguage:{}\nRating:{}\nVotes:{}\nLength_Movie:{}\nDirectors:{}\nAlias:{}\nImage:{}\nDate_Published:{}\nActors:{}\nDescription:{}'
    .format(obj.m_id, obj.name, obj.chineseName, obj.year, obj.genre,
            obj.regions, obj.languages, obj.rating, obj.votes, obj.length_movie,
            obj.directors, obj.alias, obj.image, obj.pubDate, obj.actors,
            obj.actors, obj.description))

```

- PHP 本地测试

下载代码

```
git clone https://github.com/xhboke/douban.git

```

启动服务

```
php think run

```

然后就可以在浏览器中访问

```
http://localhost:8000

```

- PHP 服务器

上传代码，设置 `public` 为运行目录，设置伪静态

```
location / {
	if (!-e $request_filename){
		rewrite  ^(.*)$  /index.php?s=$1  last;   break;
	}
}

```

同时关闭调试模式 `/config/app.php` : `'app_debug' => true` ==&gt; `'app_debug' => false`

注意
--

[](#注意)

频繁使用会导致封禁IP，目前可通过更换IP或者使用代理或者是登录获取Cookie的方式避免。

使用方法
----

[](#使用方法)

上方为豆瓣的链接，下方是API的链接，大致相同，涉及页数的有变化，最后请不要加上‘/’

### 一、电影信息

[](#一电影信息)

#### 电影基本信息

[](#电影基本信息)

`https://movie.douban.com/subject/25845392/`

`http://127.0.0.1:8000/subject/25845392`

#### 电影短评

[](#电影短评)

`https://movie.douban.com/subject/25845392/comments?status=P`

`http://127.0.0.1:8000/subject/25845392/comments?page=0&sort=new_score`

#### 电影短评

[](#电影短评-1)

`https://movie.douban.com/subject/25845392/reviews?&start=0&sort=hotest`

`http://127.0.0.1:8000/subject/25845392/reviews?page=0&sort=hotest`

#### 电影参演人员

[](#电影参演人员)

`https://movie.douban.com/subject/25845392/celebrities`

`http://127.0.0.1:8000/subject/25845392/celebrities`

#### 影片图片

[](#影片图片)

`https://movie.douban.com/subject/25845392/all_photos`

`http://127.0.0.1:8000/subject/25845392/all_photos`

#### 影片图片

[](#影片图片-1)

`https://movie.douban.com/subject/25845392/photos?type=S`

`http://127.0.0.1:8000/subject/25845392/photos?type=S`

### 二、影片搜索

[](#二影片搜索)

#### 关键词

[](#关键词)

`http://127.0.0.1:8000/search/key/长津湖`

#### 搜索影片

[](#搜索影片)

`https://search.douban.com/movie/subject_search?search_text=长&cat=1002&start=0`

`http://127.0.0.1:8000/search/长/0`

### 三、分类影片

[](#三分类影片)

#### 分类影片

[](#分类影片)

`http://127.0.0.1:8000/tag?tags=电影,剧情,中国大陆,2021&page=0&sort=U`

四、人物信息
------

[](#四人物信息)

#### 人物基本信息

[](#人物基本信息)

`https://movie.douban.com/celebrity/1023040`

`http://127.0.0.1:8000/celebrity/1023040`

#### 人物图片

[](#人物图片)

`https://movie.douban.com/celebrity/1023040/photos/?type=C&start=0&sortby=like&size=a&subtype=a`

`http://127.0.0.1:8000/celebrity/1023040/photos?page=0&sort=like`

#### 单张图片

[](#单张图片)

`https://movie.douban.com/celebrity/1023040/photo/1247932516`

`http://127.0.0.1:8000/celebrity/1023040/photo/1247932516`

#### 人物获奖

[](#人物获奖)

`https://movie.douban.com/celebrity/1023040/awards`

`http://127.0.0.1:8000/celebrity/1023040/awards`

#### 人物参演

[](#人物参演)

`https://movie.douban.com/celebrity/1023040/movies?start=0&format=pic&sortby=time`

`http://127.0.0.1:8000/celebrity/1023040/movies?page=0&sort=time`

#### 人物合作

[](#人物合作)

`https://movie.douban.com/celebrity/1023040/movies?start=0&format=pic&sortby=time`

`http://127.0.0.1:8000/celebrity/1023040/partners?page=0`

### 五、图片信息

[](#五图片信息)

#### 图片基本信息及评论

[](#图片基本信息及评论)

`https://movie.douban.com/photos/photo/2673813691/`

`http://127.0.0.1:8000/photos/photo/2673813691`

### 六、豆瓣250

[](#六豆瓣250)

`https://movie.douban.com/top250?start=25&filter=`

`http://127.0.0.1:8000/top250?page=0`

声明
--

[](#声明)

本项目仅供学习交流，禁止用于非法用途。

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1658d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3f2420c01419ab477ed29fa4bd6254ce98e69d6aad55e6103564ae3a3f39250b?d=identicon)[xhboke](/maintainers/xhboke)

---

Top Contributors

[![xhboke](https://avatars.githubusercontent.com/u/38235544?v=4)](https://github.com/xhboke "xhboke (71 commits)")

---

Tags

apidoubanphpapimoviedouban

### Embed Badge

![Health badge](/badges/xhboke-douban/health.svg)

```
[![Health](https://phpackages.com/badges/xhboke-douban/health.svg)](https://phpackages.com/packages/xhboke-douban)
```

###  Alternatives

[php-tmdb/api

PHP wrapper for TMDB (TheMovieDatabase) API v3. Supports two types of approaches, one modelled with repositories, models and factories. And the other by simple array access to RAW data from The Movie Database.

435383.9k17](/packages/php-tmdb-api)[php-tmdb/laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

16553.3k1](/packages/php-tmdb-laravel)[wtfzdotnet/php-tmdb-api

PHP wrapper for TMDB (TheMovieDatabase) API v3. Supports two types of approaches, one modelled with repositories, models and factories. And the other by simple array access to RAW data from The Movie Database.

4262.9k](/packages/wtfzdotnet-php-tmdb-api)[php-tmdb/symfony

Symfony Bundle for TMDB (The Movie Database) API. Provides easy access to the php-tmdb/api library.

3649.8k](/packages/php-tmdb-symfony)[hmerritt/imdb-api

IMDB API that can fetch film data and search results

6911.4k](/packages/hmerritt-imdb-api)[dariusiii/tmdb-laravel

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

1821.2k](/packages/dariusiii-tmdb-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
