设为首页收藏本站

简体中文 繁體中文 English 日本語 Deutsch 한국 사람 بالعربية TÜRKÇE português คนไทย Français

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 20|回复: 2

求教大佬,知乎的api使用的哪种查询语法?想清除冗余信息

[复制链接]

7

主题

25

回帖

87

积分

注册会员

积分
87
发表于 2019-6-7 22:40:00 | 显示全部楼层 |阅读模式
https://www.zhihu.com/api/v4/top ... p_activity?include=

data[?(target.type=topic_sticky_module)].target.data[?(target.type=answer)].target.content,relationship.is_authorized,is_author,voting,is_thanked,is_nothelp;
data[?(target.type=topic_sticky_module)].target.data[?(target.type=answer)].target.is_normal,comment_count,voteup_count,content,relevant_info,excerpt.author.badge[?(type=best_answerer)].topics;
data[?(target.type=topic_sticky_module)].target.data[?(target.type=article)].target.content,voteup_count,comment_count,voting,author.badge[?(type=best_answerer)].topics;
data[?(target.type=topic_sticky_module)].target.data[?(target.type=people)].target.answer_count,articles_count,gender,follower_count,is_followed,is_following,badge[?(type=best_answerer)].topics;
data[?(target.type=answer)].target.annotation_detail,content,hermes_label,is_labeled,relationship.is_authorized,is_author,voting,is_thanked,is_nothelp;
data[?(target.type=answer)].target.author.badge[?(type=best_answerer)].topics;
data[?(target.type=article)].target.annotation_detail,content,hermes_label,is_labeled,author.badge[?(type=best_answerer)].topics;
data[?(target.type=question)].target.annotation_detail,comment_count;

如果想只返回article或question应该如何修改?
回复

使用道具 举报

18

主题

146

回帖

384

积分

中级会员

积分
384
发表于 2019-6-7 22:45:03 | 显示全部楼层
接口是JSON  可以转数组的
回复

使用道具 举报

7

主题

25

回帖

87

积分

注册会员

积分
87
 楼主| 发表于 2019-6-8 09:02:24 | 显示全部楼层

七枷社 发表于 2019-6-7 22:45

接口是JSON  可以转数组的

每个主题最多返回1000条数据,想尽可能多的抓取question,但现在返回的结果包含大量article,如果能在查询时就过滤掉article应该会提高效率
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Discuz! X

GMT+8, 2025-12-19 07:58 , Processed in 0.016527 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表