A Place Details response using the Google Places API only includes normal operating hours, not special hours. When you “download all locations” from the Google Business UI in CSV format, there is a row titled “special hours” with the data I want to retrieve. So I know it's there. See an example of this at the following published Google Sheet:
https://docs.google.com/spreadsheets/d/e/2PACX-1vR9lrELXbbiDw9QLeVEo-Ob6JH2hf5YuI2vRjQ9mPASMFfiXlLKPUSf98GkjN87h--y2f7DgVx0lFhE/pubhtml
Is it possible to retrieve “Special Hours” information from Google Business using the Google Places API Web Service or is this only possible by using the Google Business API?
A parameter titled "special hours" exists in the Google Business API Documentation.
//JSON example for a Place Details Response using Google Places API Web service
{
"html_attributions" : [],
"result" : {
"address_components" : [
{
"long_name" : "San Luis Obispo",
"short_name" : "San Luis Obispo",
"types" : [ "locality", "political" ]
},
{
"long_name" : "San Luis Obispo County",
"short_name" : "San Luis Obispo County",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "California",
"short_name" : "CA",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "United States",
"short_name" : "US",
"types" : [ "country", "political" ]
},
{
"long_name" : "93407",
"short_name" : "93407",
"types" : [ "postal_code" ]
}
],
"adr_address" : "Building 65, 1 Grande Ave, \u003cspan class=\"street-address\"\u003eCalifornia Polytechnic State University\u003c/span\u003e, \u003cspan class=\"locality\"\u003eSan Luis Obispo\u003c/span\u003e, \u003cspan class=\"region\"\u003eCA\u003c/span\u003e \u003cspan class=\"postal-code\"\u003e93407\u003c/span\u003e, \u003cspan class=\"country-name\"\u003eUSA\u003c/span\u003e",
"formatted_address" : "Building 65, 1 Grande Ave, California Polytechnic State University, San Luis Obispo, CA 93407, USA",
"formatted_phone_number" : "(805) 756-4089",
"geometry" : {
"location" : {
"lat" : 35.30001179999999,
"lng" : -120.6586874
}
},
"icon" : "https://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"id" : "f70e2b28dda6dbf04550b76db802f20fe1f79d5c",
"international_phone_number" : "+1 805-756-4089",
"name" : "Mustang Station",
"opening_hours" : {
"open_now" : false,
"periods" : [
{
"close" : {
"day" : 0,
"time" : "2300"
},
"open" : {
"day" : 0,
"time" : "1030"
}
},
{
"close" : {
"day" : 1,
"time" : "2300"
},
"open" : {
"day" : 1,
"time" : "1030"
}
},
{
"close" : {
"day" : 2,
"time" : "2300"
},
"open" : {
"day" : 2,
"time" : "1030"
}
},
{
"close" : {
"day" : 3,
"time" : "2300"
},
"open" : {
"day" : 3,
"time" : "1030"
}
},
{
"close" : {
"day" : 4,
"time" : "2300"
},
"open" : {
"day" : 4,
"time" : "1030"
}
},
{
"close" : {
"day" : 6,
"time" : "0000"
},
"open" : {
"day" : 5,
"time" : "1030"
}
},
{
"close" : {
"day" : 0,
"time" : "0000"
},
"open" : {
"day" : 6,
"time" : "1030"
}
}
],
"weekday_text" : [
"Monday: 10:30 AM – 11:00 PM",
"Tuesday: 10:30 AM – 11:00 PM",
"Wednesday: 10:30 AM – 11:00 PM",
"Thursday: 10:30 AM – 11:00 PM",
"Friday: 10:30 AM – 12:00 AM",
"Saturday: 10:30 AM – 12:00 AM",
"Sunday: 10:30 AM – 11:00 PM"
]
},
"photos" : [
{
"height" : 2340,
"html_attributions" : [
"\u003ca href=\"https://maps.google.com/maps/contrib/112622063888784238324/photos\"\u003eJana Isabel Gervacio\u003c/a\u003e"
],
"photo_reference" : "CoQBdwAAAGZsi0QehA7q1gTjAThJgTUtDSkkGaL4Xk_x01RkN6t8HfoABoLGl45Gpo_bznS4sI4OKag40IWiCsbq8J-naZ-9YwQ4iZ9H1YrFEBTMdlTWoxnW0uxpABT-2JKn6D7q38yQP5lznOlL7RmghoNxwbSvB6TDk45iwDLMSce-JBPcEhDLAcpTdUku3To8HxDhhszlGhRwBi5muKEn_68_MOAnjx0MLbSBJw",
"width" : 4160
},
{
"height" : 3840,
"html_attributions" : [
"\u003ca href=\"https://maps.google.com/maps/contrib/110980259514072024035/photos\"\u003eMustang Station\u003c/a\u003e"
],
"photo_reference" : "CoQBdwAAAB0VKDa1mNnEVRpWtjg8lbM3zONoyqai_LmUB41fP7FtprCairVIzw_QBpKix4ZNOn6swUgNf8C907X0bv8SnMktdacFV_aSy6sOFogdRPveXCBx84p2wrVH95GwTpk0lsNhzLovPuk9oZ39nH1U7XdP3LUfdNWQL2XCgUBqlkICEhDqaRdvjIG9gdp5gUWVfSAMGhRG75JyhhhqUxyZAU62IP_z-oMj7A",
"width" : 5760
},
{
"height" : 3456,
"html_attributions" : [
"\u003ca href=\"https://maps.google.com/maps/contrib/110980259514072024035/photos\"\u003eMustang Station\u003c/a\u003e"
],
"photo_reference" : "CoQBdwAAAEb9o0hItdL5eswLOgmJH9EOGNlqfWbjkcwhv9Aqk9yPbqAIhrTkeyun9r-G38kxcpO7QW3hD_MNtik07JAFhY2oY4fXuEeE1pKeAq7faNNytgQDCG37vh_LRqAVEaHa0bIAS22WKMFtOIquAviLkOyNQyT0_DCUXkd2E53OcRqdEhDfUVSCKsC1CHsMPAKv6VjNGhR6wXUF07Xe7KuZ52G1s_tCdGCG6Q",
"width" : 5184
},
{
"height" : 3840,
"html_attributions" : [
"\u003ca href=\"https://maps.google.com/maps/contrib/110980259514072024035/photos\"\u003eMustang Station\u003c/a\u003e"
],
"photo_reference" : "CoQBdwAAAHDbQqs7ehYjfkyARQxQq2PVWnIN6z6Enju8bnTmqUq4_UgDeAigezxyhv4b8QC7tT1F0O-OJuqZbhAqyTlXB1OYO_k0_Y7mk1114ah-BG8PUd84KnRD3CXh7G3wducvWrXtNZkFua-CoFdQG_q8050wUDST5tCWA1VeDvNjkw8pEhDs9E0GxCooxR0A6nn0_BkVGhT3Ub9zxr1PGVQFRV_TecWKzZmiYg",
"width" : 5760
},
{
"height" : 3456,
"html_attributions" : [
"\u003ca href=\"https://maps.google.com/maps/contrib/110980259514072024035/photos\"\u003eMustang Station\u003c/a\u003e"
],
"photo_reference" : "CoQBdwAAAP9OkyME0q72GrHkLPkjMoaauPmsYhZBD8wH1qBL_JAEGV8Dhz_6HJcUN_Y64ycfkKzk10COR52XmLerELpEYuxAYG3NHUcfF7Yq0GzEaFcNPIRWa4WgSsnAX5y16im6bvF_KZbW5iuDyX4ET6RW6bgTBwVH-zjAlZYmCI5GXpJ0EhDErfuy0lpX8LKAe8ipjC-BGhQqpZa7Y53HQBQvuIH37jORLeD0hQ",
"width" : 5184
},
{
"height" : 3840,
"html_attributions" : [
"\u003ca href=\"https://maps.google.com/maps/contrib/110980259514072024035/photos\"\u003eMustang Station\u003c/a\u003e"
],
"photo_reference" : "CoQBdwAAAEWy_E_dGD3N1ChEdeAzZoNP9mU0JhPEZY4QWf1I0XO73PWM8vmrTA0JjHFsm_qCf6XAmiVgJxPQTNtGTHwYghq7NL91bGYOEIvOLYl5iwxP_RC96zn5hCZnwwp1s4xkzouawNKp0oSCzwpfpUgCQrpplf35QLc1xGj3wsMbTcAbEhCUztajO_mhA0BLHk90mDxSGhRKOzWwFMx7Uhxvqh4afBaKSa6S9g",
"width" : 5760
},
{
"height" : 3000,
"html_attributions" : [
"\u003ca href=\"https://maps.google.com/maps/contrib/116558159141762616471/photos\"\u003ePatrick Chea\u003c/a\u003e"
],
"photo_reference" : "CoQBdwAAAGWjbZD71nwtfSTA3rRg93F-c_-EyicXxxA8vQ8DSX9hsvDOOCxy8gNUhXF5rDyShtcTm8Gh5qiCGg3xSvA5LDbJiXs7IpGAwAoVTb7_-d4DlNBX0jmkb8tGWdYNkqMo9jTtLr50BY9emgIljAHDaTBrzKlcrgi3Q2rSJM-WnUhaEhC4SwcYYd4Ce2upxRjP8taRGhSsvzcpFjR60jxDLxRlKzhgRIVzWA",
"width" : 4000
},
{
"height" : 800,
"html_attributions" : [
"\u003ca href=\"https://maps.google.com/maps/contrib/110980259514072024035/photos\"\u003eMustang Station\u003c/a\u003e"
],
"photo_reference" : "CoQBdwAAAEu4y0vjM28hn4yFnPz1qWQ0iYysDRPNfY0DiTHlmWMhLI1RfFlWctexo-Gw4iM51yDXo1f2C4eOvN5Gh50ZFfOsfuaLBptwzNYdm9wdBt6Hd5JjiUuEWlVLXo4pKz_62v3ohS2OZfdTJ6Wz5Fw44gVYyA_m9nX3fSCuPp8O2MkMEhCJVvjZOZouIyfIDKFkdg4XGhR8Tgj_y6Tibv548tyMmF5pjB_4VA",
"width" : 800
},
{
"height" : 3456,
"html_attributions" : [
"\u003ca href=\"https://maps.google.com/maps/contrib/110980259514072024035/photos\"\u003eMustang Station\u003c/a\u003e"
],
"photo_reference" : "CoQBdwAAAFG2hBYdpnJYG9DjvY1dnAus3YG89BeKGFx8--e0fwq8OPzCvbQVrXkyiB91KkjnMg8Oum11B4-fHVy6PkuXkat-T9r30PjKNs5KQJTYBWZ-U1SvdQoRx4auOdLzrgNNknVYtUD0fnf6L6MyaJajCvuRJxkd5fhmpM0-qYpwwp24EhCAm-eSSO2TX8lQYa1Vkl41GhR82nfX24T7EoP-xSVKjR-RV5KXYQ",
"width" : 3456
},
{
"height" : 5184,
"html_attributions" : [
"\u003ca href=\"https://maps.google.com/maps/contrib/110980259514072024035/photos\"\u003eMustang Station\u003c/a\u003e"
],
"photo_reference" : "CoQBdwAAALUHiKRI96TGd_7wEGmKlvU2j5WcWVl9B0jYBMBJsHyQLHHTROslXcW9dFTi_7aAK_yTcXOTwMoXJye301W6utyysncbDgPMfOru9YC5BTLpFOSpmpQButZ9Iw75MM8jgf5G-FWEtpnCSRSIAaTCg4yPpJWzdVMZyeFxOn7-wx7-EhAYF5iL9wN3hfqccpCq7DivGhR8mRQFqoyXjq6eUuaCLD2RUMj9LQ",
"width" : 3456
}
],
"place_id" : "ChIJi3n5orHx7IARQrPTx81AfZU",
"reference" : "CmRSAAAAwt8fxPAzOX-uQm83_KDcR1Yic89fu-ykEcK2vAJCKS6j1f4_KVCrhoOfQAX8bQd_vXS-k8fEhCQud8JjIhXZBYuIeq3UBfoxhf9zOClHJRi5pstBA21a_FTxP8eyXJ1bEhAMXM_iW_ZlS0LkpOss-b0bGhTVYEqAJEUmeSMUM41wf-1gUBKhCw",
"reviews" : [
{
"aspects" : [
{
"rating" : 2,
"type" : "overall"
}
],
"author_name" : "Spencer Shaw",
"author_url" : "https://www.google.com/maps/contrib/104561547095341505444/reviews",
"language" : "en",
"rating" : 4,
"text" : "",
"time" : 1476463293
},
{
"aspects" : [
{
"rating" : 3,
"type" : "overall"
}
],
"author_name" : "Joseph Pack",
"author_url" : "https://www.google.com/maps/contrib/105745544693109977233/reviews",
"language" : "en",
"profile_photo_url" : "//lh6.googleusercontent.com/-HJVfdTf8Kf0/AAAAAAAAAAI/AAAAAAAABo8/y8qAcuE4h7c/photo.jpg",
"rating" : 5,
"text" : "",
"time" : 1474354270
},
{
"aspects" : [
{
"rating" : 1,
"type" : "overall"
}
],
"author_name" : "Erik Sandberg",
"author_url" : "https://www.google.com/maps/contrib/113791312001095793561/reviews",
"language" : "en",
"profile_photo_url" : "//lh6.googleusercontent.com/-DH91vW9zE6U/AAAAAAAAAAI/AAAAAAAAKiA/Xi3IaYgtIr4/photo.jpg",
"rating" : 3,
"text" : "",
"time" : 1448072416
}
],
"scope" : "GOOGLE",
"types" : [ "restaurant", "food", "point_of_interest", "establishment" ],
"url" : "https://maps.google.com/?cid=10771837136305107778",
"utc_offset" : -480,
"vicinity" : "Building 65, 1 Grande Ave, California Polytechnic State University, San Luis Obispo",
"website" : "https://www.calpolydining.com/mustangstation/"
},
"status" : "OK"
}
There is a feature request in the public issue tracker to add Special Hours in the Places details response:
https://code.google.com/p/gmaps-api-issues/issues/detail?id=10145
It looks like Google created a corresponding internal issue #30233280 and is evaluating the feasibility to implement this.
Please star the feature request in the public issue tracker to express your interest and receive updates from Google.
Related
Basically, I have 2 collections in my MongoDB database -> Books, Scores.
Books
{
"BOOK_ID" : "100",
"BOOK_NAME" : "Book 1",
"BOOK_DESC" : "abcd",
},
{
"BOOK_ID" : "101",
"BOOK_NAME" : "Book 2",
"BOOK_DESC" : "efgh",
},
{
"BOOK_ID" : "102",
"BOOK_NAME" : "Book 3",
"BOOK_DESC" : "ijkl",
}
Scores
{
"BOOK_ID" : "100",
"BOOK_CATEGORY" : "kids",
"BOOK_SCORE" : "6",
},
{
"BOOK_ID" : "100",
"BOOK_CATEGORY" : "Educational",
"BOOK_SCORE" : "8",
},
{
"BOOK_ID" : "101",
"BOOK_CATEGORY" : "Kids",
"BOOK_SCORE" : "6",
},
{
"BOOK_ID" : "101",
"BOOK_CATEGORY" : "Fantasy",
"BOOK_SCORE" : "7",
}
Expected output :
Searching for all books with BOOKS_CATEGORY="Kids" and `BOOKS_SCORE=6``
{
"BOOK_ID" : "100",
"BOOK_NAME" : "Book 1",
"BOOK_DESC" : "abcd",
"BOOK_CATEGORY" : "Kids",
"BOOK_SCORE" : 6
},
{
"BOOK_ID" : "101",
"BOOK_NAME" : "Book 2",
"BOOK_DESC" : "efgh",
"BOOK_CATEGORY" : "Kids",
"BOOK_SCORE" : 6
},
{
"BOOK_ID" : "102",
"BOOK_NAME" : "Book 3",
"BOOK_DESC" : "ijkl",
}
Notice that, for all the books to which scores are available, they are appended. If a Book does not have any score associated, it still comes in the result.
What I have tried?
I have tried using $lookup
pipeline = [
{
"$lookup": {
"from": "Scores",
"pipeline":[
{
"$match" : {
"BOOK_CATEGORY" : "Kids",
"BOOK_SCORE" : "6",
}
}
],
"localField": "BOOK_ID",
"foreignField": "BOOK_ID",
"as": "SCORES",
},
},
]
db.Books.aggregate(pipeline)
Also, by reading the $lookup subquery docs,(https://www.mongodb.com/docs/manual/reference/operator/aggregation/lookup/#join-conditions-and-subqueries-on-a-joined-collection)
I got the feeling that what I am expecting may not be possible.
Can anyone help me with executing such query? (I use PyMongo btw)
For the last two stages:
$replaceRoot - Replace the input document(s) with the new document(s) by merging the current document with the document which is the first document from the SCORES array.
$unset - Remove SCORES array.
db.Books.aggregate([
{
"$lookup": {
"from": "Scores",
"pipeline": [
{
"$match": {
"BOOK_CATEGORY": "Kids",
"BOOK_SCORE": "6",
}
}
],
"localField": "BOOK_ID",
"foreignField": "BOOK_ID",
"as": "SCORES"
}
},
{
"$replaceRoot": {
"newRoot": {
"$mergeObjects": [
"$$ROOT",
{
$first: "$$ROOT.SCORES"
}
]
}
}
},
{
$unset: "SCORES"
}
])
Sample Mongo Playground
You can achieve this by using a conditional $addFields, if the $lookup value exists then populate the values, else use $$REMOVE to remove the field, like so:
db.Books.aggregate([
{
"$lookup": {
"from": "Scores",
"pipeline": [
{
"$match": {
"BOOK_CATEGORY": "kids",
"BOOK_SCORE": "6"
}
}
],
"localField": "BOOK_ID",
"foreignField": "BOOK_ID",
"as": "SCORES"
}
},
{
$addFields: {
SCORES: "$$REMOVE",
"BOOK_SCORE": {
$cond: [
{
"$ifNull": [
{
"$arrayElemAt": [
"$SCORES",
0
]
},
false
]
},
{
$getField: {
field: "BOOK_SCORE",
input: {
"$arrayElemAt": [
"$SCORES",
0
]
}
}
},
"$$REMOVE"
]
},
"BOOK_CATEGORY": {
$cond: [
{
"$ifNull": [
{
"$arrayElemAt": [
"$SCORES",
0
]
},
false
]
},
{
$getField: {
field: "BOOK_CATEGORY",
input: {
"$arrayElemAt": [
"$SCORES",
0
]
}
}
},
"$$REMOVE"
]
},
}
}
])
Mongo Playground
I'm trying to filter in my MongoDB collection the "id" field and only matching fields from a nested document which value starts with "link_"
Here's an example of my collection data:
{
"id": "tb_gl_core_company",
"region": "gl",
"enabled": true,
"default_init": "2018-01-09T04:01:55.369-02:00",
"handler": {
"banner_image_light": "value,40",
"country": "value,40",
"parent": "link_core_company",
"notes": "value,4000",
"city": "value,50",
"stock_symbol": "value,40",
"latitude": "value,40",
"discount": "value,15",
"sys_updated_on": "date",
"sys_class_name": "choice,80",
"manufacturer": "boolean",
"apple_icon": "value,40",
"sys_id": "value,32",
"market_cap": "double",
"sys_updated_by": "value,40",
"num_employees": "value,40",
"fiscal_year": "date",
"rank_tier": "value,40",
"sso_source": "value,128",
"street": "value,255",
"sys_created_on": "date",
"vendor": "boolean",
"contact": "link_sys_user",
"lat_long_error": "value,1000",
"stock_price": "value,40",
"banner_image": "value,40",
"state": "value,40",
"sys_created_by": "value,40",
"longitude": "value,40",
"vendor_type": "value,1024",
"zip": "value,40",
"profits": "double",
"revenue_per_year": "double",
"website": "value,1024",
"publicly_traded": "boolean",
"sys_mod_count": "value,40",
"canonical": "boolean",
"sys_tags": "value,100",
"fax_phone": "value,40",
"phone": "value,40",
"u_delivery": "value,40",
"vendor_manager": "value,4000",
"banner_text": "value,100",
"name": "value,80",
"u_client_code": "value,40",
"hash": "value,40",
"customer": "boolean",
"primary": "boolean"
},
"table_sql": "tb_gl_core_company",
"table_snow": "core_company"
},
{
"id": "tb_gl_sys_user_group",
"region": "gl",
"enabled": false,
"default_init": "2018-01-09T04:01:55.369-02:00",
"handler": {
"parent": "link_sys_user_group",
"manager": "link_sys_user",
"sys_mod_count": "value,40",
"active": "boolean",
"description": "value,1000",
"average_daily_fte": "value,20",
"source": "value,255",
"sys_updated_on": "date",
"sys_tags": "value,100",
"type": "choice,1024",
"u_company": "link_core_company",
"u_source_company": "link_core_company",
"points": "value,40",
"sys_id": "value,32",
"sys_updated_by": "value,40",
"default_assignee": "link_sys_user",
"hourly_rate": "double",
"sys_created_on": "date",
"name": "value,80",
"u_external_system": "link_u_integration_interfaces",
"exclude_manager": "boolean",
"email": "value,100",
"include_members": "boolean",
"sys_created_by": "value,40"
},
"table_sql": "tb_gl_sys_user_group",
"table_snow": "sys_user_group"
}
Every document inside my collection has "handler" field, but handler never is equals between documents, e.g., number of handler's items and its key values may be different from a document to another.
In this case, I want to get an output like:
{
"id" : "tb_gl_core_company",
"handler" : {
"parent": "link_core_company",
"contact": "link_sys_user",
...
}
},
{
"id": "tb_gl_sys_user_group",
"handler" : {
"parent": "link_sys_user_group",
"manager": "link_sys_user",
...
}
}
How do I build a MongoDB query to get this result?
The following query can get us the expected output:
db.collection.aggregate([
{
$addFields:{
"handler":{
$objectToArray:"$handler"
}
}
},
{
$addFields:{
"handler":{
$filter:{
"input":"$handler",
"as":"field",
"cond":{
$eq:[
{
$indexOfCP:["$$field.v","link_"]
},
0
]
}
}
}
}
},
{
$addFields:{
"handler":{
$arrayToObject:"$handler"
}
}
}
]).pretty()
Data set:
{
"_id" : ObjectId("5d80cfc28b29702d01b91f5d"),
"id" : "tb_gl_core_company",
"region" : "gl",
"enabled" : true,
"default_init" : "2018-01-09T04:01:55.369-02:00",
"handler" : {
"banner_image_light" : "value,40",
"country" : "value,40",
"parent" : "link_core_company",
"notes" : "value,4000",
"city" : "value,50",
"stock_symbol" : "value,40",
"latitude" : "value,40",
"discount" : "value,15",
"sys_updated_on" : "date",
"sys_class_name" : "choice,80",
"manufacturer" : "boolean",
"apple_icon" : "value,40",
"sys_id" : "value,32",
"market_cap" : "double",
"sys_updated_by" : "value,40",
"num_employees" : "value,40",
"fiscal_year" : "date",
"rank_tier" : "value,40",
"sso_source" : "value,128",
"street" : "value,255",
"sys_created_on" : "date",
"vendor" : "boolean",
"contact" : "link_sys_user",
"lat_long_error" : "value,1000",
"stock_price" : "value,40",
"banner_image" : "value,40",
"state" : "value,40",
"sys_created_by" : "value,40",
"longitude" : "value,40",
"vendor_type" : "value,1024",
"zip" : "value,40",
"profits" : "double",
"revenue_per_year" : "double",
"website" : "value,1024",
"publicly_traded" : "boolean",
"sys_mod_count" : "value,40",
"canonical" : "boolean",
"sys_tags" : "value,100",
"fax_phone" : "value,40",
"phone" : "value,40",
"u_delivery" : "value,40",
"vendor_manager" : "value,4000",
"banner_text" : "value,100",
"name" : "value,80",
"u_client_code" : "value,40",
"hash" : "value,40",
"customer" : "boolean",
"primary" : "boolean"
},
"table_sql" : "tb_gl_core_company",
"table_snow" : "core_company"
}
{
"_id" : ObjectId("5d80cfc28b29702d01b91f5e"),
"id" : "tb_gl_sys_user_group",
"region" : "gl",
"enabled" : false,
"default_init" : "2018-01-09T04:01:55.369-02:00",
"handler" : {
"parent" : "link_sys_user_group",
"manager" : "link_sys_user",
"sys_mod_count" : "value,40",
"active" : "boolean",
"description" : "value,1000",
"average_daily_fte" : "value,20",
"source" : "value,255",
"sys_updated_on" : "date",
"sys_tags" : "value,100",
"type" : "choice,1024",
"u_company" : "link_core_company",
"u_source_company" : "link_core_company",
"points" : "value,40",
"sys_id" : "value,32",
"sys_updated_by" : "value,40",
"default_assignee" : "link_sys_user",
"hourly_rate" : "double",
"sys_created_on" : "date",
"name" : "value,80",
"u_external_system" : "link_u_integration_interfaces",
"exclude_manager" : "boolean",
"email" : "value,100",
"include_members" : "boolean",
"sys_created_by" : "value,40"
},
"table_sql" : "tb_gl_sys_user_group",
"table_snow" : "sys_user_group"
}
Output:
{
"_id" : ObjectId("5d80cfc28b29702d01b91f5d"),
"id" : "tb_gl_core_company",
"region" : "gl",
"enabled" : true,
"default_init" : "2018-01-09T04:01:55.369-02:00",
"handler" : {
"parent" : "link_core_company",
"contact" : "link_sys_user"
},
"table_sql" : "tb_gl_core_company",
"table_snow" : "core_company"
}
{
"_id" : ObjectId("5d80cfc28b29702d01b91f5e"),
"id" : "tb_gl_sys_user_group",
"region" : "gl",
"enabled" : false,
"default_init" : "2018-01-09T04:01:55.369-02:00",
"handler" : {
"parent" : "link_sys_user_group",
"manager" : "link_sys_user",
"u_company" : "link_core_company",
"u_source_company" : "link_core_company",
"default_assignee" : "link_sys_user",
"u_external_system" : "link_u_integration_interfaces"
},
"table_sql" : "tb_gl_sys_user_group",
"table_snow" : "sys_user_group"
}
Query analysis: We are first converting the handler sub-document into an array of key-value pairs. Each key-value pair represent a field and its value. After that, those keys are filtered which has values starting with link_ and finally the array is again converted into a sub-document.
I'm testing the currrent version of wso2 API Manager (2.5.0) and I've a problem with my current swagger files that I've already imported in the version 2.2.0.
The error message is: "The HTTP method 'parameters' provided for resource '/tasks/{taskid}' is invalid":
at org.wso2.carbon.apimgt.impl.utils.APIUtil.handleException(APIUtil.java:1411)
at org.wso2.carbon.apimgt.impl.definitions.APIDefinitionFromOpenAPISpec.getURITemplates(APIDefinitionFromOpenAPISpec.java:124)
at org.wso2.carbon.apimgt.hostobjects.APIProviderHostObject.jsFunction_updateAPIDesign(APIProviderHostObject.java:969)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:126)
... 69 more
This is the API sample from studio.restlet.com:
{
"swagger" : "2.0",
"info" : {
"description" : "An API for managing a list of tasks that need to be done. \n\nDon't forget to take it for a spin by clicking on the **Try in Client** button next to each operation! All read operations are public and don't require authentication.\n",
"version" : "1.1.0",
"title" : "Tasks API",
"termsOfService" : "",
"contact" : { }
},
"host" : "tasksapi.restlet.net",
"basePath" : "/v1",
"schemes" : [ "https" ],
"consumes" : [ "application/json" ],
"produces" : [ "application/json" ],
"paths" : {
"/tasks/" : {
"get" : {
"summary" : "Load the list of Tasks",
"parameters" : [ {
"name" : "$size",
"in" : "query",
"required" : false,
"type" : "integer",
"description" : "Size of the page to retrieve.",
"x-example" : 10
}, {
"name" : "$page",
"in" : "query",
"required" : false,
"type" : "integer",
"description" : "Number of the page to retrieve.",
"x-example" : 1
}, {
"name" : "$sort",
"in" : "query",
"required" : false,
"type" : "string",
"description" : "Order in which to retrieve the results. Multiple sort criteria can be passed. Example: sort=age ASC,height DESC",
"x-example" : "createdAt DESC"
}, {
"name" : "id",
"in" : "query",
"required" : false,
"type" : "string",
"description" : "Allows to filter the collection of results by the value of field `id`",
"x-example" : "47ee3550-b619-11e6-8408-0bdb025a7cfa"
}, {
"name" : "name",
"in" : "query",
"required" : false,
"type" : "string",
"description" : "Allows to filter the collection of results by the value of field `name`",
"x-example" : "Learn about hypermedia APIs"
}, {
"name" : "createdAt",
"in" : "query",
"required" : false,
"type" : "string",
"description" : "Allows to filter the collection of results by the value of field `createdAt`",
"x-example" : "2016.07.03"
}, {
"name" : "completed",
"in" : "query",
"required" : false,
"type" : "boolean",
"description" : "Allows to filter the collection of results by the value of field `completed`",
"x-example" : true
} ],
"responses" : {
"200" : {
"description" : "Status 200",
"schema" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/Task"
}
},
"examples" : {
"application/json" : "[{\n \"id\": \"47ee3550-b619-11e6-8408-0bdb025a7cfa\",\n \"name\": \"Feed the fish\",\n \"completed\": false,\n \"createdAt\": \"2016.07.03\"\n}]"
},
"headers" : {
"X-Page-Count" : {
"type" : "integer",
"x-example" : 1
},
"X-Page-Number" : {
"type" : "integer",
"x-example" : 1
},
"X-Page-Size" : {
"type" : "integer",
"x-example" : 25
},
"X-Total-Count" : {
"type" : "integer",
"x-example" : 2
}
}
},
"400" : {
"description" : "Status 400",
"schema" : {
"$ref" : "#/definitions/Error"
}
}
}
},
"post" : {
"summary" : "Create a new Task",
"consumes" : [ ],
"parameters" : [ {
"name" : "body",
"in" : "body",
"required" : true,
"schema" : {
"$ref" : "#/definitions/Task"
},
"x-examples" : {
"application/json" : "{\n \"name\": \"Feed the fish\",\n \"completed\": false,\n \"createdAt\": \"2016.07.03\"\n}"
}
} ],
"responses" : {
"200" : {
"description" : "Status 200",
"schema" : {
"$ref" : "#/definitions/Task"
},
"examples" : {
"application/json" : "{\n \"id\": \"47ee3550-b619-11e6-8408-0bdb025a7cfa\",\n \"name\": \"Feed the fish\",\n \"completed\": false,\n \"createdAt\": \"2016.07.03\"\n}"
}
}
},
"security" : [ {
"HTTP_BASIC" : [ ]
} ]
}
},
"/tasks/{taskid}" : {
"get" : {
"summary" : "Load a specific Task",
"parameters" : [ ],
"responses" : {
"200" : {
"description" : "Status 200",
"schema" : {
"$ref" : "#/definitions/Task"
},
"examples" : {
"application/json" : "{\n \"id\": \"47ee3550-b619-11e6-8408-0bdb025a7cfa\",\n \"name\": \"Feed the fish\",\n \"completed\": false,\n \"createdAt\": \"2016.07.03\"\n}"
}
},
"400" : {
"description" : "Status 400",
"schema" : {
"$ref" : "#/definitions/Error"
}
}
}
},
"put" : {
"summary" : "Update a Task",
"consumes" : [ ],
"parameters" : [ {
"name" : "body",
"in" : "body",
"required" : true,
"schema" : {
"$ref" : "#/definitions/Task"
},
"x-examples" : {
"application/json" : "{\n \"name\": \"Feed the fish\",\n \"completed\": false,\n \"createdAt\": \"2016.07.03\"\n}"
}
} ],
"responses" : {
"200" : {
"description" : "Status 200",
"schema" : {
"$ref" : "#/definitions/Task"
},
"examples" : {
"application/json" : "{\n \"id\": \"47ee3550-b619-11e6-8408-0bdb025a7cfa\",\n \"name\": \"Feed the fish\",\n \"completed\": false,\n \"createdAt\": \"2016.07.03\"\n}"
}
}
},
"security" : [ {
"HTTP_BASIC" : [ ]
} ]
},
"delete" : {
"summary" : "Delete a Task",
"parameters" : [ ],
"responses" : {
"200" : {
"description" : "Status 200"
}
},
"security" : [ {
"HTTP_BASIC" : [ ]
} ]
},
"parameters" : [ {
"name" : "taskid",
"in" : "path",
"required" : true,
"type" : "string",
"description" : "Identifier of the Task",
"x-example" : "47ee3550-b619-11e6-8408-0bdb025a7cfa"
} ]
}
},
"securityDefinitions" : {
"HTTP_BASIC" : {
"description" : "All GET methods are public, meaning that *you can read all the data*. Write operations require authentication and therefore are forbidden to the general public.",
"type" : "basic"
}
},
"definitions" : {
"Task" : {
"type" : "object",
"required" : [ "completed", "id", "name" ],
"properties" : {
"id" : {
"type" : "string",
"description" : "Auto-generated primary key field",
"example" : "3fa2eb40-b61c-11e6-9de0-fdbe71bceebb"
},
"name" : {
"type" : "string",
"example" : "Figure out how to colonize Mars"
},
"completed" : {
"type" : "boolean"
},
"createdAt" : {
"type" : "string",
"example" : "2016.10.06"
}
},
"description" : "An object that represents a Task.",
"example" : "{\n \"id\": \"47ee3550-b619-11e6-8408-0bdb025a7cfa\",\n \"name\": \"Feed the fish\",\n \"completed\": false,\n \"createdAt\": \"2016.07.03\"\n}"
},
"Error" : {
"type" : "object",
"required" : [ "code" ],
"properties" : {
"code" : {
"type" : "integer",
"minimum" : 400,
"maximum" : 599
},
"description" : {
"type" : "string",
"example" : "Bad query parameter [$size]: Invalid integer value [abc]"
},
"reasonPhrase" : {
"type" : "string",
"example" : "Bad Request"
}
},
"description" : "This general error structure is used throughout this API.",
"example" : "{\n \"code\": 400,\n \"description\": \"Bad query parameter [$size]: Invalid integer value [abc]\",\n \"reasonPhrase\": \"Bad Request\"\n}"
}
}
}
This is fixed in APIManager 2.6. Please refer attached screen capture video for verification. Please refer https://github.com/wso2/product-apim/issues/3560 for developer testing record.
I'm using the simple URL that Google provides for zip code lookup.
http://maps.googleapis.com/maps/api/geocode/json?address=90210&sensor=true
This URL will return results for the whole world but how do I limit those to just the USA? I looked it up but can't find anything. I'd hate to code more than necessary to make sure there are not any US addresses when there might be a way to add to the URL and get the:
{
"results" : [],
"status" : "ZERO_RESULTS"
}
This is what the API returns if there are no results at all. Much easier.
You could use the component filtering and use the country and the postal_code components
http://maps.googleapis.com/maps/api/geocode/json?sensor=true&components=country:US|postal_code:90210
Perhaps Google had a glitch when you tried the link you provided in your question. I just tried it and it worked fine:
{
"results" : [
{
"address_components" : [
{
"long_name" : "90210",
"short_name" : "90210",
"types" : [ "postal_code" ]
},
{
"long_name" : "Beverly Hills",
"short_name" : "Beverly Hills",
"types" : [ "locality", "political" ]
},
{
"long_name" : "Los Angeles County",
"short_name" : "Los Angeles County",
"types" : [ "administrative_area_level_2", "political" ]
},
{
"long_name" : "California",
"short_name" : "CA",
"types" : [ "administrative_area_level_1", "political" ]
},
{
"long_name" : "United States",
"short_name" : "US",
"types" : [ "country", "political" ]
}
],
"formatted_address" : "Beverly Hills, CA 90210, USA",
"geometry" : {
"bounds" : {
"northeast" : {
"lat" : 34.1354771,
"lng" : -118.3867129
},
"southwest" : {
"lat" : 34.065094,
"lng" : -118.4423781
}
},
"location" : {
"lat" : 34.1030032,
"lng" : -118.4104684
},
"location_type" : "APPROXIMATE",
"viewport" : {
"northeast" : {
"lat" : 34.1354771,
"lng" : -118.3867129
},
"southwest" : {
"lat" : 34.065094,
"lng" : -118.4423781
}
}
},
"types" : [ "postal_code" ]
}
],
"status" : "OK"
}
I'm not sure why Google Places API is returning the following results for lat,lng = 0,0 ... shouldn't it be fetching places at the Prime Meridian and Equator intersection, and not just a smattering of cities whose geocoords are clearly not close to 0,0 like:
{
"html_attributions" : [],
"results" : [
{
"geometry" : {
"location" : {
"lat" : 40.7483170,
"lng" : -73.9855290
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
"id" : "2bf00f9f5e2e3e50098fd611f9fde65cdb453f20",
"name" : "Empire State Building",
"rating" : 4.40,
"reference" : "CnRrAAAAtzNwdIo2Dcf4rhroiiyCyJqarCL7FZQvXxvz6vdYda1MYaxmjfwPdd2k_nyyq1c-urcOZ2GIg3r5GqmjtguEQNlKiYu8706vHJKiZCax-COsvbWHS3WBLWiZ3uYoY2wGclP3D-2loob4rNFa_XavERIQaVGvVVfsV3ayD8D9_-dtqhoUmZInS1ufM4ErRz4s76nX5Wr8PUA",
"types" : [ "amusement_park", "establishment" ],
"vicinity" : "350 5th Avenue, New York"
},
{
"geometry" : {
"location" : {
"lat" : 34.0554640,
"lng" : -118.249760
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
"id" : "5cf64f5eb238d7e3740c59a49938ceb7c5b08646",
"name" : "Gedung Konser Walt Disney",
"rating" : 4.40,
"reference" : "CnRwAAAAfgumgAs3d8qOytOVUEgMBSbddJ80fSzX7JbsmxHvwZRkto-_tLF1VIgkswR3VRMBRfC5fs4JNcgVEhb2KQbRMFFC1FImwRlSM6igdR5TWpYiP2PlP1tA80SPF8lR_7TNM_fS0GyDM9Y45nE59S-WCxIQKbEIn_MR0ASWWc47N0yx1BoUDbjx_g1pzUAIzfTI7-UcsVdr8n4",
"types" : [ "establishment" ],
"vicinity" : "111 S Grand Ave, Los Angeles"
},
{
"geometry" : {
"location" : {
"lat" : 40.7599740,
"lng" : -73.9800970
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
"id" : "89dd7f0c82efc14f18954f8abf2925515037927a",
"name" : "Radio City Music Hall",
"rating" : 3.90,
"reference" : "CnRsAAAAz4THB7lZ9nA3Il7YOwfFubKCR91gBo8jHNlXUQWUw7JEliOwoNsvgQOAtECHb7RttpnRFJj2gwMq4aFYR7ndaTlp53rNMpoFp4DDS_EVA1WlioGNqFGEi4vzkQbqetoJ9VN1O9cJg2YJpL7TuR9dNxIQWwsOVjW_tUB5sGlMYSlaSxoUxYYdcSHox7CfUmZ7P0Rc7zV7_e0",
"types" : [ "establishment" ],
"vicinity" : "1260 6 Avenue, New York"
},
{
"geometry" : {
"location" : {
"lat" : 38.8895020,
"lng" : -77.0353030
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
"id" : "2598a3577d35a8f9ce6cc12c6c20d59fe3f9d1fc",
"name" : "Washington Monument",
"rating" : 3.50,
"reference" : "CnRqAAAAtAuqKVfxJ_ni_49Wg8THdIjk7sK7C3wVMIjoSVPSriDr6Tht5-RvBScdFB_VasYBMR1BO_TESlyHQfCONNh3c2xjVsUPwFLruSPpKZCgA1gZY5eE3amDsFhjB2gZc2zQatv3dBbcW5HxWwK38KDn2xIQj20Ad9IMHh2A15niVVW-ihoUzwSKPeInBDipmiHe-oX0eS751_c",
"types" : [ "park", "establishment" ],
"vicinity" : "2 15th Street Northwest, Washington D.C."
},
{
"geometry" : {
"location" : {
"lat" : 40.7075260,
"lng" : -74.0111520
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
"id" : "010cda7c358ae874784ef918d1c19e2643c4fec0",
"name" : "NYSE Regulation Inc",
"rating" : 3.40,
"reference" : "CnRqAAAAR8SX_5aQ60pZEffiLIbXTxoXVCdzpIVleLXseSizaa08ZyAV-6HKFoXP_3eFKBcVewUuTgdxX0JJu8idVtjvF-FJnK5-RWt0jp1K2tB2YwOpwHNI7bXnYxqVEATcyH1Y8ft5SXh2uaqRL-SoKwC2hhIQTpljtBc_hALik0ECJD3syhoUmzoPIYGREYJMw1qA4PbeW9yR7_s",
"types" : [ "establishment" ],
"vicinity" : "11 Wall Street, New York"
},
{
"geometry" : {
"location" : {
"lat" : 36.1573480,
"lng" : -115.1483340
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/lodging-71.png",
"id" : "729e341abb54a12a11d84573d977df0f41acca7b",
"name" : "Las Vegas Pretty Kittens",
"rating" : 4.30,
"reference" : "CnRvAAAA1KMLOeN6uzyj-QGAP5Mqg_qe5IDN3Zl9ID_to_pyaxGD5ERHsLsmvGAT801ST89xdHSXk1Tga950V5RBJX5FGopZ2B7rFIBNDPFxrB9wK4mYgaZiwR-m_j1rdzx9EkEPe3JMEnBZq-Y8djh_V2tX8hIQTk931oTYQPGyVCL1rQQDaRoUzhWJ_Cq1UFvKAhNansZJVO4ipOI",
"types" : [ "lodging", "establishment" ],
"vicinity" : "3798 Las Vegas Blvd, Las Vegas"
},
{
"geometry" : {
"location" : {
"lat" : 40.829750,
"lng" : -73.92613799999999
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/stadium-71.png",
"id" : "4120a48a1c6bae3f896b9022fbe45bbdbb041c8d",
"name" : "Yankee Stadium",
"rating" : 4.40,
"reference" : "CnRlAAAAsHJIlsQHJmkIYUOW_6m1l8th1F5qtG9ULSn6i9-kAc5cjoxRvDmpeqze14ErqEcxVZPT4wLyU_S845VpDzeJH9XeQHFZWUIr_uu8U01xD9VO4TghUfmBikJN5Ap4cn7zf3BPgBnqVcymBMWeOsr0ABIQbNrG__9TSUduj-lSHV8OGBoUW3867le_CNRd-5ZncKMGgu1y-Q4",
"types" : [ "stadium", "establishment" ],
"vicinity" : "1 East 161st Street, Bronx"
},
{
"geometry" : {
"location" : {
"lat" : 36.1475610,
"lng" : -115.155430
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/lodging-71.png",
"id" : "7a80fe02f232f2f8fb62953d7eca557722b58012",
"name" : "Stratosphere",
"rating" : 3.60,
"reference" : "CnRjAAAAjLLI-i_uFl-t4VGhFXpbA8GOiu5NxFKPvjQVludTJBowR-McYhjy8Xm1sfIi5eDCT4M4nPCJ8Zr-ixYI_lfNVviGAy9qiteA5_KYvlbzVBnDY9Cg2Dl0tjcQeiRy6HoXlXihb_TiOb5pcqQlJyfg_xIQ4HS8Ie0KuGfZxgOBQzBwiBoU2FjrN08mGMZRnFw96ebkGB9iM0c",
"types" : [ "lodging", "establishment" ],
"vicinity" : "2000 South Las Vegas Boulevard, Las Vegas"
},
{
"geometry" : {
"location" : {
"lat" : 36.0989050,
"lng" : -115.1754280
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/lodging-71.png",
"id" : "5415e1b4a3f278a0f654cecaefd3a8c9c18de6cf",
"name" : "Buca di Beppo - Las Vegas - Excalibur",
"rating" : 3.70,
"reference" : "CoQBfAAAAH4lqpHGSoEJj1NpWM9G9TFv9wd8h1iupqzjFckBVlqWp3Py0-zg0l2uEIQq_1rFDzVIBa7r4uzKSmbj8x_djw2ytBjwdVZHuzPxNH0B6-OsoXgq5VXh_ej0_TQytprNHXkeO6VEhi5REkjtbzOqrwO4n-LwvZ8jdqGZtE-I8BM_EhC--WZHCmvg4s4AQqyBX8pMGhTZfTcTmEPVKyUIGn0J4EcscR6LTA",
"types" : [ "lodging", "establishment" ],
"vicinity" : "3850 Las Vegas Blvd. South, Second Floor, Las Vegas"
},
{
"geometry" : {
"location" : {
"lat" : 34.1025420,
"lng" : -118.3416570
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/movies-71.png",
"id" : "46e0f0dc849234110d70dce04cacefa982f1898a",
"name" : "Kodak Theatre",
"rating" : 4.0,
"reference" : "CnRkAAAA9l1BF_OHV88D0oLmjP0eeB9lvlfSuMoH_Clpk0xN2rprdAs-NVajY82CkWk6q5Xgy_-WaKMadnDFWg1dmvBlM9CSG9YjlEsuGdkGAQ_2JT5BKcQZAsgO-LCInrNGQhHb6UA6EINa_oeWIT5yX2wFgxIQCQYutFUfkTt9lUFGv5Q1qRoUE3TXdS-d8wLXrLijExuCRRS7pKs",
"types" : [ "movie_theater", "establishment" ],
"vicinity" : "6801 Hollywood Boulevard Hollywood, CA 90028"
},
{
"geometry" : {
"location" : {
"lat" : 38.8885120,
"lng" : -77.0201260
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/museum-71.png",
"id" : "6233faaa08c8457051ce7a2ae89260885c3d099e",
"name" : "National Air and Space Museum",
"rating" : 3.90,
"reference" : "CoQBcwAAANunAGpqdW9ux0r61QRMDJJVpXbcWfzQXYc9Lfsjo11AwnOT00qvjgNEML24mmTlo-fwxPqAori2FXzCz75nrk5ZthIoY6rUwT2XqMo_1wLdeIYzI8HBTB5d80lMZCDyYPNIyUXK1BQxkDARI-Djcvm0cxcsd5pkM5nKUcALHClREhDw1unCtEDqrdvaCyiwqO5JGhRlEXlguPNDn8-OhkUM-e2zVIfJHQ",
"types" : [ "museum", "establishment" ],
"vicinity" : "595 Independence Avenue Southwest, Washington"
},
{
"geometry" : {
"location" : {
"lat" : 40.7653850,
"lng" : -73.9796820
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
"id" : "ff0ea6469ef95cea73f323b77e18bc2065fb3f3f",
"name" : "Carnegie Hall",
"rating" : 3.80,
"reference" : "CnRjAAAAxCg7QA4KqEWMXOJnLZ4tZj_HefkwzsO_c1yGPbgQZ6hEvbKZymhQ6Fr4wffzF8hpRFr9w6teszOKu-IQW0OqUc4jQaHVz0iErmhMAzIbuX7C_QHmnTn8gVKC4K_Zlp4vDS5AL9-GzhEkj_rYmyg3FhIQ7YW9PNRhxLTkVvi3wBLALxoUiEwWkeBsTM_FrUybFcqpToYbtS0",
"types" : [ "establishment" ],
"vicinity" : "881 7th Ave, New York"
},
{
"geometry" : {
"location" : {
"lat" : 37.7714720,
"lng" : -122.4686720
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
"id" : "d0f545120ffb6baec5da1ab9e5a9c19f49115dc5",
"name" : "Fine Arts Museums of San Francisco: Facility Rentals",
"rating" : 4.10,
"reference" : "CpQBiwAAAL6id9WjmuDsGHBq1ikNCGmYv1i652crIWcDwPNOMazjrCYvde35uVNQIsdzRDcEBIEXgzIm3Vi9CmUPLevsigYOAd3TQ61z5huCv_53jSlITWzcKsaOa_ZAQQPZyMpYPwhkxnYESU-4GFzzoLFzH1-afqCKcwrFAauKCDcTvwy2qfYPXfio1grIEKfBln83qRIQrmVEtNeLqO5n9WOjjXhJMhoUfZkJU9kN8CAIOY__1Y3syoPB_1k",
"types" : [ "restaurant", "museum", "food", "establishment" ],
"vicinity" : "50 Hagiwara Tea Garden Drive, San Francisco"
},
{
"geometry" : {
"location" : {
"lat" : 40.6709750,
"lng" : -73.96363599999999
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/museum-71.png",
"id" : "50536f2341830cb033e6342fb2e123d88fb5262b",
"name" : "Brooklyn Museum",
"rating" : 4.30,
"reference" : "CnRmAAAAurnWOaSKJ3xC5JCHa0RpCbJ4o36w6z2FDWePJNM2wPhvlp9PyyLNe_REHiA82IlTTaoUKXSJRecUr-CW88YfzNsEZ20GQFXm21PKkgrrF1vP0NL6S-wb4xbr_k5vNnZgW1_5rVf7AsPg_02xRDc2BBIQRIERe2yg8Xi94SOFussv3hoU1ym_ci8XQ7W1US6tdpOTvtMMDCw",
"types" : [ "museum", "establishment" ],
"vicinity" : "200 Eastern Parkway, Brooklyn"
},
{
"geometry" : {
"location" : {
"lat" : 41.881320,
"lng" : -87.674280
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/stadium-71.png",
"id" : "99dbf0f7af6e6fd7fe9f48b5cfd5d9374d40eee7",
"name" : "Madison & United Center (1900 W)",
"rating" : 4.60,
"reference" : "CoQBdwAAAIwXyy6eDjcW_4Bub5XvmGHiqMJ-Stl1QIYLE9y7i2vC1TCCAUXGYB9y-ydP4rs7A3YP5ux5Eh5dfWpczrUEIz7FFhBXHCcu7mKFGx8ifLXTg6NWjLtXGSBMk5UOkuMlQ759B4UGufhgLNCPXdrPqO6kTMZG8VQ1tenNlPLPtkWrEhB2WMI2FjYGBmlCHBYayIFGGhT2uist4FA0sRJmBj3o4iALDgBT9Q",
"types" : [ "stadium", "establishment" ],
"vicinity" : "1901 West Madison Street, Chicago"
},
{
"geometry" : {
"location" : {
"lat" : 36.1214190,
"lng" : -115.1704240
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/lodging-71.png",
"id" : "8fdee88bfe0bc1d70eaf2a1c8528934528344298",
"name" : "The Venetian",
"rating" : 4.10,
"reference" : "CnRjAAAAMATHKiVvbWVf4PLp8RwYQB_pHCu_3Fua1MQ7Gl5B1xNDHU9WkICPeu__TGD5Hfgb47b9V6bCxEkgLFbi21dwOThtDjtby4tDH2HnL7iba6_CxYrgMOrP-WOuh4HMPqCU5Fu5Tm2mttHLgNQ3H2eCKBIQ99KyfeOqL8Ke8eF_IQWehxoUsjo-AknTVGd_LpuAIcBlKFtw0LY",
"types" : [ "lodging", "establishment" ],
"vicinity" : "3355 Las Vegas Boulevard South, Las Vegas"
},
{
"geometry" : {
"location" : {
"lat" : 40.8647670,
"lng" : -73.9317990
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/museum-71.png",
"id" : "8edf774a665aeb294a6d6cf8df4405f4824f7e4f",
"name" : "The Cloisters",
"rating" : 3.90,
"reference" : "CnRkAAAAoXh2hlwgjHoK57WLbYJXZylMK2E96FRHa_TzNBEq4vxTUHrq_eguI58Yo0iQRBtFX3ro5U8OdwzMreDpgUTnVFMPRCzxWyshdL-tCaEjIWK-3VpdCHh4imG3x_fjLfqgFi4Ndf48gctZhrOg-0RNdhIQnpmnyP-W9TN1HmvwTeNtUBoUQ2BQXpiGHWltpzK1zKGdq8FIYzk",
"types" : [ "museum", "establishment" ],
"vicinity" : "99 Margaret Corbin Drive, New York"
},
{
"geometry" : {
"location" : {
"lat" : 38.8959010,
"lng" : -77.0552390
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png",
"id" : "66763890699cdd158cff72bffe0f7ab48c755a43",
"name" : "The John F. Kennedy Center for the Performing Arts",
"rating" : 4.50,
"reference" : "CpQBiQAAAK5sBdti2mRClLvnnl7-P_sAs0ptzxUvT4YWZ9bYP4wyIPHzvSv2D3DAhx_tK7g_jsKM7qnbIhXrJW_9Bb7XU9XexgIsm6rSRkTGuN70JRy5d4ztsl8ZVaYBjSewb0AS98TB84E5Xx-l9IsKhx3hypgCFI5u-CuC6vlmjVNdR-u-cgHTx1B5HTZpkTXIm5muqxIQ2lINhfQKQsl6YzCKMzLGNxoUMxrl7OJKpqEBCRxUu7A1GrsiWto",
"types" : [ "establishment" ],
"vicinity" : "2700 F Street Northwest, Washington"
},
{
"geometry" : {
"location" : {
"lat" : 40.782820,
"lng" : -73.9591570
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/museum-71.png",
"id" : "aa09742d854b00192daed833e2a56750587e8185",
"name" : "Solomon R. Guggenheim Museum",
"rating" : 3.10,
"reference" : "CoQBcgAAAOrwNzRmsnbhv193CwDcwpw0PlTBBEGoYm6ksdTk5Ro73hmIJnRsOqXHvfKrDoXCLC_MHwW9gjEEp_t789Afn_sRj8dn1IlQJ8TontYBEf-pLXmNNt104Y14fAsHykQ2JyifjuUoCsykKt_E04AIM2A1H939uAMJPc6R0VEgaZNYEhBCqGL-r9yCh4zZjLqafPekGhRE0aNDwrGBz9XYHMmeudjhFjlsIQ",
"types" : [ "museum", "establishment" ],
"vicinity" : "1071 5th Avenue, New York"
},
{
"geometry" : {
"location" : {
"lat" : 40.8042110,
"lng" : -73.96284199999999
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/worship_general-71.png",
"id" : "b7f595c8882d8b5c347f124cb06be5a18ba794d9",
"name" : "Cathedral Church of St. John the Divine",
"rating" : 4.0,
"reference" : "CoQBfgAAAFuadX23-mmKRnASp9ylUzW0Ghz3d8CuqZ55tX2T4BrODOTVDpOZn55xKqjuemfE-7hrdYOfaLff4RKkEzCkbhTR5UX8iGDCcMHQq2O7aWoqA2tsa5dCBkta8eTy-Bpry8zf2iaRVEZbx1Wfq2Xg59vvu07bryUX4sPVNRO5wKkyEhAXHfHMMaiMKjkvhezqXDk1GhQMHvS79gfVmdb2EQYKWL3df6Y-ag",
"types" : [ "church", "place_of_worship", "establishment" ],
"vicinity" : "1047 Amsterdam Avenue, New York"
}
],
"status" : "OK"
}
API doc here
Call this url to get above results:
https://maps.googleapis.com/maps/api/place/search/json?location=0,0&radius=5&sensor=false&key=[insert key here]
Anyone know why it's giving the above results?
Oddly enough, I've been to all of those places... I wonder if these 0,0 results are session or IP-address based...
This must be a database-error, I get the same results for 0/0.
I was playing around a little bit, for 0.1/0.1 I got this funny results(note that the markers are really at 0.1/0.1 )
http://fiddle.jshell.net/doktormolle/aZrvs/33/show/ (I reported the wrong markers, maybe they will be removed soon)
Places from Brasil, Mexico, Belgium, Germany and China now are placed in the gulf of guinea ^^
When you click on the markers and then on "Details" you'll see that those errors also occure on the official google-places-pages.
This appears to be a bug in the Google Places API. I have submitted it internally.
For future bugs in the Google Places API you can submit them through the Google Maps API Issue tracker as a 'Places API - Bug':
http://code.google.com/p/gmaps-api-issues/issues/entry?template=Places%20API%20-%20Bug