측정항목 세트 쿼리
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
모든 설정을 완료한 후 Google Play Developer Reporting API에 요청을 보내 측정항목 세트에 관한 메타데이터를 가져오고 측정항목을 쿼리할 수 있습니다.
다음 코드 샘플은 몇 가지 간단한 요청을 보내는 방법을 보여줍니다. 예를 들어 아래 메서드는 앱의 다양한 측정항목을 가져오는 방법을 보여줍니다. 쿼리를 좁히는 데 사용할 수 있는 다양한 쿼리 매개변수가 있습니다.
다음 예에서는 가상 애플리케이션 com.example.app
에 설정된 비정상 종료 비율 측정항목 세트의 메타데이터를 검색합니다.
간단한 요청:
이 HTTP GET
요청은 애플리케이션 이름 매개변수를 지정하고 애플리케이션과 연결된 전체 측정항목 리소스를 반환합니다.
GET https://playdeveloperreporting.googleapis.com/v1beta1/apps/com.example.app/crashRateMetricSet
측정항목 정보 응답:
응답에는 측정항목 세트와 관련된 다음 필드가 포함됩니다.
{
"freshness_info": {
"freshness": [
"aggregation_period": "DAILY"
"latest_end_time": { year: "2021" month: "7" day: "22" time_zone: "America/Los_Angeles" }
]
}
}
쿼리 기능 사용
동일한 리소스에 대한 다음 HTTP POST
요청은 query
엔드포인트를 사용하여 측정항목 세트 내에서 특정 데이터를 가져옵니다.
POST https://playdeveloperreporting.googleapis.com/v1beta1/apps/com.example.app/crashRateMetricSet:query
요청 본문에서 특정 기준에 따라 측정항목을 가져오는 쿼리 옵션을 전달합니다.
{
"timeline_spec": {
"aggregation_period": "DAILY"
"start_time": { year: "2021" month: "7" day: "1" time_zone: "America/Los_Angeles" }
"end_time": { year: "2021" month: "7" day: "3" time_zone: "America/Los_Angeles" }
}
"dimensions": ["apiLevel"]
"metrics": ["errorReportCount", "distinctUsers"]
"page_size": "10"
}
다음은 컬렉션 수준의 몇 가지 예입니다.
필드 |
timelineSpec |
object (TimelineSpec )
타임라인 집계 매개변수의 사양입니다. 지원되는 집계 기간 목록은 각 측정항목 세트의 문서를 확인하세요.
|
dimensions[] |
string
측정항목을 분류할 측정기준입니다. 지원되는 측정기준 목록은 각 측정항목 세트의 문서를 확인하세요.
|
metrics[] |
string
집계할 측정항목입니다.
|
pageSize |
integer
반환된 데이터의 최대 크기입니다. 지정하지 않으면 최대 1, 000개의 행이 반환됩니다. 최댓값은 100,000이며, 100,000을 초과하는 값은 100,000으로 변환됩니다.
|
응답 처리
서버는 유효한 필드가 포함된 유효한 요청을 처리한 후 요청된 데이터와 함께 HTTP 200 OK
상태 코드를 반환합니다. fields
쿼리 매개변수에 오류가 있거나 매개변수가 유효하지 않은 경우 서버에서는 HTTP 400 Bad Request
상태 코드와 함께 필드 선택에 어떤 문제가 있는지 알려 주는 오류 메시지 (예: "Invalid field timeline_spec"
)를 반환합니다.
다음은 위 소개 섹션에 나와 있는 응답의 예입니다.
POST https://playdeveloperreporting.googleapis.com/v1beta1/apps/com.example.app/crashRateMetricSet:query
응답은 다음과 같습니다.
200 OK
{
rows: [
{
aggregation_period: "DAILY"
start_time: { year: "2021" month: "7" day: "1" time_zone: "America/Los_Angeles" }
dimensions: [{dimension: "apiLevel" int64_value: "20"}]
metrics: [
{metric: "errorReportCount" decimal_value: "100"},
{metric: "distinctUsers" decimal_value: "57"},
]
}, {
aggregation_period: "DAILY"
start_time: { year: "2021" month: "7" day: "1" time_zone: "America/Los_Angeles" }
dimensions: [{dimension: "apiLevel" int64_value: "21"}]
metrics: [
{metric: "errorReportCount" decimal_value: "123"},
{metric: "distinctUsers" decimal_value: "65"},
]
},
...
]
next_page_token: "eW91IGhhdmUgdG9vIG11Y2ggZnJlZSB0aW1l"
}
참고: 데이터 페이지 나누기를 위한 쿼리 매개변수 (예: maxResults
및 nextPageToken
)를 지원하는 API의 경우 이러한 매개변수를 사용하여 각 쿼리의 결과를 관리 가능한 크기로 줄이세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eSend requests to the Google Play Developer Reporting API to retrieve app metric data after setup.\u003c/p\u003e\n"],["\u003cp\u003eUse the \u003ccode\u003equery\u003c/code\u003e endpoint with parameters like \u003ccode\u003etimeline_spec\u003c/code\u003e, \u003ccode\u003edimensions\u003c/code\u003e, and \u003ccode\u003emetrics\u003c/code\u003e to retrieve specific data within a metric set.\u003c/p\u003e\n"],["\u003cp\u003eResponses include metric data based on the query, or error messages for invalid requests.\u003c/p\u003e\n"],["\u003cp\u003eFor large datasets, utilize pagination parameters like \u003ccode\u003epageSize\u003c/code\u003e to handle responses efficiently.\u003c/p\u003e\n"]]],["After setup, you can interact with the Google Play Developer Reporting API. A `GET` request, like for `com.example.app`, can retrieve metric set metadata, including freshness information. To query specific data, use a `POST` request with parameters like `timeline_spec`, `dimensions`, `metrics`, and `page_size`. A successful request returns a `200 OK` status and the requested data, while a `400 Bad Request` signifies errors in the query parameters. Use pagination to manage large data sets.\n"],null,["# Querying Metric Sets\n\nAfter you've set everything up, you can send requests to the Google Play Developer Reporting API to retrieve\nmetadata about metric sets and query their metrics.\n\n\nThe following code samples demonstrate how to send a few simple requests. For example, the\nmethods below show you how to retrieve various metrics for your app. There are a few different\nquery parameters that can be used to narrow your query.\n\nRetrieving metric set metadata\n------------------------------\n\n\nThe following example retrieves the metadata for the crash rate metric set for a fictional\napplication, `com.example.app`.\n\n#### Simple request:\n\n\nThis HTTP `GET` request specifies the application name parameter and returns the\nfull metric resource associated with your application. \n\n```text\nGET https://playdeveloperreporting.googleapis.com/v1beta1/apps/com.example.app/crashRateMetricSet\n```\n\n#### Metric info response:\n\n\nThe response includes the following fields related to the metric set: \n\n```verilog\n{\n \"freshness_info\": {\n \"freshness\": [\n \"aggregation_period\": \"DAILY\"\n \"latest_end_time\": { year: \"2021\" month: \"7\" day: \"22\" time_zone: \"America/Los_Angeles\" }\n ]\n }\n}\n```\n\nUsing the query feature\n-----------------------\n\n\nThe following HTTP `POST`request for this same resource uses the `query`\nendpoint to retrieve specific data from within the metric set. \n\n```text\nPOST https://playdeveloperreporting.googleapis.com/v1beta1/apps/com.example.app/crashRateMetricSet:query\n```\n\n\nIn the request body, pass query options to retrieve metrics based on specific criteria. \n\n```verilog\n{\n \"timeline_spec\": {\n \"aggregation_period\": \"DAILY\"\n \"start_time\": { year: \"2021\" month: \"7\" day: \"1\" time_zone: \"America/Los_Angeles\" }\n \"end_time\": { year: \"2021\" month: \"7\" day: \"3\" time_zone: \"America/Los_Angeles\" }\n }\n \"dimensions\": [\"apiLevel\"]\n \"metrics\": [\"errorReportCount\", \"distinctUsers\"]\n \"page_size\": \"10\"\n}\n```\n\n\nHere are some collection-level examples:\n\n| Fields ||\n|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `timelineSpec` | `object (`[TimelineSpec](/play/developer/reporting/reference/rest/v1beta1/anomalies#TimelineSpec)`)` Specification of the timeline aggregation parameters. Please check the documentation of each metric set for a list of what aggregation periods are supported. |\n| `dimensions[]` | `string` Dimensions to slice the metrics by. Please check the documentation of each metric set for a list of what dimensions are supported. |\n| `metrics[]` | `string` Metrics to aggregate. |\n| `pageSize` | `integer` Maximum size of the returned data. If unspecified, at most 1000 rows will be returned. The maximum value is 100,000; values above 100,000 will be coerced to 100,000. |\n\n### Handling responses\n\n\nAfter a server processes a valid request that includes valid fields, it sends back an HTTP\n`200 OK` status code, along with the requested data. If the `fields`\nquery parameter has an error or is otherwise invalid, the server returns an HTTP\n`400 Bad Request` status code, along with an error message telling the user what\nwas wrong with their fields selection (for example, `\"Invalid field timeline_spec\"`).\n\n\nHere is the response example shown in the introductory section above. \n\n```text\nPOST https://playdeveloperreporting.googleapis.com/v1beta1/apps/com.example.app/crashRateMetricSet:query\n```\n\nThe response looks like this: \n\n```\n200 OK\n``` \n\n```verilog\n{\n rows: [\n {\n aggregation_period: \"DAILY\"\n start_time: { year: \"2021\" month: \"7\" day: \"1\" time_zone: \"America/Los_Angeles\" }\n dimensions: [{dimension: \"apiLevel\" int64_value: \"20\"}]\n metrics: [\n {metric: \"errorReportCount\" decimal_value: \"100\"},\n {metric: \"distinctUsers\" decimal_value: \"57\"},\n ]\n }, {\n aggregation_period: \"DAILY\"\n start_time: { year: \"2021\" month: \"7\" day: \"1\" time_zone: \"America/Los_Angeles\" }\n dimensions: [{dimension: \"apiLevel\" int64_value: \"21\"}]\n metrics: [\n {metric: \"errorReportCount\" decimal_value: \"123\"},\n {metric: \"distinctUsers\" decimal_value: \"65\"},\n ]\n },\n ...\n ]\n next_page_token: \"eW91IGhhdmUgdG9vIG11Y2ggZnJlZSB0aW1l\"\n}\n```\n\n\n**Note:** For APIs that support query parameters for data pagination (`maxResults`\nand `nextPageToken`, for example), use those parameters to reduce the results of each\nquery to a manageable size."]]