shuwen-news-python-sdk
使用方式
pip install shuwen-news
配置
from news import Client
# 初始化 client
client = Client(access_key, access_secret)
# 获取新闻
news, err = client.get_all()
print(news)
SDK 文档
get_category()
获得新闻的分类
categories, err = client.get_category()
get_all()
获得所有新闻
options = {'category': "", 'region': "", 'last_id': "", 'size': 15 }
news, err = client.get_all(options)
get_important()
获得重大新闻
options = {'last_id': "", 'size': 15 }
news, err = client.get_important(options)
get_hot()
获得热门新闻
options = {'last_id': "", 'size': 15 }
news, err = client.get_hot()
search()
搜索新闻
options = {'category': "", 'region': "", 'last_id': "", 'size': 15 }
news, err = client.search("体育", options)