Skip to main content

Sina Weibo API

安装

pip install weibo-oauth

使用

from weibo_oauth import Weibo
import webbrowser

#APP_ID,SECRET_KEY,redirect_uri
weibo=Weibo("APP_ID","SECRET_KEY")

#打开浏览器获取request code
webbrowser.open(weibo.get_authorize_url())

#黏贴获取到的code
code=input("input request code:")

#获取access_token
weibo.get_access_token(code)

#请求API,获取所有的评论
_json = weibo.get("comments/by_me")
print(_json)

API请求

weibo.get("comments/by_me",count=200,page=10)
返回一个 json 对象

Release files for weibo-oauth 0.1.3

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

Source distribution (sdist)

Source distribution for weibo-oauth 0.1.3
File Size Uploaded
weibo-oauth-0.1.3.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for weibo-oauth 0.1.3
File Interpreter ABI Platform
weibo_oauth-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 6.4 kB

Release files / weibo-oauth-0.1.3.tar.gz

Download URL weibo-oauth-0.1.3.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ec0b02b43b3112a7f8783489dfcc500a57cd0985f3a7fcab3f442628c4b42a81
BLAKE2b-256 checksum
How to use checksums
a8a9befded6764fdb70bcfecce88d7e926cb4b8726ad0c1380d4721747af21ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

Release files / weibo_oauth-0.1.3-py3-none-any.whl

Download URL weibo_oauth-0.1.3-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
665264f73c3677fd7caa55d6bb99b110fb99d2d41de5e8dbca78ff7a6a5a5825
BLAKE2b-256 checksum
How to use checksums
31638d3ae251bdba22c9adb260d89480276304fb9218c48db418a0c34fb03ad4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.1

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