GET/api/v4/review-phrases

列出评价中的短语

返回客户在某个地点的评价中最常使用的短语,每个短语都附有各自的评价统计数据。

需要 API 密钥。请求头格式和密钥轮换请参阅身份验证。

参数

查询

名称类型必填描述默认值
locationIdsstring可选JSON array of location IDs to aggregate over, e.g. `[1800289,1800290]`. Query values are JSON-parsed, so a bare single ID also works. Omit to cover every location the key can read.—
siteUrlsstring可选JSON array of review sources to include, e.g. `["maps.google.com"]`.—
startDatestring可选Only count reviews on or after this date (`YYYY-MM-DD`).—
endDatestring可选Only count reviews on or before this date (`YYYY-MM-DD`).—
searchStringstring可选Only return phrases containing this substring.—
phraseCountinteger可选Maximum number of phrases to return.—
categoriesstring可选JSON array of interaction categories to include (see the interaction attributes reference).—
ratingFiltersstring可选JSON array of star ratings to include, e.g. `[1,2]` to mine only unhappy reviews.—
responseStatusstring可选JSON array of `RESPONDED` / `PENDING` to restrict by whether the review has an owner reply.—
sortOrderstring可选One of `NEWEST_FIRST`, `OLDEST_FIRST`, `LAST_RESPONDED`, `LOWEST_RATING`, `HIGHEST_RATING`.—
categorystring可选Deprecated single-value form of `categories`. Kept for v4 compatibility; prefer `categories`.—
ratingFilterinteger可选Deprecated single-value form of `ratingFilters`. Kept for v4 compatibility; prefer `ratingFilters`.—

响应

200Phrases with their per-phrase review stats. Response key `newReviewPhrases`, a top-level array.
Response
{  "data": {    "newReviewPhrases": [      {        "reviewPhrase": "friendly staff",        "phraseStats": {          "stats": [            { "name": "total-reviews", "value": 46, "delta": 12.5, "abs": 5 },            { "name": "overall-rating", "value": 4.7, "delta": 1.1, "abs": 0.05 }          ]        }      },      {        "reviewPhrase": "long wait",        "phraseStats": {          "stats": [            { "name": "total-reviews", "value": 11, "delta": 37.5, "abs": 3 },            { "name": "overall-rating", "value": 2.9, "delta": -8.4, "abs": -0.27 }          ]        }      }    ]  }}
401Unauthenticated, missing or invalid API key.
403The key is valid but not permitted to read one of the requested locations (`SY90003`).

返回某个地点的评价文本中反复出现的短语,每个短语都附有仅针对包含该短语的评价子集计算的评价统计数据。它回答的问题是:“客户反复提到什么,这些提及是正面的还是负面的?”

data.newReviewPhrases 是一个顶层数组,而不是分页响应。使用 phraseCount 限制其长度。

每个条目包含:

  • reviewPhrase:短语本身。
  • phraseStats.stats:与获取互动分析中的 { name, value, delta } 具有相同的结构,仅针对包含该短语的评价计算,另外还包含一个 abs 字段,用于表示绝对变化量(而非百分比变化)。

所有筛选条件都是可选的,且可以组合使用,因此该路由也可用于对评价进行文本搜索:将 ratingFilters=[1,2] 与 startDate 结合使用,可获取上个月的投诉,并按其出现频率排序。

使用场景:“最常见投诉”面板

要为某个地点构建投诉面板,请调用此路由,并传入 ratingFilters=[1,2]、设为 90 天前的 startDate 以及 phraseCount=10。结果为低评分评价中出现最频繁的 10 个短语。查看每个短语的 overall-rating 对应的 phraseStats,可以帮助您判断该短语是否确实异常突出,还是仅仅属于常用词汇,而 delta 则表明情况是否正在恶化。

由于查询参数值会按 JSON 解析,因此数组需以 JSON 形式放入查询字符串:?ratingFilters=[1,2]&siteUrls=["maps.google.com"]。

上述响应为示例。

Request
curl -X GET 'https://listingsapi.com/api/v4/review-phrases' \  -H "Authorization: API $LISTINGSAPI_KEY"