今日头条热点榜 今日头条实时热点榜, 实时数据 接口标识: ToutiaoHotList 接口状态: 正常 模块状态: 正常 数据来源: 官方 计费模式: 按次 免KEY调用: 不允许 所属分类: 全网热点榜 (开通后可享无并发限制, 及KEY相关功能设置)

接口地址:

返回格式:

请求方式:

请求示例:

全网热点榜 今日头条 今日头条实时热点榜 今日头条实时热点榜API

请求参数:

名称 必填 类型 说明

返回参数:

名称 类型 说明

返回示例:


复制参数 复制返回 转为GET

API响应码:

名称 类型 响应码 说明 解决方案
code String 1 查询成功 -
code String 0 查询失败 重新发起请求
code String 11001 参数不可为空 查看文档获取参数
code String 11002 查询数量超过最大或最小限制 修改查询数量 1至50内
code String 11003 参数识别失败 修改参数重新发起请求

系统响应码:

名称
类型
响应码
说明
解决方案
code
String10001域名效验失败请求了错误的域名,检查请求域名是否正确
code
String
10002请求被拒绝
可能是你的IP、参数、来源 不在允许范围内
code
String
10003调用服务已关闭
管理员暂时关闭了调用功能,可能是在维护
code
String
10004接口不存在
接口不存在,检查请求接口URL
code
String
10005引导缺失
接口未完善,或者接口内部错误。这种情况一般联系管理员解决
code
String
10006接口调试中
接口上架前的调试,一般这种情况不超过1个小时即可恢复
code
String
10007接口维护中
接口正在维护
code
String
10008接口状态未知
检查KEY状态,或者查看接口状态
code
String
10009需要KEY
注册免费开通即可获取相应KEY
code
String
10010无效KEY
检查KEY是否正确,登录控制台获取正确的KEY
code
String
10011请求过于频繁
请求并发高出系统限制,(无KEY请求 10秒10次,有KEY请求10秒100次)
code
String
10012账户被禁用
一般不会出现这种情况,如果你遇到恭喜你!
code
String
10013该KEY已过期
KEY过期了,登录控制台续费
code
String
10014该KEY被开发者禁用
KEY被开发者禁用了,登录控制台打开
code
String
10015该KEY被管理员禁用
可能出现违规调用,KEY被管理员禁用了
code
String
10016该KEY状态未知
登录控制台检查KEY状态
code
String
10017没有可用次数
KEY是按次计费,没有可用次数了,登录控制台续费
code
String
10018开发者启用请求规则限制
开发者启用了请求规则限制,登录控制台查看请求请求规则设置
code
String
10019未指定模块
请求接口地址不完整,只带了接口标识,没有带模块标识,查看文档获取正确的URL
code
String
10020模块不存在
请求地址错误,带的模块标识是错误的,查看文档获取正确的模块标识
codeString10021模块维护中只维护当前模块。如果接口存在多个模块 不会影响其他模块
code
String
10022接口内部错误
检查请求参数是否合法,尝试换个请求参数,如果持续性不行,请联系我们

#1:   10开头 为系统级响应码 、11开头 为API模块级响应码。后面数字代表具体位置

代码示例:

C#

//using System.IO;
//using System.Text;
//using System.Net;
//using System.Net.Security;
//using System.Security.Cryptography.X509Certificates;

        private const String apiurl = "https://u.api.enetapi.com/api/v2/";  //统一请求URL无需修改
        private const String alias = "ToutiaoHotList/realtime";  	//接口唯一标识/模块
        private const String key = "KEY";  		//自己的KEY
		private const String method = "GET";

        static void Main(string[] args)
        {
            String params = "&limit=3";  //参数
            String bodys = "";
            String url = apiurl + alias;
            HttpWebRequest httpRequest = null;
            HttpWebResponse httpResponse = null;

            if (0 < params.Length)
            {
                url = url + "?key="+ key + params;
            }

            if (apiurl.Contains("https://"))
            {
                ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
                httpRequest = (HttpWebRequest)WebRequest.CreateDefault(new Uri(url));
            }
            else
            {
                httpRequest = (HttpWebRequest)WebRequest.Create(url);
            }
            httpRequest.Method = method;
            if (0 < bodys.Length)
            {
                byte[] data = Encoding.UTF8.GetBytes(bodys);
                using (Stream stream = httpRequest.GetRequestStream())
                {
                    stream.Write(data, 0, data.Length);
                }
            }
            try
            {
                httpResponse = (HttpWebResponse)httpRequest.GetResponse();
            }
            catch (WebException ex)
            {
                httpResponse = (HttpWebResponse)ex.Response;
            }

            Console.WriteLine(httpResponse.StatusCode);
            Console.WriteLine(httpResponse.Method);
            Console.WriteLine(httpResponse.Headers);
            Stream st = httpResponse.GetResponseStream();
            StreamReader reader = new StreamReader(st, Encoding.GetEncoding("utf-8"));
            Console.WriteLine(reader.ReadToEnd());
            Console.WriteLine("\n");

        }

        public static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
        {
            return true;
        }


PHP

<?php
    $apiurl = "https://u.api.enetapi.com/api/v2/";  	//统一请求URL无需修改
    $alias = "ToutiaoHotList/realtime"; 	//接口唯一标识/模块
    $key = "KEY";	//自己的KEY
	$method = "GET";
    $headers = array();
    $params = "&limit=3";	//参数
    $bodys = "";
    $url = $apiurl . $alias . "?key=" .$key. $params;
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($curl, CURLOPT_FAILONERROR, false);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HEADER, false);
    if (1 == strpos("$".$apiurl, "https://"))
    {
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
    }
	print_r(curl_exec($curl));
?>


Python

import urllib, urllib2, sys
import ssl


apiurl = 'https://u.api.enetapi.com/api/v2/'		//统一请求URL无需修改
alias = 'ToutiaoHotList/realtime'		//接口唯一标识/模块
key = 'KEY'			//自己的KEY
params = '&limit=3'		//参数
method = 'GET'
bodys = {}
url = apiurl + alias + '?key=' + key + params

request = urllib2.Request(url)
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
response = urllib2.urlopen(request, context=ctx)
content = response.read()
if (content):
    print(content)


ObjectC

NSString *apiurl = @"https://u.api.enetapi.com/api/v2/";		//统一请求URL无需修改
NSString *alias = @"ToutiaoHotList/realtime";		//接口唯一标识/模块
NSString *key = @"?KEY";			//自己的KEY
NSString *params = @"&limit=3"; 	//参数
NSString *method = @"GET";
NSString *url = [NSString stringWithFormat:@"%@%@%@",  apiurl,  alias ,key , params];
NSString *bodys = @"";

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString: url]  cachePolicy:1  timeoutInterval:  5];
request.HTTPMethod  =  method;
NSURLSession *requestSession = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
NSURLSessionDataTask *task = [requestSession dataTaskWithRequest:request
    completionHandler:^(NSData * _Nullable body , NSURLResponse * _Nullable response, NSError * _Nullable error) {
    NSLog(@"Response object: %@" , response);
    NSString *bodyString = [[NSString alloc] initWithData:body encoding:NSUTF8StringEncoding];

    //打印body
    NSLog(@"Response body: %@" , bodyString);
    }];

[task resume];


CURL

curl -i -k --get --include 'https://u.api.enetapi.com/api/v2/ToutiaoHotList/realtime?limit=3&key=自己的KEY'