阅读611 返回首页    go 技术社区[云栖]


API指南__开发者指南_公众趋势分析-阿里云

一、通用说明

API的调用格式形如:https://shujuapi.aliyun.com/dataplus_001/prophet/queryTopicsList?param1=ab&param2=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,表示查询所有关键字专题列表

返回示例

  1. {
  2. "success":true,
  3. "errorCode":null,
  4. "other":null,
  5. "msgCode":null,
  6. "msgInfo":null,
  7. "messages":[],
  8. "result":[{
  9. "id":6542,
  10. "name":"测试",
  11. "status":0,
  12. "createdAt":"2016-04-28T02:01:49.000Z",
  13. "updatedAt":"2016-04-28T02:12:13.000Z"
  14. }]
  15. }

返回参数说明

参数名 参数类型 说明
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

返回示例

  1. {
  2. "success":true,
  3. "errorCode":null,
  4. "other":null,
  5. "msgCode":null,
  6. "msgInfo":null,
  7. "messages":[],
  8. "result":6543 //成功创建的关键字专题主键id
  9. }

3、更新关键字专题

API功能:对现有关键字专题的更新操作,可对关键字专题名称、是否开启监控状态这两个属性进行修改。

接口名称:updateTopic

方法:POST

参数:

入参说明

参数名 参数类型 是否必填 说明
id int 关键字专题主键ID
name string 关键字专题名称
status int 状态。0:未启用 1:启用

返回示例

  1. {
  2. "success":true,
  3. "errorCode":null,
  4. "other":null,
  5. "msgCode":null,
  6. "msgInfo":null,
  7. "messages":[],
  8. "result":6543 //关键字专题主键id
  9. }

4、删除关键字专题

API功能:逻辑删除一个关键字专题。非物理删除,如果不小心物理删除,请提工单进行修正。

接口名称:deleteTopic

方法:POST

参数:

入参说明

参数名 参数类型 是否必填 说明
id int 关键字专题主键ID

返回示例

  1. {
  2. "success":true,
  3. "errorCode":null,
  4. "other":null,
  5. "msgCode":null,
  6. "msgInfo":null,
  7. "messages":[],
  8. "result":6543 //成功删除的关键字专题主键id
  9. }

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 印地语

返回示例

  1. {
  2. "success":true,
  3. "errorCode":null,
  4. "other":null,
  5. "msgCode":null,
  6. "msgInfo":null,
  7. "messages":[],
  8. "result":[
  9. {"id":8,"name":"新闻","langType":"ch"},
  10. {"id":9,"name":"微博","langType":"ch"},
  11. ....
  12. ]
  13. }

返回参数说明

参数名 参数类型 说明
id int 源站类型主键ID
name string 源站类型名称
langType string 源站类型语言

四、关键字接口

1、查询关键字

API功能:分页查询一个关键字专题下面的所有已经添加的关键字。

接口名称:getKeywords

方法:GET

入参说明

参数名 参数类型 是否必填 说明
topicId int 关键字专题ID
toPage int 用于分页查询。当前页码,默认值为:1
pageSize int 用于分页查询。每页显示条数。默认值为:20。

返回示例

  1. {
  2. "pageSize":20, // 每页显示多少
  3. "toPage":1, // 当前页码
  4. "totalCount":1, // 一共多少条
  5. "totalPages":1, // 一共多少页
  6. "success":true,
  7. "errorCode":null,
  8. "other":null,
  9. "msgCode":null,
  10. "msgInfo":null,
  11. "messages":[],
  12. "result":[{
  13. "id":12362, //关键字ID
  14. "keyword":"杭州 交通事故", //关键字内容
  15. "topicId":6544, //关键字专题ID
  16. "createdAt":"2016-04-28T03:09:12.000Z",
  17. "updatedAt":"2016-04-28T03:09:12.000Z",
  18. "spiderTopics":[{
  19. "id":2252, //站点组ID,用于舆情搜索时,指定的spiderTopicId
  20. "name":"新闻" //站点组名称
  21. },{
  22. "id":2253,
  23. "name":"微博"
  24. }]
  25. }]
  26. }

2、添加关键字

API功能:用于向一个关键字专题添加关键字。一个关键字组合内部可用空格表示“AND”的关系,可一次性添加多个关键字组合。

接口名称:createKeyword

方法:POST

入参说明

参数名 参数类型 是否必填 说明
topicId int 关键字专题ID
keywords string/array 关键字,多个关键字请用json数组封装,如 [“关键字1”,”关键字2”]
siteTypeIds int/array 关联的源站类型ID,多个请用json数组封装,如 [8,9]

返回示例

  1. {
  2. "success":true,
  3. "errorCode":null
  4. "other":null,
  5. "msgCode":null,
  6. "msgInfo":null,
  7. "messages":[],
  8. "result":[12363,12364] // 创建成功的关键字ID数组
  9. }

3、删除关键字

API功能:逻辑删除关键字。删除后,系统将在约20分钟内生效;20分钟后,便不会再抓取该词,但是历史抓取记录会被保留。

接口名称:deleteKeyword

方法:POST

入参说明

参数名 参数类型 是否必填 说明
ids int/array 要删除的关键字ID。如果是多个,请用json数组封装,如 [12363,12364]

返回示例

  1. {
  2. "success":true,
  3. "errorCode":null
  4. "other":null,
  5. "msgCode":null,
  6. "msgInfo":null,
  7. "messages":[],
  8. "result":[12363,12364] // 删除成功的关键字id数组
  9. }

4、编辑关键字(单个)

API功能:用于修改单个关键字的属性。支持对内容、所属关键字专题、抓取的源站类型3个属性的修改。

接口名称:updateKeyword

方法:POST

入参说明

参数名 参数类型 是否必填 说明
id int 关键字主键ID
keyword string 关键字内容
topicId int 关键字专题ID
siteTypeIds int/array 关联的源站类型主键ID,多个请用json数组封装,如 [2232,2233]

返回示例

  1. {
  2. "success":true,
  3. "errorCode":null
  4. "other":null,
  5. "msgCode":null,
  6. "msgInfo":null,
  7. "messages":[],
  8. "result":[12363] // 更新成功的关键字主键ID
  9. }

5、编辑关键字(批量)

API功能:用于修改多个关键字的属性。支持对所属关键字专题、抓取的源站类型两个属性的修改。

接口名称:updateKeywords

方法:POST

入参说明

参数名 参数类型 是否必填 说明
ids int/array 关键字主键ID,多个可用json数组封装,如 [12363,12364]
topicId int 关键字专题ID
siteTypeIds int/array 关联的源站类型主键ID,多个请用json数组封装,如 [2232,2233]

返回示例

  1. {
  2. "success":true,
  3. "errorCode":null
  4. "other":null,
  5. "msgCode":null,
  6. "msgInfo":null,
  7. "messages":[],
  8. "result":[12369,12370] // 更新成功的关键字主键ID列表
  9. }

五、舆情数据

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。

返回示例

  1. {
  2. "pageSize":20,
  3. "toPage":20,
  4. "totalCount":0,
  5. "totalPages":0,
  6. "success":true,
  7. "errorCode":null,
  8. "other":null,
  9. "msgCode":null,
  10. "msgInfo":null,
  11. "messages":[],
  12. "result":{
  13. "records":[{
  14. "id":11175897,
  15. "monitorKeywords":"*",
  16. "monitorKeywordId":12359,
  17. "monitorTopicId":0,
  18. "subject":"《疯狂动物城》尼克狐的.....",
  19. "translateSubject":null,
  20. "translateDescription":null,
  21. "description":"*文章为作者独立观点,不代表虎嗅网立。。。。",
  22. "clusterId":11175897,
  23. "priority":4,
  24. "url":"https://www.huxiu.com/article/147005/1.html?f=index_feed_article",
  25. "createdAt":"2016-04-28T04:53:05.000Z",
  26. "pubTime":"2016-04-28T04:51:04.000Z",
  27. "from":"虎嗅网",
  28. "langType":"ch",
  29. "filterStatus":1,
  30. "wbType":2,
  31. "wbFansCount":0,
  32. "wbRepostCount":0,
  33. "wbCommentCount":0,
  34. "wbLikeCount":null,
  35. "wbVerifiedType":0,
  36. "emotionTendency":-1,
  37. "emotionScore":-7
  38. }],
  39. "facetFields":null,
  40. "dateFacetFields":null
  41. }
  42. }

返回参数说明

参数名 参数类型 说明
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只用作取消错误标记为有效的舆情)

返回示例

  1. {
  2. "success":true,
  3. "errorCode":null
  4. "other":null,
  5. "msgCode":null,
  6. "msgInfo":null,
  7. "messages":[],
  8. "result":[11179498] // 更新成功的舆情主键ID
  9. }

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。

返回示例

  1. {
  2. "success": true,
  3. "data": [
  4. {
  5. "name": "微信", //注意,facetType=monitor_topic,返回的name为关键字专题ID
  6. "count": 453
  7. },
  8. {
  9. "name": "和讯网",
  10. "count": 95
  11. }
  12. ]
  13. }

返回参数说明

参数名 参数类型 说明
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

返回示例

  1. {
  2. "success": true,
  3. "errorCode": null,
  4. "other": null,
  5. "msgCode": null,
  6. "msgInfo": null,
  7. "messages": [],
  8. "errorMessages": [],
  9. "messageContext": {},
  10. "result": {
  11. "id": 13679723,
  12. "productId": 13966,
  13. "spiderTopicId": 1340,
  14. "monitorKeywords": "11",
  15. "monitorKeywordId": 103028,
  16. "from": "和讯网_科技要闻",
  17. "url": "https://tech.hexun.com/2016-12-13/187322772.html",
  18. "filterStatus": 0,
  19. "createdAt": "2016-12-13T08:29:41.517Z",
  20. "pubTime": "2016-12-13T08:15:00.000Z",
  21. "wbId": null,
  22. "wbUserId": null,
  23. "wbFansCount": 0,
  24. "wbRepostCount": 0,
  25. "wbCommentCount": 0,
  26. "wbLikeCount": 0,
  27. "wbVerifiedType": 0,
  28. "wbType": 2,
  29. "emotionTendency": 1,
  30. "emotionScore": 30,
  31. "urlMD5": "f2eba50c3c881f3909ee22deaef9a5de",
  32. "tags": [],
  33. "langType": "ch",
  34. "subject": "民生银行:史玉柱持股比例增至4.97%",
  35. "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` 民生银行:史玉柱持股比例增...",
  36. "translateSubject": null,
  37. "translateDescription": null,
  38. "clusterId": 13679723,
  39. "priority": 4,
  40. "source": "News",
  41. "attachments": [
  42. {
  43. "filename": "0000.jpg",
  44. "url": "0000.jpg"
  45. }
  46. ]
  47. }
  48. }

返回参数说明

参数名 参数类型 说明
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

返回示例

  1. {
  2. "success":true,
  3. "errorCode":null
  4. "other":null,
  5. "msgCode":null,
  6. "msgInfo":null,
  7. "messages":[],
  8. "result":552 // 生成的微博分析任务主键ID。可用此ID查询分析结果
  9. }

2、查询微博分析结果

API功能:获取微博分析的结果。由于分析需要一定的时间,通常为30次转发/秒,前端可根据此时间进行时间预估。当取得分析结果接口中的data不为null时,表示分析已经完成。

接口名称:getWeiboAnalysisResult

方法:GET

入参说明

参数名 参数类型 是否必填 说明
id int 微博分析任务主键ID

返回示例

分析中(data为null)

  1. { success: true,
  2. result:
  3. { id: 559,
  4. weiboUrl: 'https://weibo.com/1622004114/DsAI319Ai?from=page_1006061622004114_profile&wvr=6&mod=weibotime&type=comment',
  5. uid: null,
  6. screenName: null,
  7. content: '#QCon北京2016# 运维专场开场《海量容器系统运维实践》的讲稿实录,从多Region异地多活,统一接入和安全,Overlay网络虚拟化,以及应用模型和弹性计算几个方面来说如何做高质量架构产品化输出@QCon全球软件开发大会 @InfoQ @开发者头条 @阿里云 @阿里技术嘉年华 https://t.cn/Rq0du7c',
  8. uInfo: null,
  9. wInfo:
  10. { annotations: '',
  11. attitudesCount: 3,
  12. bmiddlePic: '',
  13. commentsCount: 12,
  14. createdAt: 1461562476000,
  15. favorited: false,
  16. geo: 'null',
  17. id: '3968142990275174',
  18. idstr: 3968142990275174,
  19. inReplyToScreenName: '',
  20. inReplyToStatusId: -1,
  21. inReplyToUserId: -1,
  22. latitude: -1,
  23. longitude: -1,
  24. mid: '3968142990275174',
  25. mlevel: 0,
  26. originalPic: '',
  27. picIds: [],
  28. picUrls: [],
  29. repostsCount: 35,
  30. source: [Object],
  31. text: '#QCon北京2016# 运维专场开场《海量容器系统运维实践》的讲稿实录,从多Region异地多活,统一接入和安全,Overlay网络虚拟化,以及应用模型和弹性计算几个方面来说如何做高质量架构产品化输出@QCon全球软件开发大会 @InfoQ @开发者头条 @阿里云 @阿里技术嘉年华 https://t.cn/Rq0du7c',
  32. thumbnailPic: '',
  33. truncated: false,
  34. user: [Object],
  35. visible: [Object] },
  36. totalFollows: null,
  37. simpleReport: null,
  38. detailReport: null,
  39. data: null,
  40. graphData: null,
  41. pubTime: Mon Apr 25 2016 13:34:36 GMT+0800 (CST),
  42. createdAt: Thu Apr 28 2016 17:32:29 GMT+0800 (CST),
  43. updatedAt: Thu Apr 28 2016 17:32:29 GMT+0800 (CST) } }

分析后(data不为null)

  1. { success: true,
  2. result:
  3. { id: 559,
  4. weiboUrl: 'https://weibo.com/1622004114/DsAI319Ai?from=page_1006061622004114_profile&wvr=6&mod=weibotime&type=comment',
  5. uid: '1622004114',
  6. screenName: '淘宝开放平台',
  7. content: '#QCon北京2016# 运维专场开场《海量容器系统运维实践》的讲稿实录,从多Region异地多活,统一接入和安全,Overlay网络虚拟化,以及应用模型和弹性计算几个方面来说如何做高质量架构产品化输出@QCon全球软件开发大会 @InfoQ @开发者头条 @阿里云 @阿里技术嘉年华 https://t.cn/Rq0du7c',
  8. uInfo:
  9. { allowAllActMsg: true,
  10. allowAllComment: false,
  11. avatarLarge: 'https://tp3.sinaimg.cn/1622004114/180/1284433074/1',
  12. biFollowersCount: 192,
  13. city: 1,
  14. createdAt: 1258688488000,
  15. description: '淘宝开放平台是将阿里巴巴内部的商业和能力开放出来,赋能整个商业生态。 进化新商业,开放新思维。 平台动态请关注:https://open.taobao.com 更多官方变更请关注官方公:https://open.taobao.com/support/announcement_list.htm',
  16. favouritesCount: 1,
  17. followMe: false,
  18. followersCount: 38483,
  19. following: true,
  20. friendsCount: 247,
  21. gender: 'm',
  22. id: '1622004114',
  23. lang: 'zh-cn',
  24. location: '浙江 杭州',
  25. name: '淘宝开放平台',
  26. onlineStatus: 0,
  27. profileImageURL: 'https://tp3.sinaimg.cn/1622004114/50/1284433074/1',
  28. profileImageUrl: 'https://tp3.sinaimg.cn/1622004114/50/1284433074/1',
  29. province: 33,
  30. screenName: '淘宝开放平台',
  31. statusId: '',
  32. statusesCount: 1764,
  33. uRL: 'https://open.taobao.com',
  34. url: 'https://open.taobao.com',
  35. userDomain: 'opentaobao',
  36. verified: true,
  37. verifiedReason: '淘宝开放平台部门官方微博',
  38. verifiedType: 2,
  39. verified_reason: '淘宝开放平台部门官方微博',
  40. weihao: '' },
  41. wInfo:
  42. { annotations: '',
  43. attitudesCount: 3,
  44. bmiddlePic: '',
  45. commentsCount: 12,
  46. createdAt: 1461562476000,
  47. favorited: false,
  48. geo: 'null',
  49. id: '3968142990275174',
  50. idstr: 3968142990275174,
  51. inReplyToScreenName: '',
  52. inReplyToStatusId: -1,
  53. inReplyToUserId: -1,
  54. latitude: -1,
  55. longitude: -1,
  56. mid: '3968142990275174',
  57. mlevel: 0,
  58. originalPic: '',
  59. picIds: [],
  60. picUrls: [],
  61. repostsCount: 35,
  62. source: [Object],
  63. text: '#QCon北京2016# 运维专场开场《海量容器系统运维实践》的讲稿实录,从多Region异地多活,统一接入和安全,Overlay网络虚拟化,以及应用模型和弹性计算几个方面来说如何做高质量架构产品化输出@QCon全球软件开发大会 @InfoQ @开发者头条 @阿里云 @阿里技术嘉年华 https://t.cn/Rq0du7c',
  64. thumbnailPic: '',
  65. truncated: false,
  66. user: [Object],
  67. visible: [Object] },
  68. totalFollows: 38483,
  69. simpleReport: '消息曝光量<span title="曝光量表示所有转发用户的总粉丝数">404536</span>,共计转发<b>35</b>次,其中一转<b>17</b>次,二转<b>16</b>次,三转<b>1</b>次,北京、浙江、上海地区参与转发人数较多。用户情绪指数为<b>99</b>,传递了超强的正能量。没有发现任何疑似水军。',
  70. detailReport: null,
  71. data:
  72. { areaMap: [ // 微博转发地域分析
  73. { key: '北京', value: 15 },
  74. { key: '浙江', value: 8 },
  75. { key: '上海', value: 3 },
  76. { key: '江苏', value: 3 },
  77. { key: '山东', value: 2 },
  78. { key: '广东', value: 2 },
  79. { key: '其他', value: 1 },
  80. { key: '海外', value: 1 } ],
  81. emotion: 99, // 情感值
  82. levelList: [ 17, 16, 1, 0 ], // 转发层级分析
  83. sexMap: { '女': 1, '男': 34 }, // 性别比例
  84. timeList: [Object], //转发时间曲线数据
  85. top100User: [ // 关键传播账号
  86. { followersCount: 414,
  87. friendsCount: 354,
  88. gender: 'm',
  89. postTime: 1461581414000,
  90. repostCount: 6,
  91. screenName: 'wisdomyu',
  92. statusMid: '3968222422190527',
  93. userId: '1428493165',
  94. verifiedType: '普通用户' },
  95. { followersCount: 25352,
  96. friendsCount: 669,
  97. gender: 'm',
  98. postTime: 1461563724000,
  99. repostCount: 5,
  100. screenName: '阿里技术嘉年华',
  101. statusMid: '3968148225362229',
  102. userId: '1939498534',
  103. verifiedType: '企业认证(企业)' },
  104. { followersCount: 16613,
  105. friendsCount: 231,
  106. gender: 'm',
  107. postTime: 1461564477000,
  108. repostCount: 4,
  109. screenName: '阿里技术保障',
  110. statusMid: '3968151388144939',
  111. userId: '3851645388',
  112. verifiedType: '企业认证(企业)' },
  113. { followersCount: 957,
  114. friendsCount: 874,
  115. gender: 'm',
  116. postTime: 1461597070000,
  117. repostCount: 1,
  118. screenName: '臧秀涛',
  119. statusMid: '3968288091950552',
  120. userId: '2710829805',
  121. verifiedType: '个人认证(名人)' },
  122. { followersCount: 23384,
  123. friendsCount: 118,
  124. gender: 'm',
  125. postTime: 1461566131000,
  126. repostCount: 1,
  127. screenName: '阿里数据',
  128. statusMid: '3968158325129144',
  129. userId: '2414452832',
  130. verifiedType: '企业认证(企业)' },
  131. { followersCount: 8531,
  132. friendsCount: 217,
  133. gender: 'm',
  134. postTime: 1461651555000,
  135. repostCount: 1,
  136. screenName: 'Docker精选',
  137. statusMid: '3968516614579106',
  138. userId: '5360910133',
  139. verifiedType: '普通用户' } ],
  140. totalFollows: 404536,
  141. userTypeMap: { '个人认证': 3, '企业认证': 9, '微博达人': 4, '普通用户': 19 }, // 用户类型
  142. waterArmyMap: { false: 35, true: 0 } // 水军分析
  143. },
  144. graphData: ....., //路径传播图 xml数据
  145. pubTime: Mon Apr 25 2016 13:34:36 GMT+0800 (CST),
  146. createdAt: Thu Apr 28 2016 17:32:29 GMT+0800 (CST),
  147. updatedAt: Thu Apr 28 2016 17:32:32 GMT+0800 (CST) } }

传播链接的展示推荐使用gephi组件。

3、分析一个微博账号的水军概率

API功能:通过公众趋势分析独创的水军分析算法,判断一个微博账号的水军概率。返回结果为0到1之间的一个浮点数,数值越接近1,越有可能是水军。

接口名称:getWaterArmyAnalysisResult

方法:GET

入参说明

参数名 参数类型 是否必填 说明
id int 微博用户ID。在微博URL中可得到

返回示例

  1. {
  2. "success": true,
  3. "result": 0.01,
  4. "messages": []
  5. }

七、首页报表接口

1、源站类型分析

API功能:查询某个时间点的不同源站下的舆情数量

接口名称:queryReportNumber

方法: GET

入参说明

参数名 参数类型 说明 是否必填
keyWordTopicId int 专题ID,不传则获取全部专题的源站类型
time int 时间,如20160121
timeType int 过滤的时间类型,0为当天,1为近七天,2为近30天。不传则默认为0

返回示例

  1. {
  2. "success": true,
  3. "messages": [ ],
  4. "result": [
  5. {
  6. "logDate": 20161012,
  7. "sourceName": "新闻",
  8. "value": 871
  9. }]
  10. }

返回参数说明

参数名 参数类型 说明
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

返回示例

  1. {
  2. "success": true,
  3. "result": {
  4. "logDate": 20160922,
  5. "value": 14
  6. },
  7. "messages": []
  8. }

返回参数说明

参数名 参数类型 说明
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

返回示例

  1. {
  2. "success": true,
  3. "result": {
  4. "logDate": 20160922,
  5. "listData": [
  6. {
  7. "name": "破土",
  8. "count": 187
  9. }],
  10. "messages": []
  11. }

返回参数说明

参数名 参数类型 说明
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

返回示例

  1. {
  2. "success": true,
  3. "result": {
  4. "logDate": 20160922,
  5. "listData": [
  6. {
  7. "name": "【实时路况】#出行提示#8:30分,虹桥枢纽周边道路情况(绿色为畅通,...",
  8. "count": 44
  9. }
  10. ]
  11. },
  12. "messages": []
  13. }

返回参数说明

参数名 参数类型 说明
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

返回示例

  1. {
  2. "success": true,
  3. "result": {
  4. "logDate": 20160922,
  5. "value": 1309
  6. },
  7. "messages": []
  8. }

返回参数说明

参数名 参数类型 说明
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

返回示例

  1. {
  2. "success": true,
  3. "result": {
  4. "logDate": 20160922,
  5. "listData": [
  6. {
  7. "name": "【实时路况】#出行提示#8:30分,虹桥枢纽周边道路情况(绿色为畅通,...",
  8. "count": 44
  9. },
  10. {
  11. "name": "10月16日#2016南京马拉松# 比赛期间,江东中路等部分道路分段实...",
  12. "count": 26
  13. }
  14. ]
  15. },
  16. "messages": []
  17. }

返回参数说明

参数名 参数类型 说明
logDate Date 采集时间。时间格式为UTC时间
listData list 各关键字对应的详情
listData.name string 关键字名称
listData.count int 关键字的舆情统计数量
最后更新:2016-12-16 18:31:31

  上一篇:go 开发者指南___公众趋势分析-阿里云
  下一篇:go 服务SLA__公众趋势分析-阿里云