Skip to content

Latest commit

 

History

History
executable file
·
578 lines (510 loc) · 20.9 KB

36Kr.md

File metadata and controls

executable file
·
578 lines (510 loc) · 20.9 KB

36Kr API接口

资讯类别

url:

  • https://36kr.com/pp/api/feed

拼接参数:

  • type:数据类型,可选择default、web、industry

示例:

https://36kr.com/pp/api/feed?type=web

json 示例

{
    "code": 0,
    "timestamp": 1555896818,
    "timestamp_rt": 1555896818,
    "data": {
        "items": [
            {
                "id": 303,
                "type": "web",
                "project_id": 1,
                "key": "web_news",
                "state": "published",
                "is_system": 0,
                "api": null,
                "name": "最新",
                "mark": "none",
                "description": "",
                "ad_info": "{\"banner\":[{\"ad_id\":\"\",\"position\":2}],\"feed\":[{\"ad_id\":\"\",\"position\":4},{\"ad_id\":\"\",\"position\":9},{\"ad_id\":\"\",\"position\":14},{\"ad_id\":\"\",\"position\":19}]}",
                "order_num": 1,
                "user_id": 0,
                "user_id_edited": 132730,
                "published_at": null,
                "created_at": null,
                "updated_at": "2019-03-12 16:49:39"
            }
        ],
        "test_devices": [
            "83137D15-5ECA-4334-AEC3-201BB623B27E",
            "F9917BD1-CA10-488F-9331-C8D276259CF2",
        ]
    }
}

资讯

url:

  • https://36kr.com/pp/api/feed-stream

拼接参数:

  • type:类别
  • feed_id: 分类ID
  • b_id :获取此 id 之前的数据(用于分页)
  • per_page : 每页显示条数

示例:

https://36kr.com/pp/api/feed-stream?type=web_news&feed_id=304&b_id=344364&per_page=30

json 示例


快讯

url:

  • https://36kr.com/api/newsflash

####拼接参数:

  • b_id :获取此 id 之前的快讯(用于分页)
  • per_page : 每页显示条数
  • column_ids :快讯所属分类 id(可选字段)
  • _:时间戳(可选字段)
  • no_bid:false(可选字段)
23:大公司

67:早期项目

68:B轮后

69:资本

72:其他

101:政策

111:产品

112:产业

示例:

[https://36kr.com/api/newsflash?b_id=152648&per_page=5& column_ids=23](https://36kr.com/api/newsflash?b_id=152648&per_page=5& column_ids=23)

json 示例:

{
    "code": 0,
    "timestamp": 1555896239,
    "timestamp_rt": 1555896239,
    "data": {
        "items": [
            {
                "id": 152647,
                "project_id": 1,
                "column_id": 72,
                "post_id": null,
                "is_top": 0,
                "pin": 0,
                "title": "汽车之家回应网传遭中升集团封杀:不存在谁封杀谁的问题",
                "catch_title": "",
                "description": "针对此前汽车之家疑遭到中升集团封杀的传闻,汽车之家回应称,我们尚未从官方渠道得到中升集团要封杀汽车之家的正式消息。商业合作中价格谈判是正常的,即便没有达成一致,也不存在谁封杀谁的问题。(腾讯证券)",
                "cover": "",
                "news_url_type": "news_url",
                "news_url": "http://stock.qq.com/a/20190111/011179.htm",
                "user_id": 167521,
                "published_at": "2019-01-11 21:49:08",
                "created_at": "2019-01-11 21:49:08",
                "updated_at": "2019-01-11 21:49:08",
                "counters": {
                    "view_count": 36,
                    "pv": 0,
                    "pv_mobile": 2,
                    "pv_app": 34,
                    "comment": 0
                },
                "extraction_tags_arr": [],
                "extraction_tags": "[]",
                "column": {
                    "id": 72,
                    "name": "其他",
                    "bg_color": "#000000",
                    "type": "normal"
                },
                "db_counters": [
                    {
                        "id": 2889934,
                        "entity_type": "newsflash",
                        "entity_id": 152647,
                        "count_type": "pv_app",
                        "key": "kr_newssite_counter:newsflash_152647_pv_app",
                        "value": 34,
                        "created_at": "2019-01-16 01:35:52",
                        "updated_at": "2019-03-02 11:50:23",
                        "entity_id_old": null
                    },
                    {
                        "id": 2890121,
                        "entity_type": "newsflash",
                        "entity_id": 152647,
                        "count_type": "pv_mobile",
                        "key": "kr_newssite_counter:newsflash_152647_pv_mobile",
                        "value": 2,
                        "created_at": "2019-01-16 01:43:39",
                        "updated_at": "2019-01-17 11:01:54",
                        "entity_id_old": null
                    }
                ],
                "user": {
                    "id": 167521,
                    "name": "欧阳伟康",
                    "avatar_url": "https://pic.36krcnd.com/avatar/201706/22114434/fgudgkitazowq2xh.jpg!480"
                },
                "news_url_title": "原文链接",
                "station_info": null
            }
        ]
    }
}

解析:

  • code :状态码(0 为成功)
  • data :返回的数据
    • items :返回的所有快讯(数组)
      • column :分类信息
        • id :快讯所属分类 id
        • name :所属分类名称
      • column_id :快讯所属分类 id
      • counters :统计数据
        • comment :快讯评论数
        • view_count :快讯浏览量(该值=pv+pv_mobile+pv_app)
      • description :快讯内容
      • id :快讯 id
      • news_url :快讯原文链接
      • published_at :快讯发布时间
      • title :快讯标题
      • user :作者信息
        • avatar_url :作者头像链接
        • id :作者 id(与 user_id 字段内容一致)
        • name :作者昵称
      • user_id :作者 id

视频

url:

  • https://36kr.com/pp/api/info-flow/channel_video/videos

拼接参数:

  • b_id :获取此 id 之前的数据(用于分页)
  • per_page : 每页显示条数

示例:

https://36kr.com/pp/api/info-flow/channel_video/videos?b_id=40492&per_page=20

json 示例

{
    "code": 0,
    "timestamp": 1555899496,
    "timestamp_rt": 1555899496,
    "data": {
        "items": [
            {
                "id": 40230,
                "title": "一个靠涂鸦变废为宝的故事:地产商靠着涂鸦将地区房价炒升三成",
                "format": "quicktime",
                "url": "https://video.36krcnd.com/201904/17063733/xmzwtbibzb5vwc24.mov",
                "bitrate": 0,
                "filesize": 820549911,
                "duration": 506,
                "user_id": 13941786,
                "created_at": "2019-04-17 14:58:02",
                "updated_at": "2019-04-20 10:00:12",
                "template_info": {
                    "template_type": "small_image",
                    "template_title": "一个靠涂鸦变废为宝的故事:地产商靠着涂鸦将地区房价炒升三成",
                    "template_title_isSame": true,
                    "template_cover": [
                        "https://pic.36krcnd.com/201904/17063801/j7285xm7lyrg0exm!heading"
                    ],
                    "template_extra": {
                        "vtype": "normal",
                        "like_count": "15",
                        "is_like": false
                    }
                },
                "vtype": "normal",
                "summary": "一个靠涂鸦变废为宝的故事:地产商靠着涂鸦将地区房价炒升三成",
                "web_cover": "https://pic.36krcnd.com/201904/17063746/ocqlx8ovxeyfscix",
                "column_id": 18,
                "published_at": "2019-04-20 10:00:12",
                "cover": "https://pic.36krcnd.com/201904/17063801/j7285xm7lyrg0exm!heading",
                "children": [
                    {
                        "id": 40234,
                        "format": "mov,mp4,m4a,3gp,3g2,mj2",
                        "url": "http://video.chuangkr.china.com.cn/201904/17063733/xmzwtbibzb5vwc24_fmp4_vb384.mp4",
                        "bitrate": 371,
                        "filesize": 31894771,
                        "duration": 506
                    },
                    {
                        "id": 40235,
                        "format": "mov,mp4,m4a,3gp,3g2,mj2",
                        "url": "http://video.chuangkr.china.com.cn/201904/17063733/xmzwtbibzb5vwc24_fmp4_vb512.mp4",
                        "bitrate": 496,
                        "filesize": 39834159,
                        "duration": 506
                    },
                    {
                        "id": 40236,
                        "format": "mov,mp4,m4a,3gp,3g2,mj2",
                        "url": "http://video.chuangkr.china.com.cn/201904/17063733/xmzwtbibzb5vwc24_fmp4_vb1152.mp4",
                        "bitrate": 1123,
                        "filesize": 79432446,
                        "duration": 506
                    }
                ],
                "column": {
                    "id": 18,
                    "name": "氪视频",
                    "type": "normal"
                },
                "user": {
                    "id": 13941786,
                    "name": "当下频道",
                    "email": null,
                    "realname": null,
                    "nickname": "当下频道",
                    "avatar_url": "https://krplus-pic.b0.upaiyun.com/avatar/201902/12103602/wlinr9e03jokxgq3",
                    "introduction": ""
                },
                "counters": {
                    "favorite": 6,
                    "comment": 0,
                    "like": 15
                },
                "url_384": "http://video.chuangkr.china.com.cn/201904/17063733/xmzwtbibzb5vwc24_fmp4_vb384.mp4",
                "filesize_384": 31894771,
                "duration_384": 506,
                "url_512": "http://video.chuangkr.china.com.cn/201904/17063733/xmzwtbibzb5vwc24_fmp4_vb512.mp4",
                "filesize_512": 39834159,
                "duration_512": 506,
                "url_1152": "http://video.chuangkr.china.com.cn/201904/17063733/xmzwtbibzb5vwc24_fmp4_vb1152.mp4",
                "filesize_1152": 79432446,
                "duration_1152": 506,
                "is_top": 0
            }
        ]
    }
}

专题

url:

  • https://36kr.com/pp/api/monographic

拼接参数:

  • b_id :获取此 id 之前的数据(用于分页)
  • per_page : 每页显示条数

示例:

https://36kr.com/pp/api/monographic?b_id=2973&per_page=21

json 示例

{
    "code": 0,
    "timestamp": 1555899712,
    "timestamp_rt": 1555899712,
    "data": {
        "items": [
            {
                "id": 2972,
                "state": "published",
                "title": "今日值得看——36氪全天热度文章",
                "summary": "36氪 今日值得看,为你盘点每天所有读者「最喜欢」、「值得看」的文章。今日最热文章【36氪独家 | 罗永浩新创业方向为电子烟,品牌或命名为「小野」】......其它热门推荐【永不消失的小卖部】【互联网最后的入侵】【微信流量生意困局,与张小龙的「十字路口」】>>",
                "cover": "https://pic.36krcnd.com/201904/11102101/wh0hrot41cdevl6w!heading",
                "cover_web": "https://pic.36krcnd.com/201904/11102053/sa4e48y9403c0lpm!heading",
                "user_id": 1137199863,
                "published_at": "2019-04-11 18:25:18",
                "finished_at": null,
                "created_at": "2019-04-11 18:25:18",
                "updated_at": "2019-04-11 21:15:16",
                "template_info": {
                    "template_type": "small_image",
                    "template_title": "今日值得看——36氪全天热度文章",
                    "template_title_isSame": true,
                    "template_cover": [
                        "https://pic.36krcnd.com/201904/11102123/gxocbnkiqz80gwny!heading"
                    ],
                    "template_extra": {
                        "entity_list": []
                    }
                },
                "type": "info_flow",
                "entity_flag": null,
                "weight": 0
            }
        ]
    }
}

活动

url:

  • https://chuang.36kr.com/api/actapply?page=2&pageSize=1

拼接参数:

  • page :页码
  • pageSize : 每页显示条数

示例:

https://chuang.36kr.com/api/actapply?page=2&pageSize=1

json 示例

{
    "code": 0,
    "data": {
        "totalPages": 707,
        "pageSize": 1,
        "page": 2,
        "data": [
            {
                "activityBriefArray": [],
                "applyEndTime": 2147443200000,
                "isEmailNotificationOn": false,
                "auditorEmail": "[email protected]",
                "proposerRole": "entrepreneur",
                "activityBeginTime": 1561478400000,
                "city": "上海",
                "tagId": "6",
                "headImageUrl": "",
                "link": "https://www.mwcshanghai.cn/?utm_campaign=MWCS19_Website&utm_source=36kr&utm_medium=Partners&utm_term=banner&utm_content=740420",
                "description": "该会是行业交流创意与合作汇聚的顶级盛会探索智联万物对数字体验行业生态与生活的影响",
                "updateTime": 1554105463808,
                "activityExtraItemArray": [
                    {
                        "extra_serial_id": "item_1",
                        "question": "单行文本框",
                        "option_type": "textInput",
                        "description": "",
                        "placeholder": "",
                        "option_array": [],
                        "is_required": false,
                        "validation": "",
                        "min_length": "0",
                        "max_length": "500"
                    }
                ],
                "title": "2019 MWC上海",
                "applyBeginTime": -28800000,
                "listImageUrl": "https://krplus-pic.b0.upaiyun.com/201904/01/99473b6c849461faacf5e1a27fc69589.jpg",
                "activityId": "919",
                "activityEndTime": 1561737355000,
                "createTime": 1554105201508,
                "isInvestorApp": false,
                "auditPhases": [],
                "categoryId": "0",
                "status": "online"
            }
        ],
        "totalCount": 707
    },
    "msg": "操作成功!"
}

url:

  • https://36kr.com/pp/api/search/entity-search

拼接参数:

  • page :页码
  • pagesize:每页显示条数
  • sort :排序 date:日期、score:相关性
  • entity_type : post文章、newsflash快讯、video视频、monographic专题、user作者
  • keyword :搜索关键字

示例:

https://36kr.com/pp/api/search/entity-search?page=2&per_page=40&sort=date&entity_type=post&keyword=上海车展

json 示例

{
    "code": 0,
    "timestamp": 1555900235,
    "timestamp_rt": 1555900235,
    "data": {
        "total_count": 4,
        "page": 1,
        "page_size": 40,
        "items": [
            {
                "id": 2965,
                "title": "少数派的未来猜想-2019上海车展特别策划",
                "project_id": 1,
                "template_info": {
                    "template_type": "small_image",
                    "template_title": "少数派的未来猜想-2019上海车展特别策划",
                    "template_title_isSame": true,
                    "template_cover": [
                        "https://pic.36krcnd.com/201904/11030013/13e38qfdjr1z7tzy!heading"
                    ],
                    "template_extra": {
                        "entity_list": []
                    }
                },
                "entity_flag": "",
                "summary": "少数派的未来猜想是36氪三大核心内容IP之一,通过少数派的视野去探寻商业世界的趋势,发现少数派有价值的判断,激发不一样的思维变革。随着移动互联网、人工智能、大数据、云计算、新能源等新一代「科技」的蓬勃发展,汽车行业正在开始重构,「科技」是变革的核心动能。「汽车出行」是36氪核心关注的核心领域,本次少数派的未来猜想-2019上海国际汽车工业展览会特别策划将以“科技变革、行业布局、未来趋势”的视角为用户讲述“汽车品牌如何共创美好生活”。",
                "published_at": "2019-04-16T09:05:02+08:00",
                "highlight": {
                    "title": [
                        "少数派的未来猜想-2019<em>上</em><em>海</em><em>车</em><em>展</em>特别策划"
                    ]
                },
                "_type": "monographic",
                "_score": null
            },
            {
                "id": 642,
                "title": "没有了车模,来聊聊上海车展的技术与商业元素",
                "project_id": "1",
                "template_info": {
                    "template_type": "small_image",
                    "template_title": "没有了车模,来聊聊上海车展的技术与商业元素",
                    "template_cover": [
                        "https://pic.36krcnd.com/avatar/201704/21041216/94zggmwth38dez4b.jpg!heading"
                    ]
                },
                "summary": "一年一度的上海国际车展于4月19号在上海国家会展中心拉开帷幕。在自动驾驶和出行服务概念提出了很多年的情况下,各大汽车厂商几乎都会讲车联网和无人驾驶的故事了。然而现在人工智能的大潮将至,开始有汽车厂商试图与AI公司合作,试图把汽车打造为未来智能生活的一个组成部分。互联网科技公司也再次证明了自己在汽车生态领域的价值,百度正式推出“Apollo计划”,向合作伙伴开放百度无人驾驶软件平台,帮助整机厂结合车辆和硬件系统,快速搭建一套属于自己的完整的自动驾驶系统。",
                "published_at": "2017-04-21T12:49:03+08:00",
                "highlight": {
                    "title": [
                        "没有了车模,来聊聊<em>上</em><em>海</em><em>车</em><em>展</em>的技术与商业元素"
                    ]
                },
                "_type": "monographic",
                "_score": null
            },
            {
                "id": 631,
                "title": "2017年上海车展",
                "project_id": "1",
                "template_info": {
                    "template_type": "small_image",
                    "template_title": "2017年上海车展",
                    "template_cover": [
                        "https://pic.36krcnd.com/avatar/201704/18173323/226yuhvnas7r668m.jpeg!heading"
                    ]
                },
                "summary": "2017年上海车展",
                "published_at": "2017-04-19T01:37:18+08:00",
                "highlight": {
                    "title": [
                        "2017年<em>上</em><em>海</em><em>车</em><em>展</em>"
                    ]
                },
                "_type": "monographic",
                "_score": null
            },
            {
                "id": 617,
                "title": "2017年上海车展",
                "project_id": "1",
                "template_info": {
                    "template_type": "small_image",
                    "template_title": "2017年上海车展",
                    "template_cover": [
                        "https://pic.36krcnd.com/avatar/201704/16150342/go32acdrbxlhzcbf.jpg!heading"
                    ]
                },
                "summary": "2017年上海车展",
                "published_at": "2017-04-16T23:08:41+08:00",
                "highlight": {
                    "title": [
                        "2017年<em>上</em><em>海</em><em>车</em><em>展</em>"
                    ]
                },
                "_type": "monographic",
                "_score": null
            }
        ]
    }
}