Paginate query results

판매자 센터 쿼리 언어는 다음과 같은 페이지로 나누기 필드를 제공합니다.

  • pageSize: 단일 요청에서 검색할 최대 행 수입니다. 기본값은 최대 1,000행의 페이지 크기입니다.
  • pageToken: 반환할 페이지의 토큰입니다. 지정하지 않으면 첫 번째 페이지가 반환됩니다.
  • nextPageToken: accounts.reports.search 호출에서 다음 페이지를 가져오는 pageToken 값입니다.

pageToken가 제공되는 경우 예기치 않은 동작을 방지하기 위해 호출의 다른 모든 매개변수가 이전 호출과 일치해야 합니다.

예를 들어 offerId 값이 100,000개이고 pageSize이 200으로 설정된 계정에서 다음 쿼리를 실행하는 경우 첫 번째 응답의 nextPageToken와 함께 ReportRow 객체 200개만 결과에 포함됩니다.

SELECT offerId, impressions, clicks, clickThroughRate
FROM ProductPerformanceView
WHERE date BETWEEN '2021-12-01' AND '2021-12-31'

다음은 샘플 응답 (처음 5개 결과 및 nextPageToken)입니다.

{
  "results": [
    {
      "productPerformanceView": {
        "offerId": "12345",
        "clicks": "0",
        "impressions": "59",
        "clickThroughRate": 0
      }
    },
    {
      "productPerformanceView": {
        "offerId": "12346",
        "clicks": "9625",
        "impressions": "276695",
        "clickThroughRate": 0.034785594246372356
      }
    },
    {
      "productPerformanceView": {
        "offerId": "12347",
        "clicks": "148",
        "impressions": "22045",
        "clickThroughRate": 0.0067135404853708325
      }
    },
    {
      "productPerformanceView": {
        "offerId": "12348",
        "clicks": "11",
        "impressions": "1100",
        "clickThroughRate": 0.01
      }
    },
    {
      "productPerformanceView": {
        "offerId": "12349",
        "clicks": "569",
        "impressions": "62977",
        "clickThroughRate": 0.0090350445400701838
      }
    },
    ...
  ],
  "nextPageToken": "CMgB"
}

다음 200개 행을 검색하려면 동일한 페이지 크기로 요청을 다시 전송하되 요청의 pageToken를 이전 응답의 nextPageToken로 업데이트합니다.