閱讀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__公眾趨勢分析-阿裏雲