{"id":864,"date":"2023-11-03T01:41:49","date_gmt":"2023-10-28T01:15:34","guid":{"rendered":"https:\/\/www.silicloud.com\/ja\/blog\/index.php\/2023\/11\/30\/google-places-api-web-service%e3%81%ae%e4%be%8b\/"},"modified":"2025-08-01T03:07:00","modified_gmt":"2025-07-31T18:07:00","slug":"google-places-api-web-service%e3%81%ae%e4%be%8b","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service%e3%81%ae%e4%be%8b\/","title":{"rendered":"Google Places API Web Service\u306e\u4f8b"},"content":{"rendered":"<p>Google Places API\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u8fd1\u304f\u306e\u5834\u6240\u3092\u898b\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u79c1\u305f\u3061\u306e\u9078\u629e\u3057\u305f\u8fd1\u304f\u306e\u5834\u6240\u3092\u8868\u793a\u3057\u3001\u73fe\u5728\u5730\u304b\u3089\u306e\u304a\u304a\u3088\u305d\u306e\u8ddd\u96e2\u3068\u6642\u9593\u3092\u8868\u793a\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3057\u307e\u3059\u3002\u3053\u306e\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001Google Places API\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u3068Distance Matrix API\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<h2>Google Places API \u3092\u65e5\u672c\u8a9e\u3067\u8a00\u3044\u63db\u3048\u308b\u3068\u3001\u300c\u30b0\u30fc\u30b0\u30eb \u30d7\u30ec\u30a4\u30b9 API\u300d\u3067\u3059\u3002<\/h2>\n<p>Google Places API Web Service\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u5834\u6240\u306e\u7a2e\u985e\u3084\u73fe\u5728\u306e\u55b6\u696d\u6642\u9593\u306a\u3069\u306e\u3044\u304f\u3064\u304b\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u57fa\u3065\u3044\u3066\u5834\u6240\u3092\u30af\u30a8\u30ea\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u8fd1\u304f\u306e\u5834\u6240\u3092\u691c\u7d22\u3059\u308b\u30ea\u30af\u30a8\u30b9\u30c8\u306f\u3001\u4ee5\u4e0b\u306e\u5f62\u5f0f\u306eHTTP URL\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>https:\/\/maps.googleapis.com\/maps\/api\/place\/nearbysearch\/output?parameters\r\n<\/code><\/pre>\n<p>JSON\u306f\u63a8\u5968\u3055\u308c\u308b\u51fa\u529b\u5f62\u5f0f\u3067\u3042\u308a\u3001\u3082\u30461\u3064\u306fXML\u3067\u3059\u3002\u5fc5\u8981\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30ad\u30fc\uff08API\u30ad\u30fc\uff09<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u5834\u6240<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>rankby = \u8ddd\u96e2\u307e\u305f\u306f\u534a\u5f84\uff1a\u7247\u65b9\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u3082\u3046\u7247\u65b9\u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002<\/ol>\n<p>\u6ce8\u610f\uff1arankby=distance\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001\u6b21\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306e\u3044\u305a\u308c\u304b\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u540d\u524d: \u30de\u30af\u30c9\u30ca\u30eb\u30c9\u3001KFC\u306a\u3069\u306e\u5024\u304c\u5165\u308a\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30bf\u30a4\u30d7: \u30ec\u30b9\u30c8\u30e9\u30f3\u3001\u30ab\u30d5\u30a7\u306a\u3069\u306e\u5024\u304c\u5165\u308a\u307e\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\u30ad\u30fc\u30ef\u30fc\u30c9<\/ol>\n<p>\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u306f\u3001opennow\u3084pagetoken\u306a\u3069\u304c\u3042\u308a\u307e\u3059\u3002\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001\u3053\u306e\u30da\u30fc\u30b8\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>\u30b0\u30fc\u30b0\u30eb\u306e\u30c7\u30a3\u30b9\u30bf\u30f3\u30b9\u30de\u30c8\u30ea\u30af\u30b9API<\/h3>\n<p>Distance Matrix API\u306f\u30012\u3064\u4ee5\u4e0a\u306e\u5730\u70b9\u9593\u306e\u8ddd\u96e2\u3068\u6240\u8981\u6642\u9593\u3092\u8a08\u7b97\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002Distance Matrix API\u306eURL\u306f\u6b21\u306e\u5f62\u5f0f\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>https:\/\/maps.googleapis.com\/maps\/api\/distancematrix\/outputFormat?parameters\r\n<\/code><\/pre>\n<p>\u5fc5\u8981\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u3001\u51fa\u767a\u5730\u70b9\uff08origins\uff09\u3001\u76ee\u7684\u5730\uff08destinations\uff09\u3001\u304a\u3088\u3073\u30ad\u30fc\uff08key\uff09\u3067\u3059\u3002\u51fa\u767a\u5730\u70b9\u306f\u3001\u65c5\u884c\u8ddd\u96e2\u3068\u6240\u8981\u6642\u9593\u3092\u8a08\u7b97\u3059\u308b\u305f\u3081\u306e\u51fa\u767a\u5730\u70b9\u3092\u542b\u3093\u3067\u3044\u307e\u3059\u3002\u30d1\u30a4\u30d7\u30e9\u30a4\u30f3\uff08|\uff09\u3067\u533a\u5207\u3089\u308c\u305f\u8907\u6570\u306e\u5ea7\u6a19\u30bb\u30c3\u30c8\u3092\u6e21\u3059\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002\u307e\u305f\u3001\u5ea7\u6a19\u306e\u4ee3\u308f\u308a\u306b\u4f4f\u6240\u3084\u5834\u6240\u306eID\u3092\u6e21\u3059\u3053\u3068\u3082\u3067\u304d\u3001\u30b5\u30fc\u30d3\u30b9\u304c\u81ea\u52d5\u7684\u306b\u7def\u5ea6\u7d4c\u5ea6\u5ea7\u6a19\u306b\u5909\u63db\u3057\u3066\u8ddd\u96e2\u3068\u6240\u8981\u6642\u9593\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>https:\/\/maps.googleapis.com\/maps\/api\/distancematrix\/json?origins=Washington,DC&amp;destinations=New+York+City,NY&amp;key=YOUR_API_KEY\r\n<\/code><\/pre>\n<p>\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\u30e2\u30fc\u30c9\uff1a\u904b\u8ee2\u3001\u81ea\u8ee2\u8eca\u3001\u6b69\u884c\u3001\u516c\u5171\u4ea4\u901a\u306e\u3046\u3061\u306e1\u3064\u306e\u5024\u304c\u5fc5\u8981\u3067\u3059\u3002<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\u56de\u907f\uff1a\u6599\u91d1\u3084\u5ba4\u5185\u306a\u3069\u306e\u5236\u9650\u3092\u7d4c\u8def\u306b\u5c0e\u5165\u3057\u307e\u3059\u3002<\/ol>\n<p>\u8a73\u7d30\u306f\u3053\u306e\u30da\u30fc\u30b8\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h3>API\u30ad\u30fc\u3092\u6709\u52b9\u306b\u3059\u308b\u3002<\/h3>\n<p>https:\/\/console.developers.google.com\/ \u306b\u30a2\u30af\u30bb\u30b9\u3057\u3001\u6b21\u306eAPI\u3092\u6709\u52b9\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>Google \u30de\u30c3\u30d7\u306e\u8ddd\u96e2\u884c\u5217API<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>Google \u30d7\u30ec\u30a4\u30b9API\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9<\/ol>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<ol>Google \u30d7\u30ec\u30a4\u30b9API for Android<\/ol>\n<p>\u8cc7\u683c\u60c5\u5831\u306b\u79fb\u52d5\u3057\u3066\u3001\u65b0\u3057\u3044\u30ad\u30fc\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3068\u308a\u3042\u3048\u305a\u30ad\u30fc\u306e\u5236\u9650\u3092\u7121\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306e\u672c\u984c\u306b\u5165\u308a\u307e\u3057\u3087\u3046\u3002\u73fe\u5728\u306e\u4f4d\u7f6e\u60c5\u5831\u3092\u57fa\u306b\u8fd1\u304f\u306e\u5834\u6240\u3092\u691c\u7d22\u3057\u3001\u305d\u308c\u3089\u306e\u5834\u6240\u3092RecyclerView\u306b\u8868\u793a\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3057\u307e\u3059\u3002EditText\u306b\u5165\u529b\u3055\u308c\u308b\u30bf\u30a4\u30d7\u3068\u540d\u524d\u306e\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u57fa\u306b\u5834\u6240\u3092\u691c\u7d22\u3057\u307e\u3059\u3002\u30ad\u30fc\u30ef\u30fc\u30c9\u306f\u30b9\u30da\u30fc\u30b9\u3067\u533a\u5207\u308a\u307e\u3059\u3002\u4f8b\uff1a\u30ec\u30b9\u30c8\u30e9\u30f3 \u30c9\u30df\u30ce\u30d4\u30b6\u3001\u30ab\u30d5\u30a7 \u30d9\u30b8\u30bf\u30ea\u30a2\u30f3<\/p>\n<h3>Google Places API\u306e\u4f8b\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u69cb\u9020<\/h3>\n<p>\u3053\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f\u3001\u5358\u4e00\u306e\u30a2\u30af\u30c6\u30a3\u30d3\u30c6\u30a3\u3067\u69cb\u6210\u3055\u308c\u307e\u3059\u3002RecyclerView\u306e\u305f\u3081\u306e\u30a2\u30c0\u30d7\u30bf\u30fc\u30af\u30e9\u30b9\u3002\u5404RecyclerView\u884c\u306e\u30c7\u30fc\u30bf\u3092\u4fdd\u6301\u3059\u308b\u30e2\u30c7\u30eb\u30af\u30e9\u30b9\u3002Google Places API\u304a\u3088\u3073Distance Matrix API\u304b\u3089\u306eJSON\u30ec\u30b9\u30dd\u30f3\u30b9\u3092Gson\u306b\u5909\u63db\u3059\u308b\u305f\u3081\u306e2\u3064\u306ePOJO\u30af\u30e9\u30b9\u3002Retrofit\u3068\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306eAPIClient\u3068ApiInterface\u3002<\/p>\n<h3>Google Places API\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<\/h3>\n<p>build.gradle\u30d5\u30a1\u30a4\u30eb\u5185\u306b\u3001\u4ee5\u4e0b\u306e\u4f9d\u5b58\u95a2\u4fc2\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre class=\"post-pre\"><code>compile 'com.google.android.gms:play-services-location:10.2.1'\r\n    compile 'com.google.android.gms:play-services-places:10.2.1'\r\n    compile 'com.google.code.gson:gson:2.7'\r\n    compile 'com.squareup.retrofit2:retrofit:2.1.0'\r\n    compile 'com.squareup.retrofit2:converter-gson:2.1.0'\r\n    compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'\r\n    compile 'com.squareup.okhttp3:okhttps:3.4.1'\r\n    compile 'io.nlopez.smartlocation:library:3.3.1'\r\n    compile 'com.android.support:cardview-v7:25.3.0'\r\n    compile 'com.android.support:recyclerview-v7:25.3.0'\r\n<\/code><\/pre>\n<p>\u300cio.nlopez.smartlocation:library:3.3.1\u300d\u306f\u3001\u30dc\u30a4\u30e9\u30fc\u30d7\u30ec\u30fc\u30c8\u30b3\u30fc\u30c9\u3092\u6e1b\u3089\u3059LocationTracking\u30b5\u30fc\u30c9\u30d1\u30fc\u30c6\u30a3\u30fc\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002\u4ee5\u4e0b\u306bAPIClient.java\u306e\u30b3\u30fc\u30c9\u304c\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.nearbyplaces;\r\n\r\nimport java.util.concurrent.TimeUnit;\r\nimport okhttp3.OkHttpClient;\r\nimport okhttp3.logging.HttpLoggingInterceptor;\r\nimport retrofit2.Retrofit;\r\nimport retrofit2.converter.gson.GsonConverterFactory;\r\n\r\npublic class APIClient {\r\n\r\n    private static Retrofit retrofit = null;\r\n\r\n    public static final String GOOGLE_PLACE_API_KEY = \"ADD_YOUR_API_KEY_HERE\";\r\n\r\n    public static String base_url = \"https:\/\/maps.googleapis.com\/maps\/api\/\";\r\n\r\n    public static Retrofit getClient() {\r\n\r\n        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();\r\n        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);\r\n        OkHttpClient client = new OkHttpClient.Builder().readTimeout(30, TimeUnit.SECONDS).writeTimeout(30, TimeUnit.SECONDS).addInterceptor(interceptor).build();\r\n\r\n\r\n        retrofit = null;\r\n\r\n        retrofit = new Retrofit.Builder()\r\n                .baseUrl(base_url)\r\n                .addConverterFactory(GsonConverterFactory.create())\r\n                .client(client)\r\n                .build();\r\n\r\n\r\n        return retrofit;\r\n    }\r\n\r\n}\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306bApiInterface.java\u306e\u30b3\u30fc\u30c9\u304c\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.nearbyplaces;\r\n\r\nimport retrofit2.Call;\r\nimport retrofit2.http.GET;\r\nimport retrofit2.http.Query;\r\n\r\npublic interface ApiInterface {\r\n\r\n    @GET(\"place\/nearbysearch\/json?\")\r\n    Call&lt;PlacesPOJO.Root&gt; doPlaces(@Query(value = \"type\", encoded = true) String type, @Query(value = \"location\", encoded = true) String location, @Query(value = \"name\", encoded = true) String name, @Query(value = \"opennow\", encoded = true) boolean opennow, @Query(value = \"rankby\", encoded = true) String rankby, @Query(value = \"key\", encoded = true) String key);\r\n\r\n\r\n    @GET(\"distancematrix\/json\") \/\/ origins\/destinations:  LatLng as string\r\n    Call&lt;ResultDistanceMatrix&gt; getDistance(@Query(\"key\") String key, @Query(\"origins\") String origins, @Query(\"destinations\") String destinations);\r\n}\r\n<\/code><\/pre>\n<p>PlacesPOJO.java\u306fPlaces API\u304b\u3089\u306e\u5fdc\u7b54\u3092\u4fdd\u6301\u3059\u308b\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002\u4ee5\u4e0b\u306b\u305d\u306e\u30b3\u30fc\u30c9\u304c\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.nearbyplaces;\r\n\r\nimport com.google.gson.annotations.SerializedName;\r\nimport java.io.Serializable;\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\npublic class PlacesPOJO {\r\n\r\n    public class Root implements Serializable {\r\n\r\n        @SerializedName(\"results\")\r\n        public List&lt;CustomA&gt; customA = new ArrayList&lt;&gt;();\r\n        @SerializedName(\"status\")\r\n        public String status;\r\n    }\r\n\r\n    public class CustomA implements Serializable {\r\n\r\n\r\n        @SerializedName(\"geometry\")\r\n        public Geometry geometry;\r\n        @SerializedName(\"vicinity\")\r\n        public String vicinity;\r\n        @SerializedName(\"name\")\r\n        public String name;\r\n\r\n    }\r\n\r\n    public class Geometry implements Serializable{\r\n\r\n        @SerializedName(\"location\")\r\n        public LocationA locationA;\r\n\r\n    }\r\n\r\n    public class LocationA implements Serializable {\r\n\r\n        @SerializedName(\"lat\")\r\n        public String lat;\r\n        @SerializedName(\"lng\")\r\n        public String lng;\r\n\r\n\r\n    }\r\n\r\n\r\n\r\n}\r\n<\/code><\/pre>\n<p>ResultDistanceMatrix.java\u30af\u30e9\u30b9\u306f\u3001Distance Matrix API\u304b\u3089\u306e\u5fdc\u7b54\u3092\u4fdd\u6301\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306b\u305d\u306e\u30b3\u30fc\u30c9\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.nearbyplaces;\r\n\r\nimport com.google.gson.annotations.SerializedName;\r\n\r\nimport java.util.List;\r\n\r\npublic class ResultDistanceMatrix {\r\n    @SerializedName(\"status\")\r\n    public String status;\r\n\r\n    @SerializedName(\"rows\")\r\n    public List&lt;InfoDistanceMatrix&gt; rows;\r\n\r\n    public class InfoDistanceMatrix {\r\n        @SerializedName(\"elements\")\r\n        public List elements;\r\n\r\n        public class DistanceElement {\r\n            @SerializedName(\"status\")\r\n            public String status;\r\n            @SerializedName(\"duration\")\r\n            public ValueItem duration;\r\n            @SerializedName(\"distance\")\r\n            public ValueItem distance;\r\n\r\n\r\n        }\r\n\r\n        public class ValueItem {\r\n            @SerializedName(\"value\")\r\n            public long value;\r\n            @SerializedName(\"text\")\r\n            public String text;\r\n\r\n        }\r\n    }\r\n}\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306bactivity_main.xml\u30d5\u30a1\u30a4\u30eb\u304c\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;RelativeLayout xmlns:android=\"https:\/\/schemas.android.com\/apk\/res\/android\"\r\n    xmlns:tools=\"https:\/\/schemas.android.com\/tools\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    android:background=\"#212121\"\r\n    tools:context=\"com.scdev.nearbyplaces.MainActivity\"&gt;\r\n\r\n\r\n    &lt;EditText\r\n        android:id=\"@+id\/editText\"\r\n        android:layout_width=\"match_parent\"\r\n        android:textColor=\"@android:color\/white\"\r\n        android:textColorHint=\"@android:color\/white\"\r\n        android:text=\"restaurant mcdonalds\"\r\n        android:hint=\"type name\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_alignParentTop=\"true\"\r\n        android:layout_toLeftOf=\"@+id\/button\"\r\n        android:layout_toStartOf=\"@+id\/button\" \/&gt;\r\n\r\n    &lt;Button\r\n        android:id=\"@+id\/button\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_alignParentEnd=\"true\"\r\n        android:layout_alignParentRight=\"true\"\r\n        android:text=\"Search\" \/&gt;\r\n\r\n\r\n    &lt;android.support.v7.widget.RecyclerView\r\n        android:id=\"@+id\/recyclerView\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"match_parent\"\r\n        android:layout_below=\"@+id\/editText\"\r\n        android:scrollbars=\"vertical\" \/&gt;\r\n\r\n&lt;\/RelativeLayout&gt;\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306bMainActivity.java\u30af\u30e9\u30b9\u306e\u30b3\u30fc\u30c9\u304c\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.nearbyplaces;\r\n\r\nimport android.annotation.TargetApi;\r\nimport android.content.DialogInterface;\r\nimport android.content.pm.PackageManager;\r\nimport android.location.Location;\r\nimport android.os.Build;\r\nimport android.support.v7.app.AlertDialog;\r\nimport android.support.v7.app.AppCompatActivity;\r\nimport android.os.Bundle;\r\nimport android.support.v7.widget.LinearLayoutManager;\r\nimport android.support.v7.widget.RecyclerView;\r\nimport android.view.View;\r\nimport android.widget.Button;\r\nimport android.widget.EditText;\r\nimport android.widget.Toast;\r\nimport com.google.android.gms.maps.model.LatLng;\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\nimport io.nlopez.smartlocation.OnLocationUpdatedListener;\r\nimport io.nlopez.smartlocation.SmartLocation;\r\nimport retrofit2.Call;\r\nimport retrofit2.Callback;\r\nimport retrofit2.Response;\r\n\r\nimport static android.Manifest.permission.ACCESS_COARSE_LOCATION;\r\nimport static android.Manifest.permission.ACCESS_FINE_LOCATION;\r\n\r\npublic class MainActivity extends AppCompatActivity {\r\n\r\n\r\n    private ArrayList&lt;String&gt; permissionsToRequest;\r\n    private ArrayList&lt;String&gt; permissionsRejected = new ArrayList&lt;&gt;();\r\n    private ArrayList&lt;String&gt; permissions = new ArrayList&lt;&gt;();\r\n    private final static int ALL_PERMISSIONS_RESULT = 101;\r\n    List&lt;StoreModel&gt; storeModels;\r\n    ApiInterface apiService;\r\n\r\n    String latLngString;\r\n    LatLng latLng;\r\n\r\n    RecyclerView recyclerView;\r\n    EditText editText;\r\n    Button button;\r\n    List&lt;PlacesPOJO.CustomA&gt; results;\r\n\r\n    @Override\r\n    protected void onCreate(Bundle savedInstanceState) {\r\n        super.onCreate(savedInstanceState);\r\n        setContentView(R.layout.activity_main);\r\n\r\n        permissions.add(ACCESS_FINE_LOCATION);\r\n        permissions.add(ACCESS_COARSE_LOCATION);\r\n\r\n        permissionsToRequest = findUnAskedPermissions(permissions);\r\n\r\n\r\n        if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {\r\n\r\n\r\n            if (permissionsToRequest.size() &gt; 0)\r\n                requestPermissions(permissionsToRequest.toArray(new String[permissionsToRequest.size()]), ALL_PERMISSIONS_RESULT);\r\n            else {\r\n                fetchLocation();\r\n            }\r\n        } else {\r\n            fetchLocation();\r\n        }\r\n\r\n\r\n        apiService = APIClient.getClient().create(ApiInterface.class);\r\n\r\n        recyclerView = (RecyclerView) findViewById(R.id.recyclerView);\r\n\r\n        recyclerView.setNestedScrollingEnabled(false);\r\n        recyclerView.setHasFixedSize(true);\r\n\r\n        LinearLayoutManager layoutManager = new LinearLayoutManager(this);\r\n        recyclerView.setLayoutManager(layoutManager);\r\n\r\n        editText = (EditText) findViewById(R.id.editText);\r\n        button = (Button) findViewById(R.id.button);\r\n\r\n\r\n        button.setOnClickListener(new View.OnClickListener() {\r\n            @Override\r\n            public void onClick(View v) {\r\n                String s = editText.getText().toString().trim();\r\n                String[] split = s.split(\"\\\\s+\");\r\n\r\n\r\n                if (split.length != 2) {\r\n                    Toast.makeText(getApplicationContext(), \"Please enter text in the required format\", Toast.LENGTH_SHORT).show();\r\n                } else\r\n                    fetchStores(split[0], split[1]);\r\n            }\r\n        });\r\n\r\n    }\r\n\r\n    private void fetchStores(String placeType, String businessName) {\r\n\r\n        \/**\r\n         * For Locations In India McDonalds stores aren't returned accurately\r\n         *\/\r\n\r\n        \/\/Call&lt;PlacesPOJO.Root&gt; call = apiService.doPlaces(placeType, latLngString,\"\\\"\"+ businessName +\"\\\"\", true, \"distance\", APIClient.GOOGLE_PLACE_API_KEY);\r\n\r\n        Call&lt;PlacesPOJO.Root&gt; call = apiService.doPlaces(placeType, latLngString, businessName, true, \"distance\", APIClient.GOOGLE_PLACE_API_KEY);\r\n        call.enqueue(new Callback&lt;PlacesPOJO.Root&gt;() {\r\n            @Override\r\n            public void onResponse(Call&lt;PlacesPOJO.Root&gt; call, Response&lt;PlacesPOJO.Root&gt; response) {\r\n                PlacesPOJO.Root root = response.body();\r\n\r\n\r\n                if (response.isSuccessful()) {\r\n\r\n                    if (root.status.equals(\"OK\")) {\r\n\r\n                        results = root.customA;\r\n                        storeModels = new ArrayList&lt;&gt;();\r\n                        for (int i = 0; i &lt; results.size(); i++) {\r\n\r\n                            if (i == 10)\r\n                                break;\r\n                            PlacesPOJO.CustomA info = results.get(i);\r\n\r\n\r\n                            fetchDistance(info);\r\n\r\n                        }\r\n\r\n                    } else {\r\n                        Toast.makeText(getApplicationContext(), \"No matches found near you\", Toast.LENGTH_SHORT).show();\r\n                    }\r\n\r\n                } else if (response.code() != 200) {\r\n                    Toast.makeText(getApplicationContext(), \"Error \" + response.code() + \" found.\", Toast.LENGTH_SHORT).show();\r\n                }\r\n\r\n\r\n            }\r\n\r\n            @Override\r\n            public void onFailure(Call&lt;PlacesPOJO.Root&gt; call, Throwable t) {\r\n                \/\/ Log error here since request failed\r\n                call.cancel();\r\n            }\r\n        });\r\n\r\n\r\n    }\r\n\r\n    private ArrayList&lt;String&gt; findUnAskedPermissions(ArrayList&lt;String&gt; wanted) {\r\n        ArrayList&lt;String&gt; result = new ArrayList&lt;&gt;();\r\n\r\n        for (String perm : wanted) {\r\n            if (!hasPermission(perm)) {\r\n                result.add(perm);\r\n            }\r\n        }\r\n\r\n        return result;\r\n    }\r\n\r\n    private boolean hasPermission(String permission) {\r\n        if (canMakeSmores()) {\r\n            if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {\r\n                return (checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED);\r\n            }\r\n        }\r\n        return true;\r\n    }\r\n\r\n    private boolean canMakeSmores() {\r\n        return (Build.VERSION.SDK_INT &gt; Build.VERSION_CODES.LOLLIPOP_MR1);\r\n    }\r\n\r\n\r\n    @TargetApi(Build.VERSION_CODES.M)\r\n    @Override\r\n    public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {\r\n\r\n        switch (requestCode) {\r\n\r\n            case ALL_PERMISSIONS_RESULT:\r\n                for (String perms : permissionsToRequest) {\r\n                    if (!hasPermission(perms)) {\r\n                        permissionsRejected.add(perms);\r\n                    }\r\n                }\r\n\r\n                if (permissionsRejected.size() &gt; 0) {\r\n\r\n\r\n                    if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {\r\n                        if (shouldShowRequestPermissionRationale(permissionsRejected.get(0))) {\r\n                            showMessageOKCancel(\"These permissions are mandatory for the application. Please allow access.\",\r\n                                    new DialogInterface.OnClickListener() {\r\n                                        @Override\r\n                                        public void onClick(DialogInterface dialog, int which) {\r\n                                            if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {\r\n                                                requestPermissions(permissionsRejected.toArray(new String[permissionsRejected.size()]), ALL_PERMISSIONS_RESULT);\r\n                                            }\r\n                                        }\r\n                                    });\r\n                            return;\r\n                        }\r\n                    }\r\n\r\n                } else {\r\n                    fetchLocation();\r\n                }\r\n\r\n                break;\r\n        }\r\n\r\n    }\r\n\r\n    private void showMessageOKCancel(String message, DialogInterface.OnClickListener okListener) {\r\n        new AlertDialog.Builder(MainActivity.this)\r\n                .setMessage(message)\r\n                .setPositiveButton(\"OK\", okListener)\r\n                .setNegativeButton(\"Cancel\", null)\r\n                .create()\r\n                .show();\r\n    }\r\n\r\n    private void fetchLocation() {\r\n\r\n        SmartLocation.with(this).location()\r\n                .oneFix()\r\n                .start(new OnLocationUpdatedListener() {\r\n                    @Override\r\n                    public void onLocationUpdated(Location location) {\r\n                        latLngString = location.getLatitude() + \",\" + location.getLongitude();\r\n                        latLng = new LatLng(location.getLatitude(), location.getLongitude());\r\n                    }\r\n                });\r\n    }\r\n\r\n    private void fetchDistance(final PlacesPOJO.CustomA info) {\r\n\r\n        Call&lt;ResultDistanceMatrix&gt; call = apiService.getDistance(APIClient.GOOGLE_PLACE_API_KEY, latLngString, info.geometry.locationA.lat + \",\" + info.geometry.locationA.lng);\r\n        call.enqueue(new Callback&lt;ResultDistanceMatrix&gt;() {\r\n            @Override\r\n            public void onResponse(Call&lt;ResultDistanceMatrix&gt; call, Response&lt;ResultDistanceMatrix&gt; response) {\r\n\r\n                ResultDistanceMatrix resultDistance = response.body();\r\n                if (\"OK\".equalsIgnoreCase(resultDistance.status)) {\r\n\r\n                    ResultDistanceMatrix.InfoDistanceMatrix infoDistanceMatrix = resultDistance.rows.get(0);\r\n                    ResultDistanceMatrix.InfoDistanceMatrix.DistanceElement distanceElement = infoDistanceMatrix.elements.get(0);\r\n                    if (\"OK\".equalsIgnoreCase(distanceElement.status)) {\r\n                        ResultDistanceMatrix.InfoDistanceMatrix.ValueItem itemDuration = distanceElement.duration;\r\n                        ResultDistanceMatrix.InfoDistanceMatrix.ValueItem itemDistance = distanceElement.distance;\r\n                        String totalDistance = String.valueOf(itemDistance.text);\r\n                        String totalDuration = String.valueOf(itemDuration.text);\r\n\r\n                        storeModels.add(new StoreModel(info.name, info.vicinity, totalDistance, totalDuration));\r\n\r\n\r\n                        if (storeModels.size() == 10 || storeModels.size() == results.size()) {\r\n                            RecyclerViewAdapter adapterStores = new RecyclerViewAdapter(results, storeModels);\r\n                            recyclerView.setAdapter(adapterStores);\r\n                        }\r\n\r\n                    }\r\n\r\n                }\r\n\r\n            }\r\n\r\n            @Override\r\n            public void onFailure(Call&lt;ResultDistanceMatrix&gt; call, Throwable t) {\r\n                call.cancel();\r\n            }\r\n        });\r\n\r\n    }\r\n}\r\n\r\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001\u307e\u305a\u30e9\u30f3\u30bf\u30a4\u30e0\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u8981\u6c42\u3057\u3001SmartLocation\u30e9\u30a4\u30d6\u30e9\u30ea\u3092\u4f7f\u7528\u3057\u3066\u73fe\u5728\u306e\u4f4d\u7f6e\u60c5\u5831\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\u4f4d\u7f6e\u60c5\u5831\u3092\u53d6\u5f97\u3057\u305f\u3089\u3001EditText\u306e\u6700\u521d\u306e\u5358\u8a9e\u3092type\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u30012\u756a\u76ee\u306e\u5358\u8a9e\u3092name\u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u3068\u3057\u3066fetchStores()\u30e1\u30bd\u30c3\u30c9\u306b\u6e21\u3057\u3001\u6700\u7d42\u7684\u306bGoogle Places API\u30a6\u30a7\u30d6\u30b5\u30fc\u30d3\u30b9\u3092\u547c\u3073\u51fa\u3057\u307e\u3059\u3002\u691c\u7d22\u7d50\u679c\u306f10\u4ef6\u306b\u5236\u9650\u3055\u308c\u307e\u3059\u3002\u5404\u7d50\u679c\u306b\u3064\u3044\u3066\u3001fetchDistance()\u30e1\u30bd\u30c3\u30c9\u5185\u3067\u5e97\u8217\u304b\u3089\u306e\u8ddd\u96e2\u3068\u6240\u8981\u6642\u9593\u3092\u8a08\u7b97\u3057\u307e\u3059\u3002\u3059\u3079\u3066\u306e\u5e97\u8217\u306b\u5bfe\u3057\u3066\u51e6\u7406\u304c\u5b8c\u4e86\u3057\u305f\u3089\u3001StoreModel.java\u30c7\u30fc\u30bf\u30af\u30e9\u30b9\u3092\u4f7f\u7528\u3057\u3066RecyclerViewAdapter.java\u30af\u30e9\u30b9\u306b\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002\u4ee5\u4e0b\u306bStoreModel.java\u306e\u30b3\u30fc\u30c9\u304c\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>package com.scdev.nearbyplaces;\r\n\r\npublic class StoreModel {\r\n\r\n\r\n    public String name, address, distance, duration;\r\n\r\n    public StoreModel(String name, String address, String distance, String duration) {\r\n\r\n        this.name = name;\r\n        this.address = address;\r\n        this.distance = distance;\r\n        this.duration = duration;\r\n    }\r\n\r\n}\r\n<\/code><\/pre>\n<p>RecyclerView\u306e\u5404\u884c\u306e\u30ec\u30a4\u30a2\u30a6\u30c8\u306f\u3001\u4ee5\u4e0b\u306exml\u306b\u793a\u3055\u308c\u3066\u3044\u307e\u3059\uff1astore_list_row.xml<\/p>\n<pre class=\"post-pre\"><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;LinearLayout xmlns:android=\"https:\/\/schemas.android.com\/apk\/res\/android\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"wrap_content\"\r\n    android:layout_marginBottom=\"@dimen\/activity_horizontal_margin\"\r\n    android:orientation=\"vertical\"&gt;\r\n\r\n    &lt;android.support.v7.widget.CardView xmlns:card_view=\"https:\/\/schemas.android.com\/apk\/res-auto\"\r\n        android:id=\"@+id\/card_view\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        card_view:cardCornerRadius=\"0dp\"\r\n        card_view:cardElevation=\"5dp\"&gt;\r\n\r\n\r\n        &lt;LinearLayout\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:orientation=\"vertical\"\r\n            android:padding=\"5dp\"&gt;\r\n\r\n            &lt;TextView\r\n                android:id=\"@+id\/txtStoreName\"\r\n                android:layout_width=\"wrap_content\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:paddingBottom=\"5dp\"\r\n                android:textColor=\"#212121\" \/&gt;\r\n\r\n            &lt;TextView\r\n                android:id=\"@+id\/txtStoreAddr\"\r\n                android:layout_width=\"wrap_content\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:paddingBottom=\"5dp\"\r\n                android:textColor=\"#212121\" \/&gt;\r\n\r\n            &lt;TextView\r\n                android:id=\"@+id\/txtStoreDist\"\r\n                android:layout_width=\"wrap_content\"\r\n                android:layout_height=\"wrap_content\"\r\n                android:paddingBottom=\"5dp\" \/&gt;\r\n\r\n\r\n        &lt;\/LinearLayout&gt;\r\n\r\n    &lt;\/android.support.v7.widget.CardView&gt;\r\n\r\n&lt;\/LinearLayout&gt;\r\n<\/code><\/pre>\n<p>\u4e0b\u8a18\u306bRecyclerViewAdapter.java\u306e\u30b3\u30fc\u30c9\u304c\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>public class RecyclerViewAdapter extends RecyclerView.Adapter&lt;RecyclerViewAdapter.MyViewHolder&gt; {\r\n\r\n\r\n    private List&lt;PlacesPOJO.CustomA&gt; stLstStores;\r\n    private List&lt;StoreModel&gt; models;\r\n\r\n\r\n    public RecyclerViewAdapter(List&lt;PlacesPOJO.CustomA&gt; stores, List&lt;StoreModel&gt; storeModels) {\r\n\r\n        stLstStores = stores;\r\n        models = storeModels;\r\n    }\r\n\r\n    @Override\r\n    public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {\r\n        final View view = LayoutInflater.from(parent.getContext())\r\n                .inflate(R.layout.store_list_row, parent, false);\r\n\r\n        return new MyViewHolder(view);\r\n    }\r\n\r\n    @Override\r\n    public void onBindViewHolder(MyViewHolder holder, int position) {\r\n\r\n        holder.setData(stLstStores.get(holder.getAdapterPosition()), holder, models.get(holder.getAdapterPosition()));\r\n    }\r\n\r\n\r\n    @Override\r\n    public int getItemCount() {\r\n        return Math.min(5, stLstStores.size());\r\n    }\r\n\r\n\r\n    public class MyViewHolder extends RecyclerView.ViewHolder {\r\n\r\n\r\n        TextView txtStoreName;\r\n        TextView txtStoreAddr;\r\n        TextView txtStoreDist;\r\n        StoreModel model;\r\n\r\n\r\n        public MyViewHolder(View itemView) {\r\n            super(itemView);\r\n\r\n            this.txtStoreDist = (TextView) itemView.findViewById(R.id.txtStoreDist);\r\n            this.txtStoreName = (TextView) itemView.findViewById(R.id.txtStoreName);\r\n            this.txtStoreAddr = (TextView) itemView.findViewById(R.id.txtStoreAddr);\r\n\r\n\r\n        }\r\n\r\n\r\n        public void setData(PlacesPOJO.CustomA info, MyViewHolder holder, StoreModel storeModel) {\r\n\r\n\r\n            this.model = storeModel;\r\n\r\n            holder.txtStoreDist.setText(model.distance + \"\\n\" + model.duration);\r\n            holder.txtStoreName.setText(info.name);\r\n            holder.txtStoreAddr.setText(info.vicinity);\r\n\r\n\r\n        }\r\n\r\n    }\r\n}\r\n\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306b\u3001Google Places API\u306e\u30b5\u30f3\u30d7\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u51fa\u529b\u304c\u793a\u3055\u308c\u307e\u3059\u3002\u6ce8\uff1a\u7279\u306b\u30a4\u30f3\u30c9\u306e\u5834\u6240\u306e\u30de\u30af\u30c9\u30ca\u30eb\u30c9\u3084\u4e00\u90e8\u306e\u30d5\u30fc\u30c9\u30c1\u30a7\u30fc\u30f3\u306b\u3064\u3044\u3066\u3001Places API\u306f\u6b63\u78ba\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u5bfe\u7b56\u306e1\u3064\u306f\u3001\u30d1\u30e9\u30e1\u30fc\u30bf\u540d\u306e\u5024\u3092\u4e8c\u91cd\u5f15\u7528\u7b26\u3067\u56f2\u3093\u3067\u6e21\u3059\u3053\u3068\u3067\u3059\u3002<\/p>\n<pre class=\"post-pre\"><code>Call call = apiService.doPlaces(placeType, latLngString,\"\\\"\"+ businessName +\"\\\"\", true, \"distance\", APIClient.GOOGLE_PLACE_API_KEY);\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u306f\u3001\u79c1\u306e\u5834\u6240\u306b\u5bfe\u3059\u308b\u51fa\u529b\u306e\u8868\u793a\u3067\u3059\u3002\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u306f\u3053\u3053\u3067\u7d42\u4e86\u3067\u3059\u3002\u6700\u7d42\u7684\u306aGoogle Places API\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306f\u3001\u4ee5\u4e0b\u306e\u30ea\u30f3\u30af\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Google Places API\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google Places API\u3092\u4f7f\u7528\u3059\u308b\u3068\u3001\u8fd1\u304f\u306e\u5834\u6240\u3092\u898b\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3053\u306e\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306f\u3001\u79c1\u305f\u3061\u306e\u9078\u629e\u3057\u305f\u8fd1\u304f\u306e\u5834\u6240\u3092\u8868\u793a\u3057\u3001\u73fe\u5728\u5730\u304b\u3089\u306e\u304a\u304a\u3088\u305d\u306e\u8ddd\u96e2\u3068\u6642\u9593\u3092\u8868\u793a\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u958b\u767a\u3057\u307e\u3059\u3002\u3053\u306e [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[26,61],"class_list":["post-864","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-26","tag-61"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Google Places API Web Service\u306e\u4f8b - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"Google Places API Web Service\u306e\u4f8b\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service\u306e\u4f8b\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Google Places API Web Service\u306e\u4f8b\" \/>\n<meta property=\"og:description\" content=\"Google Places API Web Service\u306e\u4f8b\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service\u306e\u4f8b\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-28T01:15:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-31T18:07:00+00:00\" \/>\n<meta name=\"author\" content=\"\u512a\u6597, \u671d\u967d\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u512a\u6597, \u671d\u967d\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"45\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service%e3%81%ae%e4%be%8b\/\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service%e3%81%ae%e4%be%8b\/\",\"name\":\"Google Places API Web Service\u306e\u4f8b - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\"},\"datePublished\":\"2023-10-28T01:15:34+00:00\",\"dateModified\":\"2025-07-31T18:07:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28\"},\"description\":\"Google Places API Web Service\u306e\u4f8b\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service%e3%81%ae%e4%be%8b\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service%e3%81%ae%e4%be%8b\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service%e3%81%ae%e4%be%8b\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/ja\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Google Places API Web Service\u306e\u4f8b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"ja\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28\",\"name\":\"\u512a\u6597, \u671d\u967d\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g\",\"caption\":\"\u512a\u6597, \u671d\u967d\"},\"url\":\"https:\/\/www.silicloud.com\/ja\/blog\/author\/yutoasahi\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service%e3%81%ae%e4%be%8b\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Google Places API Web Service\u306e\u4f8b - Blog - Silicon Cloud","description":"Google Places API Web Service\u306e\u4f8b\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service\u306e\u4f8b\/","og_locale":"ja_JP","og_type":"article","og_title":"Google Places API Web Service\u306e\u4f8b","og_description":"Google Places API Web Service\u306e\u4f8b\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","og_url":"https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service\u306e\u4f8b\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-10-28T01:15:34+00:00","article_modified_time":"2025-07-31T18:07:00+00:00","author":"\u512a\u6597, \u671d\u967d","twitter_card":"summary_large_image","twitter_misc":{"\u57f7\u7b46\u8005":"\u512a\u6597, \u671d\u967d","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"45\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service%e3%81%ae%e4%be%8b\/","url":"https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service%e3%81%ae%e4%be%8b\/","name":"Google Places API Web Service\u306e\u4f8b - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website"},"datePublished":"2023-10-28T01:15:34+00:00","dateModified":"2025-07-31T18:07:00+00:00","author":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28"},"description":"Google Places API Web Service\u306e\u4f8b\u3092\u5206\u304b\u308a\u3084\u3059\u304f\u89e3\u8aac\u3002\u5b9f\u8df5\u7684\u306a\u4f8b\u3068\u30b3\u30fc\u30c9\u3001\u6ce8\u610f\u70b9\u3092\u542b\u3081\u3066\u521d\u5fc3\u8005\u306b\u3082\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u8aac\u660e\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service%e3%81%ae%e4%be%8b\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service%e3%81%ae%e4%be%8b\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service%e3%81%ae%e4%be%8b\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/ja\/blog\/"},{"@type":"ListItem","position":2,"name":"Google Places API Web Service\u306e\u4f8b"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#website","url":"https:\/\/www.silicloud.com\/ja\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"ja"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/cab7534c71201607a41f395de14d7d28","name":"\u512a\u6597, \u671d\u967d","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/56ecb1d20648a2ff67709eeaa7b6eddeb4d52aca0d46febc7f12bbef507187d0?s=96&d=mm&r=g","caption":"\u512a\u6597, \u671d\u967d"},"url":"https:\/\/www.silicloud.com\/ja\/blog\/author\/yutoasahi\/"},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/www.silicloud.com\/ja\/blog\/google-places-api-web-service%e3%81%ae%e4%be%8b\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/comments?post=864"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/864\/revisions"}],"predecessor-version":[{"id":45972,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/posts\/864\/revisions\/45972"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/media?parent=864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/categories?post=864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/ja\/blog\/wp-json\/wp\/v2\/tags?post=864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}