API指南__开发者指南_公众趋势分析-阿里云
一、通用说明
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时,此对象才有值。 具体参数见各接口中说明 |
二、关键字专题接口
1、查询关键字专题
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时间 |
2、创建关键字专题
API功能:用于创建一个新的关键字专题。
接口名称:createTopic
方法:POST
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| name | string | 否 | 关键字专题名称 |
| status | int | 否 | 状态。0:未启用 1:启用 默认值:1 |
返回示例
{"success":true,"errorCode":null,"other":null,"msgCode":null,"msgInfo":null,"messages":[],"result":6543 //成功创建的关键字专题主键id}
3、更新关键字专题
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}
4、删除关键字专题
API功能:逻辑删除一个关键字专题。非物理删除,如果不小心物理删除,请提工单进行修正。
接口名称:deleteTopic
方法:POST
参数:
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| id | int | 是 | 关键字专题主键ID |
返回示例
{"success":true,"errorCode":null,"other":null,"msgCode":null,"msgInfo":null,"messages":[],"result":6543 //成功删除的关键字专题主键id}
5、开启/关闭关键字专题
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 }
三、源站类型
1、查询源站类型列表
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 | 源站类型语言 |
四、关键字接口
1、查询关键字
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":"微博"}]}]}
2、添加关键字
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数组}
3、删除关键字
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数组}
4、编辑关键字(单个)
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}
5、编辑关键字(批量)
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 |
| 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":"https://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 | 相似数 |
2、将某舆情标示为有效
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}
3、热点事件、关键字、媒体、关键字专题展示
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 |
| 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:关键字专题下舆情数量 |
4、变更某舆情情感
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}
5、修改某舆情的风险等级
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}
6、将某舆情放入回收站
API功能:此接口用于过滤指定舆情数据,放入回收站。
接口名称:setDustbin
方法:POST
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| id | Long | 是 | 舆情主键ID |
返回示例
{ “success”: true, “errorCode”: null, “other”: null, “msgCode”: null, “msgInfo”: null, “messages”: [], “errorMessages”: [], “result”: 13420071 // 更新成功的舆情主键ID}
7、查询舆情详情数据
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","monitorKeywordId": 103028,"from": "和讯网_科技要闻","url": "https://tech.hexun.com/2016-12-13/187322772.html","filterStatus": 0,"createdAt": "2016-12-13T08:29:41.517Z","pubTime": "2016-12-13T08:15:00.000Z","wbId": null,"wbUserId": null,"wbFansCount": 0,"wbRepostCount": 0,"wbCommentCount": 0,"wbLikeCount": 0,"wbVerifiedType": 0,"wbType": 2,"emotionTendency": 1,"emotionScore": 30,"urlMD5": "f2eba50c3c881f3909ee22deaef9a5de","tags": [],"langType": "ch","subject": "民生银行:史玉柱持股比例增至4.97%","description": " 证券时报网(www.stcn.com)12月13日讯 据澎湃新闻报道,根据港交所公布的权益披露,史玉柱持有的民生银行(600016,股吧)H股股份数在12月2日由7043.54万股增至6.65亿股,占民生银行H股股份比例也由1.02%升至9.59%。与此同时,晶辉国际投资有限公司持有的民生银行H股在同一天减少594584711股,与史玉柱增持的数量如出一辙。史玉柱手中的民生银行股份达到了18.15亿股,持股比例达到4.97%。`n` (证券时报e公司)`n` (责任编辑: HN666)`n` 看全文`n` 和讯网今天刊登了《`n` 民生银行:史玉柱持股比例增...","translateSubject": null,"translateDescription": null,"clusterId": 13679723,"priority": 4,"source": "News","attachments": [{"filename": "0000.jpg","url": "0000.jpg"}]}}
返回参数说明
| 参数名 | 参数类型 | 说明 |
|---|---|---|
| id | int | 舆情对象主键 |
| productId | int | 先知的产品编号 |
| spiderTopicId | int | 站点组ID:与源站类型是一一对应的。 |
| monitorKeywordId | int | 舆情抓取的关键字ID |
| monitorKeywords | string | 舆情抓取的关键字内容 |
| 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 | 正文摘要(300字以内)。如果是微博,则为微博内容的前300个字符,正文中的“[[+_+]]”是图片占位符,配合attachments使用 |
| translateSubject | string | 如果是非中文和英文,翻译成英文之后的标题 |
| translateDescription | string | 如果是非中文和英文,翻译成英文之后的详情 |
| clusterId | int | 相似舆情的中心结点主键,在search接口传入此参数可查询与该条舆情相似的其他舆情数据 |
| priority | int | 优先级,1到4表示P1到P4 |
| attachments | string | 图片信息,string是一个list,其中filename是图片标识,标识中的数字是图片从上至下的顺序,比如0000代表第一张图片,url是图片的地址。 |
六、微博相关接口
1、创建微博分析任务
API功能:该接口可用于分析5条转发以上的微博。调用该接口后,会产生一个分析任务,通过轮询查询微博分析结果接口,可获取分析结果的完成情况。
接口名称:weiboAnalysis
方法:POST
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| url | string | 是 | 单条微博的url地址。可点击微博的发布时间查看单条微博URL |
返回示例
{"success":true,"errorCode":null"other":null,"msgCode":null,"msgInfo":null,"messages":[],"result":552 // 生成的微博分析任务主键ID。可用此ID查询分析结果}
2、查询微博分析结果
API功能:获取微博分析的结果。由于分析需要一定的时间,通常为30次转发/秒,前端可根据此时间进行时间预估。当取得分析结果接口中的data不为null时,表示分析已经完成。
接口名称:getWeiboAnalysisResult
方法:GET
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| id | int | 是 | 微博分析任务主键ID |
返回示例
分析中(data为null)
{ success: true,result:{ id: 559,weiboUrl: 'https://weibo.com/1622004114/DsAI319Ai?from=page_1006061622004114_profile&wvr=6&mod=weibotime&type=comment',uid: null,screenName: null,content: '#QCon北京2016# 运维专场开场《海量容器系统运维实践》的讲稿实录,从多Region异地多活,统一接入和安全,Overlay网络虚拟化,以及应用模型和弹性计算几个方面来说如何做高质量架构产品化输出@QCon全球软件开发大会 @InfoQ @开发者头条 @阿里云 @阿里技术嘉年华 https://t.cn/Rq0du7c',uInfo: null,wInfo:{ annotations: '',attitudesCount: 3,bmiddlePic: '',commentsCount: 12,createdAt: 1461562476000,favorited: false,geo: 'null',id: '3968142990275174',idstr: 3968142990275174,inReplyToScreenName: '',inReplyToStatusId: -1,inReplyToUserId: -1,latitude: -1,longitude: -1,mid: '3968142990275174',mlevel: 0,originalPic: '',picIds: [],picUrls: [],repostsCount: 35,source: [Object],text: '#QCon北京2016# 运维专场开场《海量容器系统运维实践》的讲稿实录,从多Region异地多活,统一接入和安全,Overlay网络虚拟化,以及应用模型和弹性计算几个方面来说如何做高质量架构产品化输出@QCon全球软件开发大会 @InfoQ @开发者头条 @阿里云 @阿里技术嘉年华 https://t.cn/Rq0du7c',thumbnailPic: '',truncated: false,user: [Object],visible: [Object] },totalFollows: null,simpleReport: null,detailReport: null,data: null,graphData: null,pubTime: Mon Apr 25 2016 13:34:36 GMT+0800 (CST),createdAt: Thu Apr 28 2016 17:32:29 GMT+0800 (CST),updatedAt: Thu Apr 28 2016 17:32:29 GMT+0800 (CST) } }
分析后(data不为null)
{ success: true,result:{ id: 559,weiboUrl: 'https://weibo.com/1622004114/DsAI319Ai?from=page_1006061622004114_profile&wvr=6&mod=weibotime&type=comment',uid: '1622004114',screenName: '淘宝开放平台',content: '#QCon北京2016# 运维专场开场《海量容器系统运维实践》的讲稿实录,从多Region异地多活,统一接入和安全,Overlay网络虚拟化,以及应用模型和弹性计算几个方面来说如何做高质量架构产品化输出@QCon全球软件开发大会 @InfoQ @开发者头条 @阿里云 @阿里技术嘉年华 https://t.cn/Rq0du7c',uInfo:{ allowAllActMsg: true,allowAllComment: false,avatarLarge: 'https://tp3.sinaimg.cn/1622004114/180/1284433074/1',biFollowersCount: 192,city: 1,createdAt: 1258688488000,description: '淘宝开放平台是将阿里巴巴内部的商业和能力开放出来,赋能整个商业生态。 进化新商业,开放新思维。 平台动态请关注:https://open.taobao.com 更多官方变更请关注官方公:https://open.taobao.com/support/announcement_list.htm',favouritesCount: 1,followMe: false,followersCount: 38483,following: true,friendsCount: 247,gender: 'm',id: '1622004114',lang: 'zh-cn',location: '浙江 杭州',name: '淘宝开放平台',onlineStatus: 0,profileImageURL: 'https://tp3.sinaimg.cn/1622004114/50/1284433074/1',profileImageUrl: 'https://tp3.sinaimg.cn/1622004114/50/1284433074/1',province: 33,screenName: '淘宝开放平台',statusId: '',statusesCount: 1764,uRL: 'https://open.taobao.com',url: 'https://open.taobao.com',userDomain: 'opentaobao',verified: true,verifiedReason: '淘宝开放平台部门官方微博',verifiedType: 2,verified_reason: '淘宝开放平台部门官方微博',weihao: '' },wInfo:{ annotations: '',attitudesCount: 3,bmiddlePic: '',commentsCount: 12,createdAt: 1461562476000,favorited: false,geo: 'null',id: '3968142990275174',idstr: 3968142990275174,inReplyToScreenName: '',inReplyToStatusId: -1,inReplyToUserId: -1,latitude: -1,longitude: -1,mid: '3968142990275174',mlevel: 0,originalPic: '',picIds: [],picUrls: [],repostsCount: 35,source: [Object],text: '#QCon北京2016# 运维专场开场《海量容器系统运维实践》的讲稿实录,从多Region异地多活,统一接入和安全,Overlay网络虚拟化,以及应用模型和弹性计算几个方面来说如何做高质量架构产品化输出@QCon全球软件开发大会 @InfoQ @开发者头条 @阿里云 @阿里技术嘉年华 https://t.cn/Rq0du7c',thumbnailPic: '',truncated: false,user: [Object],visible: [Object] },totalFollows: 38483,simpleReport: '消息曝光量<span title="曝光量表示所有转发用户的总粉丝数">404536</span>,共计转发<b>35</b>次,其中一转<b>17</b>次,二转<b>16</b>次,三转<b>1</b>次,北京、浙江、上海地区参与转发人数较多。用户情绪指数为<b>99</b>,传递了超强的正能量。没有发现任何疑似水军。',detailReport: null,data:{ areaMap: [ // 微博转发地域分析{ key: '北京', value: 15 },{ key: '浙江', value: 8 },{ key: '上海', value: 3 },{ key: '江苏', value: 3 },{ key: '山东', value: 2 },{ key: '广东', value: 2 },{ key: '其他', value: 1 },{ key: '海外', value: 1 } ],emotion: 99, // 情感值levelList: [ 17, 16, 1, 0 ], // 转发层级分析sexMap: { '女': 1, '男': 34 }, // 性别比例timeList: [Object], //转发时间曲线数据top100User: [ // 关键传播账号{ followersCount: 414,friendsCount: 354,gender: 'm',postTime: 1461581414000,repostCount: 6,screenName: 'wisdomyu',statusMid: '3968222422190527',userId: '1428493165',verifiedType: '普通用户' },{ followersCount: 25352,friendsCount: 669,gender: 'm',postTime: 1461563724000,repostCount: 5,screenName: '阿里技术嘉年华',statusMid: '3968148225362229',userId: '1939498534',verifiedType: '企业认证(企业)' },{ followersCount: 16613,friendsCount: 231,gender: 'm',postTime: 1461564477000,repostCount: 4,screenName: '阿里技术保障',statusMid: '3968151388144939',userId: '3851645388',verifiedType: '企业认证(企业)' },{ followersCount: 957,friendsCount: 874,gender: 'm',postTime: 1461597070000,repostCount: 1,screenName: '臧秀涛',statusMid: '3968288091950552',userId: '2710829805',verifiedType: '个人认证(名人)' },{ followersCount: 23384,friendsCount: 118,gender: 'm',postTime: 1461566131000,repostCount: 1,screenName: '阿里数据',statusMid: '3968158325129144',userId: '2414452832',verifiedType: '企业认证(企业)' },{ followersCount: 8531,friendsCount: 217,gender: 'm',postTime: 1461651555000,repostCount: 1,screenName: 'Docker精选',statusMid: '3968516614579106',userId: '5360910133',verifiedType: '普通用户' } ],totalFollows: 404536,userTypeMap: { '个人认证': 3, '企业认证': 9, '微博达人': 4, '普通用户': 19 }, // 用户类型waterArmyMap: { false: 35, true: 0 } // 水军分析},graphData: ....., //路径传播图 xml数据pubTime: Mon Apr 25 2016 13:34:36 GMT+0800 (CST),createdAt: Thu Apr 28 2016 17:32:29 GMT+0800 (CST),updatedAt: Thu Apr 28 2016 17:32:32 GMT+0800 (CST) } }
传播链接的展示推荐使用gephi组件。
3、分析一个微博账号的水军概率
API功能:通过公众趋势分析独创的水军分析算法,判断一个微博账号的水军概率。返回结果为0到1之间的一个浮点数,数值越接近1,越有可能是水军。
接口名称:getWaterArmyAnalysisResult
方法:GET
入参说明
| 参数名 | 参数类型 | 是否必填 | 说明 |
|---|---|---|---|
| id | int | 是 | 微博用户ID。在微博URL中可得到 |
返回示例
{"success": true,"result": 0.01,"messages": []}
七、首页报表接口
1、源站类型分析
API功能:查询某个时间点的不同源站下的舆情数量
接口名称:queryReportNumber
方法: GET
入参说明
| 参数名 | 参数类型 | 说明 | 是否必填 |
|---|---|---|---|
| keyWordTopicId | int | 专题ID,不传则获取全部专题的源站类型 | 否 |
| time | int | 时间,如20160121 | 是 |
| timeType | int | 过滤的时间类型,0为当天,1为近七天,2为近30天。不传则默认为0 | 否 |
返回示例
{"success": true,"messages": [ ],"result": [{"logDate": 20161012,"sourceName": "新闻","value": 871}]}
返回参数说明
| 参数名 | 参数类型 | 说明 |
|---|---|---|
| logDate | Date | 登录时间。时间格式为UTC时间 |
| sourceName | string | 源站的中文名 |
| value | int | 舆情的数量(timeType为0表示当天数据,1为近七天,2为近30天) |
2、情感分析
API功能:查询某个专题下某个时间点的情感分值
接口名称:queryReportEmotion
方法: GET
入参说明
| 参数名 | 参数类型 | 说明 | 是否为空 |
|---|---|---|---|
| keyWordTopicId | int | 专题ID,不传则表示查询总体的情感值 | 否 |
| time | int | 时间,如20160121 | 是 |
| timeType | int | 过滤的时间类型,0为当天,1为近七天,2为近30天,不传则默认为0 | 否 |
返回示例
{"success": true,"result": {"logDate": 20160922,"value": 14},"messages": []}
返回参数说明
| 参数名 | 参数类型 | 说明 |
|---|---|---|
| logDate | Date | 采集时间点。时间格式为UTC时间 |
| value | int | 情感分值(timeType为0表示当天数据,1为近七天,2为近30天) |
3、热词云
API功能:查询热词云
接口名称:queryReportHotWord
方法: GET
入参说明
| 参数名 | 参数类型 | 说明 | 是否必填 |
|---|---|---|---|
| keyWordTopicId | int | 专题ID,不传则表示查询全部专题下的热词云 | 否 |
| time | int | 时间,如20160121 | 是 |
| timeType | int | 过滤的时间类型,0为当天,1为近七天,2为近30天,不传则默认为0 | 否 |
返回示例
{"success": true,"result": {"logDate": 20160922,"listData": [{"name": "破土","count": 187}],"messages": []}
返回参数说明
| 参数名 | 参数类型 | 说明 |
|---|---|---|
| logDate | Date | 计算时间点。时间格式为UTC时间 |
| listData | list | 各关键字对应的详情 |
| listData.name | string | 热词名称 |
| listData.count | int | 热词的舆情统计数量 |
4、热门事件
API功能:查询时间点下热门事件及舆情数量
接口名称:queryReportHotEvent
方法: GET
入参说明
| 参数名 | 参数类型 | 说明 | 是否必填 |
|---|---|---|---|
| keyWordTopicId | int | 专题ID,不传表示查询全部专题下的热门事件 | 否 |
| time | int | 时间,如20160121 | 是 |
| timeType | int | 过滤的时间类型,0为当天,1为近七天,2为近30天,不传则默认为0 | 否 |
返回示例
{"success": true,"result": {"logDate": 20160922,"listData": [{"name": "【实时路况】#出行提示#8:30分,虹桥枢纽周边道路情况(绿色为畅通,...","count": 44}]},"messages": []}
返回参数说明
| 参数名 | 参数类型 | 说明 |
|---|---|---|
| logDate | Date | 采集时间。时间格式为UTC时间 |
| listData | list | 各热门时间对应的详情 |
| listData.name | string | 热门事件名称 |
| listData.count | int | 热门事件的舆情统计数量 |
5、专题分析
API功能:分析每个专题下的舆情数量
接口名称:queryReportTopic
方法: GET
入参说明
| 参数名 | 参数类型 | 说明 | 是否为空 |
|---|---|---|---|
| keyWordTopicId | int | 专题ID,不传表示查询所有专题的舆情数量 | 否 |
| time | int | 时间,如20160121 | 是 |
| timeType | int | 过滤的时间类型,0为当天,1为近七天,2为近30天,不传则默认为0 | 否 |
返回示例
{"success": true,"result": {"logDate": 20160922,"value": 1309},"messages": []}
返回参数说明
| 参数名 | 参数类型 | 说明 |
|---|---|---|
| logDate | Date | 采集时间。时间格式为UTC时间 |
| value | int | 该专题下的舆情数量(timeType为0表示当天数据,1为近七天,2为近30天) |
6、关键字分析
API功能:某个专题下不同关键字的舆情数量
接口名称:queryReportKeyWord
方法: GET
入参说明
| 参数名 | 参数类型 | 说明 | 是否必填 |
|---|---|---|---|
| keyWordTopicId | int | 专题ID,不传表示查询所有专题下的关键字舆情数量 | 否 |
| time | int | 时间,如20160121 | 是 |
| timeType | int | 过滤的时间类型,0为当天,1为近七天,2为近30天,不传则默认为0 | 否 |
返回示例
{"success": true,"result": {"logDate": 20160922,"listData": [{"name": "【实时路况】#出行提示#8:30分,虹桥枢纽周边道路情况(绿色为畅通,...","count": 44},{"name": "10月16日#2016南京马拉松# 比赛期间,江东中路等部分道路分段实...","count": 26}]},"messages": []}
返回参数说明
| 参数名 | 参数类型 | 说明 |
|---|---|---|
| logDate | Date | 采集时间。时间格式为UTC时间 |
| listData | list | 各关键字对应的详情 |
| listData.name | string | 关键字名称 |
| listData.count | int | 关键字的舆情统计数量 |
最后更新:2016-12-16 18:31:31 上一篇:
开发者指南___公众趋势分析-阿里云
下一篇:
服务SLA__公众趋势分析-阿里云
相关内容
删除账号__账号管理_API 参考_云数据库 RDS 版-阿里云
减少同步对象__实时同步_用户指南_数据传输-阿里云
带宽峰值配置限定__带宽峰值常见问题_常见问题_负载均衡-阿里云
打开空的SQL窗口__使用SQL窗口_SQL操作_用户指南(RDBMS)_数据管理-阿里云
状态码说明__站点监控_用户指南_云监控-阿里云
set语句__数据库管理语言_SQL语法参考_云数据库 OceanBase-阿里云
变更RDS实例规格__实例管理_API 参考_云数据库 RDS 版-阿里云
ODPS代码编辑器__数据开发手册_用户操作指南_大数据开发套件-阿里云
设置跨区域复制__管理存储空间_控制台用户指南_对象存储 OSS-阿里云
错误代码__产品使用问题_云服务总线 CSB-阿里云
热门内容
常见错误说明__附录_大数据计算服务-阿里云
发送短信接口__API使用手册_短信服务-阿里云
接口文档__Android_安全组件教程_移动安全-阿里云
运营商错误码(联通)__常见问题_短信服务-阿里云
设置短信模板__使用手册_短信服务-阿里云
OSS 权限问题及排查__常见错误及排除_最佳实践_对象存储 OSS-阿里云
消息通知__操作指南_批量计算-阿里云
设备端快速接入(MQTT)__快速开始_阿里云物联网套件-阿里云
查询API调用流量数据__API管理相关接口_API_API 网关-阿里云
使用STS访问__JavaScript-SDK_SDK 参考_对象存储 OSS-阿里云
删除账号__账号管理_API 参考_云数据库 RDS 版-阿里云
减少同步对象__实时同步_用户指南_数据传输-阿里云
带宽峰值配置限定__带宽峰值常见问题_常见问题_负载均衡-阿里云
打开空的SQL窗口__使用SQL窗口_SQL操作_用户指南(RDBMS)_数据管理-阿里云
状态码说明__站点监控_用户指南_云监控-阿里云
set语句__数据库管理语言_SQL语法参考_云数据库 OceanBase-阿里云
变更RDS实例规格__实例管理_API 参考_云数据库 RDS 版-阿里云
ODPS代码编辑器__数据开发手册_用户操作指南_大数据开发套件-阿里云
设置跨区域复制__管理存储空间_控制台用户指南_对象存储 OSS-阿里云
错误代码__产品使用问题_云服务总线 CSB-阿里云
相关内容
常见错误说明__附录_大数据计算服务-阿里云
发送短信接口__API使用手册_短信服务-阿里云
接口文档__Android_安全组件教程_移动安全-阿里云
运营商错误码(联通)__常见问题_短信服务-阿里云
设置短信模板__使用手册_短信服务-阿里云
OSS 权限问题及排查__常见错误及排除_最佳实践_对象存储 OSS-阿里云
消息通知__操作指南_批量计算-阿里云
设备端快速接入(MQTT)__快速开始_阿里云物联网套件-阿里云
查询API调用流量数据__API管理相关接口_API_API 网关-阿里云
使用STS访问__JavaScript-SDK_SDK 参考_对象存储 OSS-阿里云