知乎 API v4 整理

作者:姚泽源

问题的回答

  • URL:https://www.zhihu.com/api/v4/questions/{qid}/answers
  • 参数:
    • limit:数量,最大 20
    • offset:起始位置,从零开始
    • sort_by{default, created},表示默认排序或者时间排序
    • include:额外信息,包括is_normal,is_sticky,collapsed_by,suggest_edit,comment_count,collapsed_counts,reviewing_comments_count,can_comment,content,editable_content,voteup_count,reshipment_settings,comment_permission,mark_infos,created_time,updated_time,relationship.is_author,voting,is_thanked,is_nothelp,upvoted_followees;author.is_blocking,is_blocked,is_followed,voteup_count,message_thread_token,badge[?(type=best_answerer)].topics

单个回答

  • URL:https://www.zhihu.com/api/v4/answers/{aid}
  • 参数:
    • include:额外信息,包括is_normal,is_sticky,collapsed_by,suggest_edit,comment_count,collapsed_counts,reviewing_comments_count,can_comment,content,editable_content,voteup_count,reshipment_settings,comment_permission,mark_infos,created_time,updated_time,relationship.is_author,voting,is_thanked,is_nothelp,upvoted_followees;author.is_blocking,is_blocked,is_followed,voteup_count,message_thread_token,badge[?(type=best_answerer)].topics

指定作者的回答

  • URL:https://www.zhihu.com/api/v4/members/{un}/answers
  • 参数:
    • limit:数量,最大 20
    • offset:起始位置,从零开始
    • sort_by{default, created},表示默认排序或者时间排序
    • include:额外信息,包括is_normal,suggest_edit,comment_count,collapsed_counts,reviewing_comments_count,can_comment,content,voteup_count,reshipment_settings,comment_permission,mark_infos,created_time,updated_time,relationship.voting,is_author,is_thanked,is_nothelp,upvoted_followees;author.badge[?(type=best_answerer)].topics

用户信息

  • URL:https://www.zhihu.com/api/v4/members/{un}
  • 参数:
    • include:额外信息,包括locations,employments,gender,educations,business,voteup_count,thanked_Count,follower_count,following_count,cover_url,following_topic_count,following_question_count,following_favlists_count,following_columns_count,avatar_hue,answer_count,articles_count,pins_count,question_count,columns_count,commercial_question_count,favorite_count,favorited_count,logs_count,included_answers_count,included_articles_count,included_text,message_thread_token,account_status,is_active,is_bind_phone,is_force_renamed,is_bind_sina,is_privacy_protected,sina_weibo_url,sina_weibo_name,show_sina_weibo,is_blocking,is_blocked,is_following,is_followed,is_org_createpin_white_user,mutual_followees_count,vote_to_count,vote_from_count,thank_to_count,thank_from_count,thanked_count,description,hosted_live_count,participated_live_count,allow_message,industry_category,org_name,org_homepage,badge[?(type=best_answerer)].topics

自身信息

  • URL:https://www.zhihu.com/api/v4/me
  • 参数:
    • include:额外信息,包括locations,employments,gender,educations,business,voteup_count,thanked_Count,follower_count,following_count,cover_url,following_topic_count,following_question_count,following_favlists_count,following_columns_count,avatar_hue,answer_count,articles_count,pins_count,question_count,columns_count,commercial_question_count,favorite_count,favorited_count,logs_count,included_answers_count,included_articles_count,included_text,message_thread_token,account_status,is_active,is_bind_phone,is_force_renamed,is_bind_sina,is_privacy_protected,sina_weibo_url,sina_weibo_name,show_sina_weibo,is_blocking,is_blocked,is_following,is_followed,is_org_createpin_white_user,mutual_followees_count,vote_to_count,vote_from_count,thank_to_count,thank_from_count,thanked_count,description,hosted_live_count,participated_live_count,allow_message,industry_category,org_name,org_homepage,badge[?(type=best_answerer)].topics

关注者信息

  • URL:https://www.zhihu.com/api/v4/members/{un}/followees
  • 参数:
    • limit:数量,最大 20
    • offset:起始位置,从零开始
    • include:额外信息,包括answer_count,articles_count,gender,follower_count,is_followed,is_following,badge[?(type=best_answerer)].topics

粉丝信息

  • URL:https://www.zhihu.com/api/v4/members/{un}/followers
  • 参数:
    • limit:数量,最大 20
    • offset:起始位置,从零开始
    • include:额外信息,包括answer_count,articles_count,gender,follower_count,is_followed,is_following,badge[?(type=best_answerer)].topics

收藏夹信息

  • URL:https://api.zhihu.com/collections/{cid}

收藏夹中的回答摘要

  • URL:https://api.zhihu.com/collections/{cid}/answers
  • 参数:
    • limit:数量,最大 20
    • offset:起始位置,从零开始

知乎话题

  • URL:https://www.zhihu.com/api/v4/topics/{tid}

知乎话题精华

  • URL:https://www.zhihu.com/api/v4/topics/{tid}/feeds/essence
  • 参数:
    • limit:数量,最大 20
    • offset:起始位置,从零开始
    • 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
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Scrapy,Python开发的一个快速,高层次的屏幕抓取和web抓取框架,用于抓取web站点并从页面中提取结构化...
    Evtion阅读 11,166评论 12 18
  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 13,466评论 0 23
  • 肚子痛了三四天 大概知道自己可能得了肠胃炎 因为上班不想请假 也因为讳疾忌医 从没有一个人去医院看过病 不敢去医...
    南絮与南阅读 1,865评论 0 0
  • 为了尽可能的保任这样的一种状态,也学雪师一样,剥析自己的内心,揭秘自己的成长历程,他的把那最痛的疤痕修复成最美的诗...
    凤凰未涅槃阅读 2,383评论 0 2
  • 关于爱情来不得半点虚假,任何手段在爱情面前都会显得苍白无力。任何一段情感都不会真的一帆风顺,总会出现一些问题,无论...
    piaozbl阅读 1,118评论 0 0