Contact Us
Back top
Current Location : APIs > 东方头条
东方头条 Transactions( 114 )

东方头条

244

Intro. :

Tag : 新闻

On Shelves Time : 2016-12-28

Type :

Total invocations(updated per hour)

东方头条 ¥ 1.00 yuan/100calls 辅助工具 每天免费测试 30

接口服务

接口延迟等级: 低(1~3秒内) 平台反爬等级: 很低(1年更改1次)
平台升级频率: 很低(1年升级1次)

数据指标

最大数据量: 无限制 最大页数: 无限制
每页数据量: 20 数据实时性: 实时
数据回溯性: 全部 数据排序项: 平台默认
缺失的数据字段: 暂无 备注:

API Mark

Example

注: 该接口为实时数据接口,可能受目标平台或网络状态影响,会存在一定的错误率,建议在程序中加入出错重试机制。
Error Code
-- 请求示例 url 默认请求参数已经做URL编码 curl -i "http://api01.idataapi.cn:8000/news/eastday?apikey=your apikey&kw=nba"
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; import java.net.URL; import java.nio.charset.Charset; import org.json.JSONException; import org.json.JSONObject; import java.io.PrintWriter; import java.net.URLConnection; public class Example { private static String readAll(Reader rd) throws IOException { StringBuilder sb = new StringBuilder(); int cp; while ((cp = rd.read()) != -1) { sb.append((char) cp); } return sb.toString(); } public static JSONObject postRequestFromUrl(String url, String body) throws IOException, JSONException { URL realUrl = new URL(url); URLConnection conn = realUrl.openConnection(); conn.setDoOutput(true); conn.setDoInput(true); PrintWriter out = new PrintWriter(conn.getOutputStream()); out.print(body); out.flush(); InputStream instream = conn.getInputStream(); try { BufferedReader rd = new BufferedReader(new InputStreamReader(instream, Charset.forName("UTF-8"))); String jsonText = readAll(rd); JSONObject json = new JSONObject(jsonText); return json; } finally { instream.close(); } } public static JSONObject getRequestFromUrl(String url) throws IOException, JSONException { URL realUrl = new URL(url); URLConnection conn = realUrl.openConnection(); InputStream instream = conn.getInputStream(); try { BufferedReader rd = new BufferedReader(new InputStreamReader(instream, Charset.forName("UTF-8"))); String jsonText = readAll(rd); JSONObject json = new JSONObject(jsonText); return json; } finally { instream.close(); } } public static void main(String[] args) throws IOException, JSONException { // 请求示例 url 默认请求参数已经做URL编码 String url = "http://api01.idataapi.cn:8000/news/eastday?apikey=your apikey&kw=nba"; JSONObject json = getRequestFromUrl(url);; System.out.println(json.toString()); } }
//using System.Net.Security; //using System.Security.Cryptography.X509Certificates; private const String method = "GET"; static void Main(string[] args) { String bodys = ""; // 请求示例 url 默认请求参数已经做URL编码 String url = "http://api01.idataapi.cn:8000/news/eastday?apikey=your apikey&kw=nba"; HttpWebRequest httpRequest = null; HttpWebResponse httpResponse = null; if (url.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 $method = "GET"; // 请求示例 url 默认请求参数已经做URL编码 $url = "http://api01.idataapi.cn:8000/news/eastday?apikey=your apikey&kw=nba"; $curl = curl_init(); curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_FAILONERROR, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HEADER, true); curl_setopt($curl, CURLOPT_ENCODING, "gzip"); var_dump(curl_exec($curl)); ?>
# coding:utf-8 """ Compatible for python2.x and python3.x requirement: pip install requests """ from __future__ import print_function import requests # 请求示例 url 默认请求参数已经做URL编码 url = "http://api01.idataapi.cn:8000/news/eastday?apikey=your apikey&kw=nba" headers = { "Accept-Encoding": "gzip", "Connection": "close" } if __name__ == "__main__": r = requests.get(url, headers=headers) json_obj = r.json() print(json_obj)

Request Field( Params marked* means users should choose one from the each marked items to fill in.)

Property Name Type Mandatory Example Description
kw string * nba 关键词
catid string * nba 新闻分类搜索
pageToken string 翻页值
contentType string contentType=3,返回正文带html标签。

Response Fields

Property Name Type Example Description
  • hasNext boolean true 是否有下一页
  • retcode string 000000 返回的状态码
  • appCode string eastday 本次查询的api名
  • dataType string news 本次查询的api类型
  • pageToken string 9223370542285869281 翻页值
  • data array [...] 返回的数据
  • posterScreenName string 篮球那些事 发布者名称
  • url string http://mini.eastday.com/mobile/170512171 新闻链接
  • publishDateStr string 2017-05-12T09:13:29 发布时间(UTC时间)
  • title string 近7年NBA总决赛精彩瞬间,詹姆斯6进总决赛,死亡封盖成经典! 标题
  • publishDate number 1494580409 发布日期时间戳
  • content string 随着火箭出局,NBA总决赛的脚步已经越来越近,今天,我们就先回味下近七年总决赛的 新闻内容
  • imageUrls array [...] 图像url合集
  • id string 170512171329872 新闻ID

Returns The Sample

{
    "hasNext": true,
    "retcode": "000000",
    "appCode": "eastday",
    "dataType": "news",
    "pageToken": "9223370542285869281",
    "data": [
        {
            "posterId": null,
            "commentCount": null,
            "posterScreenName": "篮球那些事",
            "tags": null,
            "url": "http:\/\/mini.eastday.com\/mobile\/170512171329872.html",
            "publishDateStr": "2017-05-12T09:13:29",
            "title": "近7年NBA总决赛精彩瞬间,詹姆斯6进总决赛,死亡封盖成经典!",
            "publishDate": 1494580409,
            "content": "随着火箭出局,NBA总决赛的脚步已经越来越近,今天,我们就先回味下近七年总决赛的精彩瞬间,为总决赛预热!黄绿大战,已成为一代人的回忆,2010年总决赛抢七大战,加索尔大发神威,打的非常强硬,图为加索尔强势突破篮下得分!那场比赛加索尔砍下19分18篮板,凭借加嫂的表现,湖人最终夺冠。2011年诺维斯基单核带队杀入总决赛,犹如天神下凡,击败热火三巨头,夺得个人第一个总冠军,就此奠定历史4大前锋的地位。图为总决赛G2,最后57秒双方打成90平,司机接管比赛,连得五分锁定胜局2012年总决赛热火打雷霆G4,詹姆斯腿部抽筋,被抬出休息,那一年季后赛詹姆斯场均出场42.8分钟,砍下场均30.3分9.7篮板5.6助攻的全能数据!2013年总决赛热火打马刺G6,热火一只脚已经踏在了死亡线上,凭借雷阿伦关键时刻的惊天三分,扳平比分,拖进加时赛,成了无法复制的经典。最终热火赢得了系列赛,詹姆斯也夺得了生涯第二冠!2014年总决赛马刺卷土重来,依然对阵热火,这一次老马刺没有给热火太多机会,4-1早早的结束战斗!图为马刺21号新秀,封盖鸟人安德森!2015年被称为勇士年,金州五小的死亡阵容,所向披靡,一路杀进总决赛!然而面对缺兵少将的骑士,勇士也未能占到太多便宜!绝境看伊戈达拉,一哥在攻防两端表现出色,G6更是独得25分,帮助勇士夺得胜利2016年勇士骑士再次会师总决赛,抢七大战,詹姆斯钉板大帽伊戈达拉,追帽库里!帮助骑士在1-3落后的情况下惊天逆转,为克利夫兰带来阔别52年的总冠军。本文为一点号作者原创,未经授权不得转载",
            "imageUrls": [
                "https:\/\/09.imgmini.eastday.com\/mobile\/20170512\/20170512171329_4963963297ea0e2fc59d79b38b4d3334_1.jpeg",
                "https:\/\/09.imgmini.eastday.com\/mobile\/20170512\/20170512171329_4963963297ea0e2fc59d79b38b4d3334_2.jpeg",
                "https:\/\/09.imgmini.eastday.com\/mobile\/20170512\/20170512171329_4963963297ea0e2fc59d79b38b4d3334_3.jpeg",
                "https:\/\/09.imgmini.eastday.com\/mobile\/20170512\/20170512171329_4963963297ea0e2fc59d79b38b4d3334_4.jpeg",
                "https:\/\/09.imgmini.eastday.com\/mobile\/20170512\/20170512171329_4963963297ea0e2fc59d79b38b4d3334_5.jpeg",
                "https:\/\/09.imgmini.eastday.com\/mobile\/20170512\/20170512171329_4963963297ea0e2fc59d79b38b4d3334_6.jpeg",
                "https:\/\/09.imgmini.eastday.com\/mobile\/20170512\/20170512171329_4963963297ea0e2fc59d79b38b4d3334_7.jpeg"
            ],
            "id": "170512171329872"
        }
    ]
}

Detailed Data

No Details

状态码

Status Code Return Value Format : JSON

{

message:"API rate limit exceeded",

retcode:100703

}

The API in our platform is only paid on number of calls. For the detail, please refer to the below table.

Status Code Code Meaning Detailed Description Need paid or not?
000000 invoke successfully(data is not null) 成功调用并返回数据
100002 Search no result 目标参数搜索没结果
100301 Account not found 用户帐号不存在
100303 Search no result 账号未收录
100000 Server internal error 服务器内部错误
100001 Network error 网络错误
100004 Target server error 目标服务器错误
100005 Param error 用户输入参数错误
100700 Invalid authentication credentials 授权失败
100701 API stopped 您的当前API已停用
100702 Account stopped 您的账户已停用
100703 API rate limit exceeded 并发已达上限
100704 API maintenance API维护中
100705 API not found with these values API不存在
100706 Please add api first 请先添加api
100707 Number of calls exceeded 调用次数超限
100802 Missing url param 'time' or uri path is not equal to 2 请求路径错误或者缺少"time"参数
100803 Wrong pageToken 参数pageToken有误

Often With The Purchase Of Data