{"id":1372,"date":"2023-07-19T14:55:13","date_gmt":"2023-07-19T14:55:13","guid":{"rendered":"https:\/\/mklasen.com\/?p=1372"},"modified":"2023-07-19T14:55:17","modified_gmt":"2023-07-19T14:55:17","slug":"only-return-zip-postal-codes-from-google-places-autocomplete-javascript-api","status":"publish","type":"post","link":"https:\/\/mklasen.com\/only-return-zip-postal-codes-from-google-places-autocomplete-javascript-api\/","title":{"rendered":"Only return zip\/postal codes from Google Places AutoComplete Javascript API"},"content":{"rendered":"\n
It’s been a while, and it took me a while to get Google Maps Places to return only zip codes, so I’ll share a little code snippet so that you can fix it within a quick search!<\/p>\n\n\n\n
const autocomplete = new google.maps.places.Autocomplete(deliveryCheck, {\n types: ['postal_code'],\n fields: ['address_components'],\n componentRestrictions: { country: \"us\" }\n });<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"It’s been a while, and it took me a while to get Google Maps Places to return only zip codes, so I’ll share a little code snippet so that you can fix it within a quick search!<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[1],"tags":[],"acf":[],"yoast_head":"\n
Only return zip\/postal codes from Google Places AutoComplete Javascript API - Marinus Klasen<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n\n\n\n\n\n\t\n\t\n\t\n