Skip to main content

Unofficial API for zhihu.

Project description

UNOFFICIAL API for zhihu. This package supports only Python 3.x.

A Node.js implementation is also available.

Installation

$ pip install zhihuapi

Quich Start

import zhihuapi as api

with open('cookie') as f:
    api.cookie(f.read())

data = api.user('zhihuadmin').profile()
print(data)

The result is:

{
    "url_token": "zhihuadmin",
    "avatar_url": "https://pic3.zhimg.com/34bf96bf5584ac4b5264bd7ed4fdbc5a_is.jpg",
    "avatar_url_template": "https://pic3.zhimg.com/34bf96bf5584ac4b5264bd7ed4fdbc5a_{size}.jpg",
    "type": "people",
    "name": "知乎小管家",
    "headline": "欢迎反馈问题和建议!",
    "is_org": false,
    "url": "https://www.zhihu.com/people/zhihuadmin",
    "badge": [
        {
            "type": "identity",
            "description": "知乎官方帐号"
        }
    ],
    "user_type": "people",
    "is_advertiser": false,
    "id": "3d198a56310c02c4a83efb9f4a4c027e"
}

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zhihuapi-0.6.0.tar.gz (10.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page