今日头条
其他 官方文档
分享今日新鲜事,数据来源今日头条
基本说明:
接口地址:http://is.snssdk.com/api/news/feed/v51/
返回格式:json
请求方式:get/post
请求示例:http://is.snssdk.com/api/news/feed/v51/
请求参数说明:
名称 类型 必填 说明
- - - -
返回参数说明:
名称 类型 说明
data array 数据详情
total_number int 总数
has_more bool 是否还有数据
login_status int 登录状态
tips array 标签
JSON返回示例:
{
	"message": "success",
	"data": [{
		"content": "{\"abstract\":\"“小康路上一个都不能少”,这是习近平总书记反复提及的庄严承诺。从民族地区到革命老区,习近平一路风雨,脚步不停,看基础设施、看公共服务,着眼大局、精准定位,开出一张张“脱贫药方”。“老区在全国建小康的征程中要同步前进,一个也不能少”;“脱贫、全面小康、现代化,一个民族都不能少”。\",\"action_list\":[{\"action\":1,\"desc\":\"\",\"extra\":{}},{\"action\":3,\"desc\":\"\",\"extra\":{}},{\"action\":7,\"desc\":\"\",\"extra\":{}},{\"action\":9,\"desc\":\"\",\"extra\":{}}],\"aggr_type\":1,\"allow_download\":false,\"article_sub_type\":0,\"article_type\":0,\"article_url\":\"http://app.cctv.com/special/cportal/detail/arti/index.html?id=ArtimvP4IgohSC3sO5Paon5O201123\",\"article_version\":0,\"ban_comment\":0,\"ban_immersive\":0,\"behot_time\":1627867877,\"bury_count\":0,\"bury_style_show\":0,\"cell_flag\":268697611,\"cell_layout_style\":1,\"cell_type\":0,\"comment_count\":35,\"content_decoration\":\"\",\"cursor\":1627867877000,\"digg_count\":7415,\"display_url\":\"http://toutiao.com/group/6931115306693689864/\",\"filter_words\":[{\"id\":\"8:0\",\"name\":\"看过了\",\"is_selected\":false},{\"id\":\"9:1\",\"name\":\"内容太水\",\"is_selected\":false},{\"id\":\"5:9300275\",\"name\":\"拉黑作者:央视新闻\",\"is_selected\":false}],\"forward_info\":{\"forward_count\":2},\"group_id\":6931115306693689864,\"group_source\":2,\"has_m3u8_video\":false,\"has_mp4_video\":0,\"has_video\":false,\"hot\":0,\"ignore_web_transform\":1,\"interaction_data\":\"\",\"is_key_video\":false,\"is_stick\":true,\"is_subject\":false,\"item_id\":6931115306693689864,\"item_version\":0,\"label\":\"置顶\",\"label_extra\":{\"is_redirect\":false,\"redirect_url\":\"\",\"icon_url\":{},\"style_type\":0},\"label_style\":1,\"level\":0,\"log_pb\":{\"impr_id\":\"20210802093117010212075214030E401F\",\"is_following\":\"0\"},\"media_info\":{\"avatar_url\":\"http://p5.toutiaoimg.com/origin/pgc-image/5b6f4006a56842658107f1287f45e450\",\"name\":\"央视新闻\",\"user_verified\":true,\"media_id\":4492956276,\"user_id\":4492956276,\"verified_content\":\"\",\"is_star_user\":false,\"recommend_reason\":\"\",\"recommend_type\":0,\"follow\":false},\"media_name\":\"央视新闻\",\"need_client_impr_recycle\":1,\"publish_time\":1613776038,\"raw_ad_data\":null,\"read_count\":3219454,\"repin_count\":25244,\"rid\":\"20210802093117010212075214030E401F\",\"share_count\":40485,\"share_info\":{\"share_url\":\"http://m.toutiao.com/group/6931115306693689864/?app=news_article\\u0026is_hit_share_recommend=0\",\"title\":\"系列时政微视频·变迁|一个都不能少——总书记指挥打赢世纪脱贫攻坚战\",\"description\":null,\"cover_image\":null,\"share_type\":{\"pyq\":0,\"qq\":0,\"qzone\":0,\"wx\":0},\"weixin_cover_image\":null,\"token_type\":1,\"on_suppress\":0,\"hidden_url\":null,\"video_url\":null,\"share_control\":null},\"share_type\":2,\"share_url\":\"http://m.toutiao.com/group/6931115306693689864/?app=news_article\\u0026is_hit_share_recommend=0\",\"show_dislike\":false,\"show_portrait\":false,\"show_portrait_article\":false,\"small_image\":null,\"source\":\"央视新闻\",\"source_icon_style\":4,\"source_open_url\":\"sslocal://profile?refer=video\\u0026uid=4492956276\",\"stick_label\":\"置顶\",\"stick_style\":1,\"tag\":\"video_domestic\",\"tag_id\":6931115306693689864,\"tip\":0,\"title\":\"系列时政微视频·变迁|一个都不能少——总书记指挥打赢世纪脱贫攻坚战\",\"ugc_recommend\":{\"activity\":\"\",\"reason\":\"中央广播电视总台新闻新媒体中心官方账号\"},\"url\":\"http://app.cctv.com/special/cportal/detail/arti/index.html?id=ArtimvP4IgohSC3sO5Paon5O201123\",\"user_info\":{\"avatar_url\":\"https://sf3-cdn-tos.toutiaostatic.com/img/pgc-image/5b6f4006a56842658107f1287f45e450~300x300.image\",\"name\":\"央视新闻\",\"description\":\"中央广播电视总台新闻新媒体中心官方账号\",\"user_id\":4492956276,\"user_verified\":true,\"verified_content\":\"中央广播电视总台新闻新媒体中心官方账号\",\"follow\":false,\"follower_count\":0,\"user_auth_info\":\"{\\\"auth_type\\\":\\\"0\\\",\\\"auth_info\\\":\\\"中央广播电视总台新闻新媒体中心官方账号\\\"}\",\"schema\":\"sslocal://profile?uid=4492956276\\u0026refer=all\",\"live_info_type\":0,\"living_count\":0},\"user_repin\":0,\"user_verified\":1,\"verified_content\":\"中央广播电视总台新闻新媒体中心官方账号\",\"video_style\":0,\"xi_related\":false}",
		"code": ""
	}],
	"total_number": 20,
	"has_more": true,
	"login_status": 0,
	"show_et_status": 0,
	"post_content_hint": "分享今日新鲜事",
	"has_more_to_refresh": true,
	"action_to_last_stick": 0,
	"feed_flag": 0,
	"tips": {
		"type": "app",
		"display_duration": 2,
		"display_info": "今日头条推荐引擎有20条更新",
		"display_template": "今日头条推荐引擎有%s条更新",
		"open_url": "",
		"web_url": "",
		"download_url": "",
		"app_name": "今日头条",
		"package_name": ""
	},
	"is_use_bytedance_stream": false,
	"get_offline_pool": false,
	"location": null,
	"api_base_info": null,
	"show_last_read": false,
	"last_response_extra": {
		"data": "eyJoYXNfZm9sbG93aW5nIjpmYWxzZX0"
	}
}
服务级错误码参照
错误码 说明
- -
完整教学代码示例
<?php
/**
 * Created by PhpStorm.
 * User: FZS
 * Time: 2021/08/02 19:26
 */
class freeApi
{
    private $apiUrl;

    public function __construct()
    {
        $this->apiUrl = 'http://is.snssdk.com/api/news/feed/v51/';
    }

    /**
     * 获取结果
     * @return array
     */
    public function getResult()
    {
        return file_get_contents($this->apiUrl);
    }
}
package main

import (
	"fmt"
	"io/ioutil"
	"log"
	"net/http"
)

const (
	APIURL   = "http://is.snssdk.com/api/news/feed/v51/"
)

func main() {
	queryUrl := fmt.Sprintf("%s",APIURL)
	resp, err := http.Get(queryUrl)
	if err != nil {
		log.Println(err)
		return
	}

	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)

	if err != nil {
		fmt.Println(err)
		return
	}

	fmt.Println(string(body))
}