[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eAfter creating and uploading data to a dataset, you can access it using HTTP GET requests to list all datasets, retrieve information about a specific dataset, or download the dataset data.\u003c/p\u003e\n"],["\u003cp\u003eWhen data is successfully uploaded, it creates a new, active version of the dataset, which is the version used by your application.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve details for all datasets or filter by the active version using specific API endpoints and parameters.\u003c/p\u003e\n"],["\u003cp\u003eDownloading a dataset involves sending a GET request to a dedicated endpoint, specifying the dataset ID and desired output location.\u003c/p\u003e\n"]]],[],null,["# Get a dataset\n\nAfter you create a dataset and upload data to it, you can use HTTP GET requests\nto access the dataset. This page describes how to list all of your datasets,\nhow to get information about a specific dataset, and how to download the data\nfrom a dataset.\n\nAbout dataset versions\n----------------------\n\nAfter a successful data upload, the state of the dataset is set to\n`STATE_COMPLETED` and that dataset becomes the *active* version. That means the\ndataset is ready to use in your app. To determine the `state` of the dataset,\nyou can either list all datasets or get a specific dataset.\n\nYou can upload new data to the dataset to create a new version of the\ndataset:\n\n- If the new data uploads successfully, the new version becomes the \"active\"\n version and is the version used by your app.\n\n- If there is an error in the upload, the previous successful dataset version\n stays as the \"active\" version and is the version used by your app.\n\nFor more information about creating a new version of a dataset, see\n[Upload new data to the dataset](/maps/documentation/datasets/create#new-version).\n\nList all datasets\n-----------------\n\nList all datasets by sending an HTTP `GET` request to the\n[list datasets](/maps/documentation/datasets/reference/rest/v1/projects.datasets/list) endpoint: \n\n```html\nhttps://mapsplatformdatasets.googleapis.com/v1/projects/PROJECT_NUMBER_OR_ID/datasets\n```\n\nThis request returns information about the latest version of all datasets,\nregardless of whether the version is the active version. If you only want to\nlist the active version of each dataset, append the `tag=active` query parameter\nto the request: \n\n```html\nhttps://mapsplatformdatasets.googleapis.com/v1/projects/PROJECT_NUMBER_OR_ID/datasets?tag=active\n```\n\nFor example, this call returns information about the latest version of all\ndatasets: \n\n```\ncurl -X GET \\\n-H 'X-Goog-User-Project: PROJECT_NUMBER_OR_ID' \\\n-H 'Authorization: Bearer $TOKEN' \\\n\"https://mapsplatformdatasets.googleapis.com/v1/projects/PROJECT_NUMBER_OR_ID/datasets\"\n```\n\nThis call returns a response in the form: \n\n```\n{\n \"datasets\": [\n {\n \"name\": \"projects/PROJECT_NUMBER_OR_ID/datasets/f57074a0-a8b6-403e-9df1-e8a9e4f9fc46\",\n \"displayName\": \"My Test Dataset\",\n \"versionId\": \"5fb34e-1405-4ecd-8f81-31f1c07\",\n \"usage\": [\n \"USAGE_DATA_DRIVEN_STYLING\"\n ],\n \"gcsSource\": {\n \"inputUri\": \"gs://mybucket/my.csv\",\n \"fileFormat\": \"FILE_FORMAT_CSV\"\n },\n \"createTime\": \"2023-03-24T14:47:37.308977Z\",\n \"updateTime\": \"2023-03-24T14:48:05.053114Z\",\n \"versionCreateTime\": \"2023-03-24T14:48:05.053114Z\",\n \"status\": {\n \"state\": \"STATE_COMPLETED\"\n }\n },\n {\n \"name\": \"projects/PROJECT_NUMBER_OR_ID/datasets/2c8ae479-96704-89c6435ca959\",\n \"displayName\": \"My Other Test Dataset\",\n \"versionId\": \"0d2e3-b9da-47cc-819f-7ac67562\",\n \"usage\": [\n \"USAGE_DATA_DRIVEN_STYLING\"\n ],\n \"localFileSource\": {\n \"fileFormat\": \"FILE_FORMAT_CSV\"\n },\n \"createTime\": \"2023-03-24T14:41:52.579755Z\",\n \"updateTime\": \"2023-03-24T14:42:56.784122Z\",\n \"versionCreateTime\": \"2023-03-24T14:42:56.784122Z\",\n \"status\": {\n \"state\": \"STATE_COMPLETED\"\n }\n }\n ]\n}\n```\n\nGet information about a dataset\n-------------------------------\n\nTo get information about a specific dataset, send an HTTP `GET` request to the\n[get dataset](/maps/documentation/datasets/reference/rest/v1/projects.datasets/get) endpoint that also\nincludes the ID of the dataset: \n\n```html\nhttps://mapsplatformdatasets.googleapis.com/v1/projects/PROJECT_NUMBER_OR_ID/datasets/DATASET_ID\n```\n\nThis request returns information about the latest version of the dataset,\nregardless of whether the version is the active version. If you want information\nabout the active version of the dataset, append the `@active` tag to the\nrequest: \n\n```html\nhttps://mapsplatformdatasets.googleapis.com/v1/projects/PROJECT_NUMBER_OR_ID/datasets/DATASET_ID@active\n```\n\nFor example: \n\n```\ncurl -X GET \\\n-H 'X-Goog-User-Project: PROJECT_NUMBER_OR_ID' \\\n-H 'Authorization: Bearer $TOKEN' \\\n\"https://mapsplatformdatasets.googleapis.com/v1/projects/PROJECT_NUMBER_OR_ID/datasets/f57074a0-a8b6-403e-9df1-e8a9e4f9fc46@active\"\n```\n\nThis request returns a response in the form: \n\n```\n{\n \"name\": \"projects/PROJECT_NUMBER_OR_ID/datasets/f57074a0-a8b6-403e-9df1-e8a9e4f9fc46\",\n \"displayName\": \"My Test Dataset\",\n \"versionId\": \"5fb34e-1405-4ecd-8f81-31f1c07\",\n \"usage\": [\n \"USAGE_DATA_DRIVEN_STYLING\"\n ],\n \"gcsSource\": {\n \"inputUri\": \"gs://mybucket/my.csv\",\n \"fileFormat\": \"FILE_FORMAT_CSV\"\n },\n \"createTime\": \"2023-03-24T14:47:37.308977Z\",\n \"updateTime\": \"2023-03-24T14:48:05.053114Z\",\n \"versionCreateTime\": \"2023-03-24T14:48:05.053114Z\",\n \"status\": {\n \"state\": \"STATE_COMPLETED\"\n }\n}\n```\n\nDownload a dataset\n------------------\n\nTo download the data from the latest version of a dataset, send an HTTP `GET`\nrequest to the\n[download dataset](/maps/documentation/datasets/reference/rest/v1/media/download)\nendpoint that also includes the ID of the dataset:\n**Note:** The latest version might not be the active version of the dataset. \n\n```html\nhttps://mapsplatformdatasets.googleapis.com/v1/projects/PROJECT_NUMBER_OR_ID/datasets/DATASET_ID:download?alt=media\n```\n\nFor example: \n\n```\ncurl -X GET -L \\\n-H 'X-Goog-User-Project: PROJECT_NUMBER_OR_ID' \\\n-H 'Authorization: Bearer $TOKEN' \\\n--output LOCAL_LOCATION_TO_OUTPUT \\\n\"https://mapsplatformdatasets.googleapis.com/download/v1/projects/PROJECT_NUMBER_OR_ID/datasets/f57074a0-a8b6-403e-9df1-e8a9e4f9fc46:download?alt=media\"\n```\n\nIn this example, you use the `cURL --output` option to specify the name of the\nfile that holds the downloaded data. For example, the following `--output` flag\nspecifies to download the dataset to a file named *myjson.json* in the same\ndirectory used to run the `cURL` command: \n\n```\n--output myjson.json\n```\n\nOr use the following flag to download the data to *myjson.json* in the `/tmp`\ndirectory: \n\n```\n--output /tmp/myjson.json\n```"]]