[null,null,["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Choose fields to return\n\n**European Economic Area (EEA) developers** If your billing address is in the European Economic Area, effective on 8 July 2025, the [Google Maps Platform EEA Terms of Service](https://cloud.google.com/terms/maps-platform/eea) will apply to your use of the Services. Functionality varies by region. [Learn more](/maps/comms/eea/faq).\n\nWhen you make a geocoding request, you can use a *field mask* to specify the\nlist of fields to return in the response. For the\n[Geocode an address](/maps/documentation/geocoding/geocoding),\n[Geocode a location](/maps/documentation/geocoding/reverse-geocoding), and\n[Place geocoding](/maps/documentation/geocoding/places-geocoding) endpoints, all\nfields in the response object are returned by default. For the\n[Search for destinations](/maps/documentation/geocoding/search-for-destinations)\nendpoint, you must specify a field mask in the API request.\n\nUse a field mask to ensure that you don't request unnecessary data, which in\nturn helps with response latency.\n\nDefine a response field mask\n----------------------------\n\nThe response field mask is a comma-separated list of paths with no spaces, where\neach path specifies a unique field in the response object. The path starts from\nthe top-level response field and uses a dot-separated path to a specified\nfield.\n| **Note:** Don't use spaces anywhere in the list of field paths.\n\nPass the response field mask to a request by using the URL parameter `$fields`\nor `fields`, or by using the HTTP or gRPC header `X-Goog-FieldMask`.\n\nExample field masks\n-------------------\n\nShown below is the complete response from a forward geocoding request: \n\n```json\n{\n \"results\": [\n {\n \"place\": \"//places.googleapis.com/places/ChIJF4Yf2Ry7j4AR__1AkytDyAE\",\n \"placeId\": \"ChIJF4Yf2Ry7j4AR__1AkytDyAE\",\n \"location\": {\n \"latitude\": 37.422010799999995,\n \"longitude\": -122.08474779999999\n },\n \"granularity\": \"ROOFTOP\",\n \"viewport\": {\n \"low\": {\n \"latitude\": 37.420656719708511,\n \"longitude\": -122.08547523029148\n },\n \"high\": {\n \"latitude\": 37.4233546802915,\n \"longitude\": -122.0827772697085\n }\n },\n \"formattedAddress\": \"1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA\",\n ...\n}\n```\n\nConstruct your field masks using the hierarchy of the response fields, in the\nform: \n\n```text\ntopLevelField[.secondLevelField][.thirdLevelField][...]\n```\n| **Note:** By default, the request returns all fields in the response object which is equivalent to specifying a field mask of \\*.\n\nFor example, to return only the `placeId` field in the response, use a field\nmask of: \n\n```\ncurl -X GET -H 'Content-Type: application/json' \\\n-H 'X-Goog-FieldMask: results.placeId' \\\n-H \"X-Goog-Api-Key: API_KEY\" \\\n\"https://\"geocode.googleapis.com/v4beta/\"geocode/address/1600+Amphitheatre+Parkway,+Mountain+View,+CA\"\n```\n\nThe response is now: \n\n```json\n{\n \"results\": [\n {\n \"placeId\": \"ChIJF4Yf2Ry7j4AR__1AkytDyAE\"\n }\n ]\n}\n```\n\nTo return the `viewport` field, your field mask is: \n\n```text\n-H 'X-Goog-FieldMask: results.viewport'\n```\n\nThe response is now: \n\n```json\n{\n \"results\": [\n {\n \"viewport\": {\n \"low\": {\n \"latitude\": 37.420654569708496,\n \"longitude\": -122.08547618029148\n },\n \"high\": {\n \"latitude\": 37.423352530291496,\n \"longitude\": -122.0827782197085\n }\n }\n }\n ]\n}\n```\n\nTo return both: \n\n```text\n-H 'X-Goog-FieldMask: results.placeId,results.viewport'\n```\n\nThe response is now: \n\n```json\n{\n \"results\": [\n {\n \"placeId\": \"ChIJF4Yf2Ry7j4AR__1AkytDyAE\",\n \"viewport\": {\n \"low\": {\n \"latitude\": 37.420654569708496,\n \"longitude\": -122.08547618029148\n },\n \"high\": {\n \"latitude\": 37.423352530291496,\n \"longitude\": -122.0827782197085\n }\n }\n }\n ]\n}\n```\n\ngRPC field masks\n----------------\n\nFor gRPC, set a variable containing the response field mask. You can then pass\nthat variable to the request. \n\n```gdscript\nconst (\n fieldMask = \"results.placeId,results.viewport\"\n)\n```\n\nField path considerations\n-------------------------\n\nInclude only the fields that you require in the response to return just the\nfields that you need:\n\n- **Decreases processing times**, so your results are returned with a lower latency.\n- **Ensures stable latency performance**. If you select all fields, or if you select all fields at the top level, you might experience performance degradation when new fields are added and then are automatically included in your response.\n- **Results in a smaller response size**, which translates into higher network throughput.\n\nFor more details on constructing a field mask, see the\n[field_mask.proto](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/field_mask.proto)."]]