/api/v4/locations/{locationId}/reviews사업장의 상호작용 목록 조회
필터를 적용하여 단일 사업장의 리뷰 및 소셜 상호작용 목록을 커서 기반 페이지네이션으로 반환합니다.
매개변수
경로
| 이름 | 유형 | 필수 | 설명 |
|---|---|---|---|
| locationId | string | 필수 | Location ID, a raw numeric database ID (e.g. `1800289`) or its Base64-encoded Relay ID (e.g. `TG9jYXRpb246MTgwMDI4OQ==`). |
쿼리
| 이름 | 유형 | 필수 | 설명 | 기본값 |
|---|---|---|---|---|
| siteUrls | string | 선택 | JSON-encoded array of publisher hostnames to include, e.g. `["maps.google.com","yelp.com"]`. | — |
| startDate | string | 선택 | Start of the date-range filter (YYYY-MM-DD). | — |
| endDate | string | 선택 | End of the date-range filter (YYYY-MM-DD). | — |
| searchString | string | 선택 | Full-text search across interaction content. | — |
| category | string | 선택 | Single interaction category, e.g. `REVIEW`. | — |
| categories | string | 선택 | JSON-encoded array of interaction categories. | — |
| ratingFilters | string | 선택 | JSON-encoded array of star ratings to include, e.g. `[3,4]`. | — |
| ratingFilter | integer | 선택 | Single star rating to filter by. | — |
| responseStatus | string | 선택 | JSON-encoded response-status filter. Values: `RESPONDED`, `PENDING`. | — |
| sortOrder | string | 선택 | JSON-encoded sort order. Values: `NEWEST_FIRST`, `OLDEST_FIRST`, `LAST_RESPONDED`. | — |
| first | integer | 선택 | Number of records to return from the beginning (newest first). Defaults to 20 when omitted, the endpoint always returns a single page, never the whole history. | — |
| after | string | 선택 | Cursor to page forward from. Pass `pageInfo.endCursor`, or equivalently the `cursor` of the last edge in the previous page. | — |
| last | integer | 선택 | Number of records to return from the end. | — |
| before | string | 선택 | Cursor to page backward from, used with `last`. Pass the `cursor` of the first edge of the page you are moving back from. `pageInfo` carries no `startCursor` field, so the edge cursor is the value to use. | — |
응답
200Paginated interactions result. `data.interactions` holds the connection.
{ "data": { "interactions": { "pageInfo": { "hasNextPage": true, "hasPreviousPage": false, "endCursor": "SW50ZXJhY3Rpb246MV8xNTU0MjQzMDczMDM2LTllMjZkMmE4LWE2ZWQtNDJlYS04NDU0LTQ3ZDFjOTJlYTg0MQ==" }, "edges": [ { "node": { "id": "9e26d2a8-a6ed-42ea-8454-47d1c92ea841", "source": "maps.google.com", "content": "nice place for family together", "authorName": "vaibhav nakate", "rating": 5, "date": "2019-04-02T22:11:13.036997+00:00", "category": "Review", "type": "Review", "responded": false, "responseCount": 0, "canRespond": true, "permalink": "https://maps.google.com/maps?cid=..." }, "cursor": "SW50ZXJhY3Rpb246MV8xNTU0MjQzMDczMDM2LTllMjZkMmE4LWE2ZWQtNDJlYS04NDU0LTQ3ZDFjOTJlYTg0MQ==" } ], "totalCount": 425 } }}401Unauthenticated, missing or invalid API key.
429Rate limit exceeded. Retry after the `Retry-After` header value.
커서 기반 페이지네이션을 사용하여 사업장의 리뷰 및 소셜 상호작용을 반환합니다. 결과는 기본적으로 최신순으로 정렬됩니다. 커넥션은 data.interactions에 있으며, edges[].node(상호작용 속성 참조 참조), pageInfo 내의 endCursor, totalCount를 포함합니다.
totalCount는 이 페이지에서 반환된 상호작용 수가 아니라 전체 결과 집합에서 필터와 일치하는 상호작용 수입니다. 이를 사용하여 백필 규모를 산정하거나 직접 집계한 수를 확인할 수 있습니다. totalCount: 450인 사업장을 first=50으로 읽으면 요청이 9회 필요하며, 끝까지 조회했을 때 개수의 합은 450이 되어야 합니다. first를 생략하면 레코드 20개가 반환되므로, 단일 호출로는 전체 이력을 가져올 수 없습니다.
사용 사례: 매장별 리뷰 수신함
사업장 1개의 리뷰 수신함을 구축하려면 first와 after로 다음 페이지를 조회합니다. first=25를 요청한 다음, 응답의 pageInfo.endCursor를 다음 호출에서 after로 전달합니다. 각 edge에도 고유한 cursor가 있으며, 마지막 edge의 cursor는 해당 페이지의 endCursor이므로 두 값 중 어느 것이든 after로 사용할 수 있습니다. hasNextPage가 false일 때 또는 반환된 페이지의 edges 배열이 비어 있을 때 중단하되, 페이지 경계가 가장 오래된 리뷰와 정확히 일치하면 마지막으로 빈 페이지가 1개 더 반환되므로 두 조건을 모두 확인합니다. 아직 소유자 답글을 기다리는 리뷰만 표시하려면 responseStatus=["PENDING"]을 추가로 적용하고, 부정적인 리뷰를 먼저 분류하려면 ratingFilters=[1,2]를 추가로 적용합니다. 각 node의 id는 상호작용에 답글 작성에 전달하는 값이며, canRespond는 해당 소스가 소유자 답글을 허용하는지 알려 줍니다.
사용 사례: 증분 동기화
로컬 미러를 동기화된 상태로 유지하려면 startDate/endDate로 필터링하고 sortOrder=["NEWEST_FIRST"]로 정렬하며, 지금까지 확인한 가장 큰 date 값을 영구 저장합니다. 이 엔드포인트에는 페이지네이션과 요청 빈도 제한이 적용되므로, 429 응답의 Retry-After 헤더를 준수하고 실행할 때마다 전체 이력을 다시 가져오지 않도록 합니다.
Google Maps와 Facebook은 모든 요금제에서 사용할 수 있습니다. Yelp는 Growth 및 Enterprise 요금제에서 사용할 수 있습니다. JSON으로 인코딩된 필터(siteUrls, categories, ratingFilters, responseStatus, sortOrder)는 URL로 인코딩된 JSON 문자열로 전달됩니다.
curl -X GET 'https://listingsapi.com/api/v4/locations/<locationId>/reviews' \ -H "Authorization: API $LISTINGSAPI_KEY"