Contact Us
Back top
Current Location : APIs > 通用新闻资讯接口
通用新闻资讯接口 Transactions( 22186 )

通用新闻资讯接口

1493

Intro. : Cover over 30 thousand worldwide news website and 100+ apps (include wechat, toutiao and so on)

Tag : 新闻

On Shelves Time : 2018-11-05

Type :

Total invocations(updated per hour)

通用新闻资讯接口 ¥ 3.00 yuan/100calls 辅助工具 每天免费测试 30

接口服务

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

数据指标

最大数据量: 无限制 最大页数: 无限制
每页数据量: 20 数据实时性: 实时
数据回溯性: 30天 数据排序项: 发布时间
缺失的数据字段: 暂无 备注:

API Mark

Example

Error Code
-- 请求示例 url 默认请求参数已经做URL编码 curl -i "http://api01.idataapi.cn:8000/article/idataapi?apikey={Your apikey}&kw="
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/article/idataapi?apikey={Your apikey}&kw="; 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/article/idataapi?apikey={Your apikey}&kw="; 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/article/idataapi?apikey={Your apikey}&kw="; $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/article/idataapi?apikey={Your apikey}&kw=" 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 行业,调研,公司,基金,电子 查询关键词。逗号分割,搭配kwMode使用
kwMode string or and或者or
publishDateRange string 前闭后开,左边的时间戳不能超过30天,右边的时间戳不能超过当天23:59:59。不填默认查询当天数据
sentiment number 情感值 -1:负面 0:中立 1:正面
appCode string 逗号分割,可以多选
sourceRegion string 如:中国 日本
sourceType string 如:境外媒体 新闻网站
pageToken string 翻页值
catLabel1 string 值为多个时逗号分割, 如:财经,娱乐
version string 目前可用版本包括: 0.1
KwPosition string 3 关键词匹配字段 1:标题, 2:正文 3:正文 + 标题 不填为3
catLabel2 string 值为多个时逗号分割,如:足球,能源
createDateRange string 如: 1566304426,1566494426

Response Fields

Property Name Type Example Description
  • -
    data array [...] 数据
    • publishDate number 1574234748 发布时间
    • html string <article>.....</article> content对应的html代码,包含格式标签等
    • id string 302f2a6a3abd705f0e2dd032b4925a51 id
    • viewCount number 8574 观看数
    • +
      catDist2 array [...] 二级分类概率分布列表
      • label string 足球 标签
      • score number 0.825144 结果归一化的得分
    • spamLabel string null 文本审核标签
    • copyDate number 1574237926 数据处理的时间
    • commentCount number 99 评论数
    • +
      sentimentDist object {...} content的情感分布
      • positive number 0.932983 情感分布
      • negative number 0.0670175 情感分布
      • confidence number 0.851072 置信度
    • posterScreenName string 菱镜头 发布者名称
    • url string http://toutiao.com/group/6761286761273360907/ url
    • catLabel1 string 体育 一级分类标签
    • sourceRegion string 中国 数据源地区
    • +
      spamDist array [...] 文本审核分布列表
      • hits array [...] 对应label的例子列表
      • label string 恶意推广 标签
      • score number 0.7982 结果归一化的得分
    • +
      catDist1 array [...] 一级分类概率分布列表
      • label string 体育 标签
      • score number 1 结果归一化的得分
    • createDate number 1574236088 采集时间
    • likeCount number 27 点赞数
    • spamCode number 0 文本审核代码:0=非违禁,1=违禁,2=人工复审
    • appTags array [...] 网站内部标签
    • catLabel2 string 足球 二级分类标签
    • appName string 今日头条 appCode的名称
    • posterId string 5836885863_5836885863 发布者id
    • sourceType string APP 数据源类型
    • content string .... 文章内容
    • title string 足协官方:12月初公布联赛新政细则,降低俱乐部负担规范薪酬体系 标题
    • imageUrls array [...] 图片链接列表
    • topkeyword array [...] 文章内容top关键词
    • appCode string toutiao.com app代码
    • +
      sentimentDistTitle object {...} title的情感分布列表
      • positive number 0.511348 情感分布
      • negative number 0.488652 情感分布
      • confidence number 0.773033 置信度
    • +
      entities array [...] 命名实体
      • catName1 string 机构名 名称
      • word string 中国足协 话题
  • total number 4949865 总和
  • dataType string idata 数据类型
  • hasNext boolean true 是否有下一页
  • pageToken string 20:WzE1NzQyMzQzMTgsMTU3NDIzNjMyOSwidG91d 页面语言
  • retcode string 000000 状态码

Returns The Sample

{
    "data": [
        {
            "publishDate": 1574234748,
            "html": "
.....<\/article>", "id": "302f2a6a3abd705f0e2dd032b4925a51", "viewCount": 8574, "catDist2": [ { "label": "足球", "score": 0.825144 }, { "label": "中超", "score": 0.813496 }, { "label": "中国足球", "score": 0.786104 } ], "spamLabel": null, "copyDate": 1574237926, "commentCount": 99, "sentimentDist": { "positive": 0.932983, "negative": 0.0670175, "confidence": 0.851072 }, "posterScreenName": "菱镜头", "url": "http:\/\/toutiao.com\/group\/6761286761273360907\/", "catLabel1": "体育", "sourceRegion": "中国", "spamDist": [ { "hits": [ ], "label": "恶意推广", "score": 0.7982 }, { "hits": [ ], "label": "文本色情", "score": 0.168 } ], "catDist1": [ { "label": "体育", "score": 1 } ], "createDate": 1574236088, "likeCount": 27, "spamCode": 0, "appTags": [ "8" ], "catLabel2": "足球", "appName": "今日头条", "posterId": "5836885863_5836885863", "sourceType": "APP", "content": "....", "title": "足协官方:12月初公布联赛新政细则,降低俱乐部负担规范薪酬体系", "imageUrls": [ "http:\/\/p9-tt.byteimg.com\/large\/pgc-image\/a6c1489584624ce0b873851bd04a8cd7?from=detail" ], "topkeyword": [ "俱乐部", "足协", "职业", "联赛", "意见" ], "appCode": "toutiao.com", "sentimentDistTitle": { "positive": 0.511348, "negative": 0.488652, "confidence": 0.773033 }, "entities": [ { "catName1": "机构名", "word": "中国足协" }, { "catName1": "机构名", "word": "职业俱乐部青训工作并保护俱乐部" }, { "catName1": "地名", "word": "中国" }, { "catName1": "地名", "word": "北京" } ] } ], "total": 4949865, "dataType": "idata", "hasNext": true, "pageToken": "20:WzE1NzQyMzQzMTgsMTU3NDIzNjMyOSwidG91dGlhby5jb20iLCJlY2QzMWUxNzQzNjgzZmI3MmYzZDFhNDAyNGQ4MWViZSJd", "retcode": "000000" }

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