作者: 浏览量:228 更新时间: 2019.04.22
API的调用格式形如:https://shujuapi.aliyun.com/dataplus_001/prophet/queryTopicsList?param1=ab¶m2=cd
所有的返回结果中,都会附带以下系统级返回参数,用于判断接口调用是否出错及相应的出错信息。
系统级返回字段说明
| 参数名 | 参数类型 | 说明 |
|---|---|---|
| success | boolean | 接口处理是否成功的标识 |
| errorCode | int | 如果出错,表示出错状态码 |
| other | string | 额外提示信息 |
| msgCode | int | 提示信息状态码 |
| msgInfo | string | 提示信息 |
| messages | array[string] | 如果出错,表示出错信息。如果成功,也可能为成功的提示信息 |
| result | json | 该对象封装了业务对象实体。如果success为true时,此对象才有值。 具体参数见各接口中说明 |
API功能:查询一个业务方的所有关键字专题列表,或者根据名称模糊匹配关键字专题列表。
接口名称:queryTopicsList
方法:GET
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| status | int | 否 | 状态。0:未启用 1:启用。 为null,表示查询所有关键字专题列表 |
返回示例
{"success":true,"errorCode":null,"other":null,"msgCode":null,"msgInfo":null,"messages":[],"result":[{"id":6542,"name":"测试","status":0,"createdAt":"2016-04-28T02:01:49.000Z","updatedAt":"2016-04-28T02:12:13.000Z"}]}
返回参数说明
| 参数名 | 参数类型 | 说明 |
|---|---|---|
| id | int | 关键字专题主键ID |
| name | string | 关键字专题名称 |
| status | int | 关键字专题状态。0:未启用 1:启用 |
| createdAt | Date | 创建时间。时间格式为UTC时间 |
| updatedAt | Date | 更新时间。时间格式为UTC时间 |
API功能:用于创建一个新的关键字专题。
接口名称:createTopic
方法:POST
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| name | string | 否 | 关键字专题名称 |
| status | int | 否 | 状态。0:未启用 1:启用 默认值:1 |
返回示例
{"success":true,"errorCode":null,"other":null,"msgCode":null,"msgInfo":null,"messages":[],"result":6543 //成功创建的关键字专题主键id}
API功能:对现有关键字专题的更新操作,可对关键字专题名称、是否开启监控状态这两个属性进行修改。
接口名称:updateTopic
方法:POST
参数:
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| id | int | 是 | 关键字专题主键ID |
| name | string | 是 | 关键字专题名称 |
| status | int | 否 | 状态。0:未启用 1:启用 |
返回示例
{"success":true,"errorCode":null,"other":null,"msgCode":null,"msgInfo":null,"messages":[],"result":6543 //关键字专题主键id}
API功能:逻辑删除一个关键字专题。非物理删除,如果不小心物理删除,请提工单进行修正。
接口名称:deleteTopic
方法:POST
参数:
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| id | int | 是 | 关键字专题主键ID |
返回示例
{"success":true,"errorCode":null,"other":null,"msgCode":null,"msgInfo":null,"messages":[],"result":6543 //成功删除的关键字专题主键id}
API功能:对现有关键字专题开启或者关闭
接口名称:turnTopic
方法:POST
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| id | int | 是 | 关键字专题主键ID |
| status | int | 是 | 状态。0:未启用 1:启用 |
返回示例
{ “success”: true, “errorCode”: null, “other”: null, “msgCode”: null, “msgInfo”: null, “messages”: [ ], “errorMessages”: [ ], “result”: 6909 // 成功开启/关闭的关键字专题主键id }
API功能:该接口用于在添加关键字时,选择关联的源站类型。
请注意:源站类型的ID只用作添加/编辑关键字时使用,不可用于舆情查询接口。关键字创建后,关键字会关联到一个新的站点组ID(spiderTopicId)。此ID才可用于查询舆情时使用
接口名称:getSystemSiteTypes
方法:GET
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| name | string | 否 | 模糊匹配源 |
| langType | string | 否 | 语言类型标识。默认为ch |
| 标识 | 语言 |
|---|---|
| fr | 法语 |
| es | 西班牙语 |
| de | 德语 |
| it | 意大利语 |
| pt | 葡萄牙语 |
| ru | 俄语 |
| jp | 日语 |
| ko | 韩语 |
| ar | 阿拉伯语 |
| nl | 荷兰语 |
| ch | 中文 |
| en | 英语 |
| vi | 越南语 |
| th | 泰语 |
| tr | 土耳其语 |
| he | 希伯来语 |
| id | 印尼语 |
| pl | 波兰语 |
| hi | 印地语 |
返回示例
{"success":true,"errorCode":null,"other":null,"msgCode":null,"msgInfo":null,"messages":[],"result":[{"id":8,"name":"新闻","langType":"ch"},{"id":9,"name":"微博","langType":"ch"},....]}
返回参数说明
| 参数名 | 参数类型 | 说明 |
|---|---|---|
| id | int | 源站类型主键ID |
| name | string | 源站类型名称 |
| langType | string | 源站类型语言 |
API功能:分页查询一个关键字专题下面的所有已经添加的关键字。
接口名称:getKeywords
方法:GET
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| topicId | int | 是 | 关键字专题ID |
| toPage | int | 否 | 用于分页查询。当前页码,默认值为:1 |
| pageSize | int | 否 | 用于分页查询。每页显示条数。默认值为:20。 |
返回示例
{"pageSize":20, // 每页显示多少"toPage":1, // 当前页码"totalCount":1, // 一共多少条"totalPages":1, // 一共多少页"success":true,"errorCode":null,"other":null,"msgCode":null,"msgInfo":null,"messages":[],"result":[{"id":12362, //关键字ID"keyword":"杭州 交通事故", //关键字内容"topicId":6544, //关键字专题ID"createdAt":"2016-04-28T03:09:12.000Z","updatedAt":"2016-04-28T03:09:12.000Z","spiderTopics":[{"id":2252, //站点组ID,用于舆情搜索时,指定的spiderTopicId"name":"新闻" //站点组名称},{"id":2253,"name":"微博"}]}]}
API功能:用于向一个关键字专题添加关键字。一个关键字组合内部可用空格表示“AND”的关系,可一次性添加多个关键字组合。
接口名称:createKeyword
方法:POST
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| topicId | int | 是 | 关键字专题ID |
| keywords | string/array | 是 | 关键字,多个关键字请用json数组封装,如 [“关键字1”,”关键字2”] |
| siteTypeIds | int/array | 是 | 关联的源站类型ID,多个请用json数组封装,如 [8,9] |
返回示例
{"success":true,"errorCode":null"other":null,"msgCode":null,"msgInfo":null,"messages":[],"result":[12363,12364] // 创建成功的关键字ID数组}
API功能:逻辑删除关键字。删除后,系统将在约20分钟内生效;20分钟后,便不会再抓取该词,但是历史抓取记录会被保留。
接口名称:deleteKeyword
方法:POST
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| ids | int/array | 是 | 要删除的关键字ID。如果是多个,请用json数组封装,如 [12363,12364] |
返回示例
{"success":true,"errorCode":null"other":null,"msgCode":null,"msgInfo":null,"messages":[],"result":[12363,12364] // 删除成功的关键字id数组}
API功能:用于修改单个关键字的属性。支持对内容、所属关键字专题、抓取的源站类型3个属性的修改。
接口名称:updateKeyword
方法:POST
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| id | int | 是 | 关键字主键ID |
| keyword | string | 是 | 关键字内容 |
| topicId | int | 否 | 关键字专题ID |
| siteTypeIds | int/array | 是 | 关联的源站类型主键ID,多个请用json数组封装,如 [2232,2233] |
返回示例
{"success":true,"errorCode":null"other":null,"msgCode":null,"msgInfo":null,"messages":[],"result":[12363] // 更新成功的关键字主键ID}
API功能:用于修改多个关键字的属性。支持对所属关键字专题、抓取的源站类型两个属性的修改。
接口名称:updateKeywords
方法:POST
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| ids | int/array | 是 | 关键字主键ID,多个可用json数组封装,如 [12363,12364] |
| topicId | int | 否 | 关键字专题ID |
| siteTypeIds | int/array | 否 | 关联的源站类型主键ID,多个请用json数组封装,如 [2232,2233] |
返回示例
{"success":true,"errorCode":null"other":null,"msgCode":null,"msgInfo":null,"messages":[],"result":[12369,12370] // 更新成功的关键字主键ID列表}
1、搜索舆情数据
API功能:用于对抓取数据的同步搜索。注意:该接口仅在数据抓取到后,才可搜索,而非实时从互联网中抓取,并且目前默认按发布时间排序。
接口名称:search
方法:GET
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| subject | string | 否 | 模糊匹配标题内容 |
| description | string | 否 | 模糊匹配全文(标题+正文) |
| from | string | 否 | 源站名称,如:新浪网、百度贴吧、微博名 |
| spiderTopicId | int | 否 | 站点组ID。请参考:getKeywords中返回的spiderTopics的ID属性 |
| hotEvent | string | 否 | 热门事件名称。请参考:facetSearch中设置facetType=hot_event,返回的name属性 |
| keyword | string | 否 | 关键词名称。请参考:facetSearch中设置facetType=keyword,返回的name属性 |
| site | string | 否 | 媒体名称。请参考:facetSearch中设置facetType=site,返回的name属性 |
| monitorTopicId | int | 否 | 关键字专题。请参考:getKeywords中返回的topicId属性 |
| emotionTendencys | int | 否 | 情感趋势,1 正面,0 中性,-1 负面。 |
| clusterId | int | 否 | 查询相似的舆情数据。一个cluster表示一批相似数据,同一批相似舆情的clusterId为同一个,clusterId为中心点舆情的主键。 |
| createdAtBegin | date | 否 | 抓取开始时间(>=),格式 2016-04-28 13:30:41 |
| createdAtEnd | date | 否 | 抓取结束时间(<=),格式 2016-04-28 13:30:41 |
| pubTimeBegin | date | 否 | 舆情发布时间(>=),格式 2016-04-28 13:30:41 |
| pubTimeEnd | date | 否 | 舆情结束时间(<=),格式 2016-04-28 13:30:41 |
| clusterFlag | int | 否 | 合并相似:0:为合并相似状态,1:非合并状态,默认1 |
| tab | int | 否 | 舆情列表类别:0:为全部舆情,1:有效舆情,2:新舆情 |
| toPage | int | 否 | 用于分页查询。当前页码,不传默认值:1 |
| pageSize | int | 否 | 用于分页查询。每页显示条数。默认值为:20。 |
返回示例
{"pageSize":20,"toPage":20,"totalCount":0,"totalPages":0,"success":true,"errorCode":null,"other":null,"msgCode":null,"msgInfo":null,"messages":[],"result":{"records":[{"id":11175897,"monitorKeywords":"*","monitorKeywordId":12359,"monitorTopicId":0,"subject":"《疯狂动物城》尼克狐的.....","translateSubject":null,"translateDescription":null,"description":"*文章为作者独立观点,不代表虎嗅网立。。。。","clusterId":11175897,"priority":4,"url":"http://www.huxiu.com/article/147005/1.html?f=index_feed_article","createdAt":"2016-04-28T04:53:05.000Z","pubTime":"2016-04-28T04:51:04.000Z","from":"虎嗅网","langType":"ch","filterStatus":1,"wbType":2,"wbFansCount":0,"wbRepostCount":0,"wbCommentCount":0,"wbLikeCount":null,"wbVerifiedType":0,"emotionTendency":-1,"emotionScore":-7}],"facetFields":null,"dateFacetFields":null}}
返回参数说明
| 参数名 | 参数类型 | 说明 |
|---|---|---|
| id | int | 舆情对象主键 |
| productId | int | 先知的产品编号 |
| spiderTopicId | int | 站点组ID:与源站类型是一一对应的。 |
| monitorKeywordId | int | 舆情抓取的关键字ID |
| monitorKeywords | string | 舆情抓取的关键字内容 |
| monitorTopicId | int | 关键字专题ID |
| from | string | 网站名/微博作者/微信公众号 |
| url | string | 舆情链接。对应新闻URL/微博URL/微信公众号文章URL等 |
| filterStatus | int | 0:待确认舆情,1:有效舆情 2:被过滤的舆情(放垃圾箱) |
| createdAt | date | 抓取时间 |
| pubTime | date | 新闻/微博发布的时间(如果只获取到天,时分秒都为0) |
| wbId | int | 微博的主键ID |
| wbUserId | int | 微博用户的主键ID |
| wbFansCount | int | 微博粉丝数。可能在数据量大的情况下此值为空. |
| wbRepostCount | int | 微博转发数。原创微博抓取瞬间几乎都为0,如果为转发微博,建议开发者更新被转发微博的转发次数 |
| wbCommentCount | int | 微博评论数。原创微博抓取瞬间几乎都为0,如果为转发微博,建议开发者更新被转发微博的评论次数 |
| wbLikeCount | int | 微博点赞数。原创微博抓取瞬间几乎都为0,如果为转发微博,建议开发者更新被转发微博的点赞次数 |
| wbVerifiedType | int | 微博用户认证类型 0-普通,1-个人认证,2-企业认证,3-微博达人。可能在数据量大的情况下此值为空。 |
| wbType | int | 微博类型:0为原创微博,1为转发微博,2为微博评论 |
| emotionTendency | int | 情感极性0中性 1正面 -1负面 |
| emotionScore | int | 情感分数,绝对值越大,表示对应的情感越强烈 |
| urlMD5 | string | url的md5哈希值 |
| tags | string | 自动打上的标签,多个会用竖线进行分隔。 |
| langType | string | 语言类型。如ch表示中文,en表示英文 |
| subject | string | 文章标题。如果是微博,则为微博内容的摘要。 |
| description | string | 正文摘要(100字以内)。如果是微博,则为微博内容的前100个字符 |
| translateSubject | string | 如果是非中文和英文,翻译成英文之后的标题 |
| translateDescription | string | 如果是非中文和英文,翻译成英文之后的详情 |
| clusterId | int | 相似舆情的中心结点主键,在search接口传入此参数可查询与该条舆情相似的其他舆情数据 |
| priority | int | 优先级,1到4表示P1到P4 |
| similarCount | int | 相似数 |
API功能:此接口将舆情标记为有效舆情,用于将用户操作的数据进行回流,以方便系统进行智能过滤。
接口名称:setIsValid
方法:POST
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| id | Long | 是 | 舆情主键ID |
| flag | int | 是 | 有效状态。1:有效,0:无效(舆情在抓取时,默认就是无效,标记为0只用作取消错误标记为有效的舆情) |
返回示例
{"success":true,"errorCode":null"other":null,"msgCode":null,"msgInfo":null,"messages":[],"result":[11179498] // 更新成功的舆情主键ID}
API功能:用于展示热点事件、关键字、媒体、关键字专题。注意:该接口拥有search接口的搜索过滤功能,可以通过填写搜索条件达到效果。
接口名称:facetSearch
方法:GET
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| subject | string | 否 | 模糊匹配标题内容 |
| description | string | 否 | 模糊匹配全文(标题+正文) |
| from | string | 否 | 源站名称,如:新浪网、百度贴吧、微博名 |
| spiderTopicId | int | 否 | 站点组ID。请参考:getKeywords中返回的spiderTopics的ID属性 |
| hotEvent | string | 否 | 热门事件名称。请参考:facetSearch中设置facetType=hot_event,返回的name属性 |
| keyword | string | 否 | 关键词名称。请参考:facetSearch中设置facetType=keyword,返回的name属性 |
| site | string | 否 | 媒体名称。请参考:facetSearch中设置facetType=site,返回的name属性 |
| monitorTopicId | int | 否 | 关键字专题ID。请参考:getKeywords中返回的topicId属性 |
| emotionTendencys | int | 否 | 情感趋势,1 正面,0 中性,-1 负面。 |
| clusterId | int | 否 | 查询相似的舆情数据。一个cluster表示一批相似数据,同一批相似舆情的clusterId为同一个,clusterId为中心点舆情的主键。 |
| createdAtBegin | date | 否 | 抓取开始时间(>=),格式 2016-04-28 13:30:41 |
| createdAtEnd | date | 否 | 抓取结束时间(<=),格式 2016-04-28 13:30:41 |
| pubTimeBegin | date | 否 | 舆情发布时间(>=),格式 2016-04-28 13:30:41 |
| pubTimeEnd | date | 否 | 舆情结束时间(<=),格式 2016-04-28 13:30:41 |
| clusterFlag | int | 否 | 合并相似:0:为合并相似状态,1:非合并状态,默认1 |
| tab | int | 否 | 舆情列表类别:0:为全部舆情,1:有效舆情,2:新舆情 |
| facetType | string | 是 | 分组展示类型:hot_event:热门事件,keyword:关键字,site:媒体,monitor_topic:关键字专题 |
| toPage | int | 否 | 用于分页查询。当前页码,不传默认值:1 |
| pageSize | int | 否 | 用于分页查询。每页显示条数。默认值为:20。 |
返回示例
{"success": true,"data": [{"name": "微信", //注意,facetType=monitor_topic,返回的name为关键字专题ID"count": 453},{"name": "和讯网","count": 95}]}
返回参数说明
| 参数名 | 参数类型 | 说明 |
|---|---|---|
| success | boolean | 本次请求是否有效:true有效,false失败 |
| name | string | 名称,如分组展示类型hot_event:热门事件名称,keyword:关键字名称,site:站点名称,monitor_topic:关键字专题名ID |
| count | int | 舆情数量,如分组展示类型hot_event:热门事件下舆情数量,keyword:关键字下舆情数量,site:站点下舆情数量,monitor_topic:关键字专题下舆情数量 |
API功能:此接口可以变更舆情情感,用于人工校验情感。
接口名称:setEmotion
方法:POST
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| id | Long | 是 | 舆情主键ID |
| emotionTendency | int | 是 | 情感趋势。1:正面,0:中性,-1:负面 |
返回示例
{"success": true,"errorCode": null,"other": null,"msgCode": null,"msgInfo": null,"messages": [],"errorMessages": [],"result": 13420071 // 更新成功的舆情主键ID
}
API功能:此接口将修改舆情的风险等级。
接口名称:setRisk
方法:POST
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| id | Long | 是 | 舆情主键ID |
| riskType | int | 是 | 风险等级。1:P1等级,2:P2等级,3:P3等级,4:P4等级 |
返回示例
{"success": true,"errorCode": null,"other": null,"msgCode": null,"msgInfo": null,"messages": [],"errorMessages": [],"result": 13420071 // 更新成功的舆情主键ID
}
API功能:此接口用于过滤指定舆情数据,放入回收站。
接口名称:setDustbin
方法:POST
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| id | Long | 是 | 舆情主键ID |
返回示例
{"success": true,"errorCode": null,"other": null,"msgCode": null,"msgInfo": null,"messages": [],"errorMessages": [],"result": 13420071 // 更新成功的舆情主键ID
}
API功能:用于查询舆情详情数据
接口名称:getDetail
方法:GET
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| id | Long | 是 | 舆情Id |
返回示例
{"success": true,"errorCode": null,"other": null,"msgCode": null,"msgInfo": null,"messages": [],"errorMessages": [],"messageContext": {},"result": {"id": 13679723,"productId": 13966,"spiderTopicId": 1340,"monitorKeywords": "11"
工作时间5-10分钟将由1对1顾问为您提供尊享服务