How to check if REST service response is empty?

I need to know how to check if a Rest Service response is empty. I found another post on here that said to use if(data.length == 0){} but that does not seem to work for me. Is there something I am missing?
1 person has
this question
+1
This topic is no longer open for comments or replies.
  • Hello! What is returned in response? Does the method you've posted work if you expect array in response? If you expect an object for example please check are there obligatory (those ones which can't be empty) properties in data object.
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • This is the response I am trying to check.

    {

    "html_attributions" : [

    ],

    "next_page_token" : "ClRPAAAAPuQcitIJtXNDNrVRMMV4pWHloTJJd-YRmOWIIZPaXzUVC7Mr9gPVgPo6dd2LYirn9NzKT0YRjVPA0wKdfvdry9C7XQoCToWXdSa05bh9j8ESEBD5EYjb3YUHVsnJ6Dc4UfQaFE0sZQ3CZrSFdivlYl5v3rbDscgi",

    "results" : [

    {

    "geometry" : {

    "location" : {

    "lat" : 36.108778,

    "lng" : -115.151727

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "9cbaa1bdd0a69444c27605f4bc74d69f9e36833b",

    "name" : "AzuzA Hookah Lounge & Cafe",

    "opening_hours" : {

    "open_now" : false

    },

    "photos" : [

    {

    "height" : 198,

    "html_attributions" : [

    ],

    "photo_reference" : "CnRqAAAAuS7R6TKxKmQKks2cbtQITvMVqUw2dgyik6X0GXmycUCtBPQcUAn_N6HRCohYW3krdcihk1L7cqVcvaltsOknl-14AAltrogCaKgNf89aCqH4Zvxvae_xmZICGloKjolfXJ0m3HMNe9h40jsWazsEIRIQZ5cswgOoxDdAPMMWW-aODhoUBm83lQeDSDH_LJUoHViVSsZockU",

    "width" : 246

    }

    ],

    "rating" : 3.5,

    "reference" : "CoQBfAAAAAySY0UnOlumS_vmV_r_JwGgHcL10yY6mb5NGKgy4EtWpKPU7bBhQyRMlixT7-BBMw6QkvaN8fVA7hed1gWL9V4sh2TfR6DOi1Lb8_MDYEkaJVI5nz2yQJdDKbamgoXcMEa-TybzGAe4zqilmBjFEDCKiwoxrOYMRLCuStTumLrpEhCnTvWPg-oeu3DYSDo_tZOkGhSLJq7xIVDH2CWQrL_R1o8dHRbcUg",

    "types" : [
    "bar",
    "establishment"
    ],

    "vicinity" : "4480 Paradise Rd #450, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.071878,

    "lng" : -115.09046

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "2fa2b49bd16f28d69edee65b8339ad1972800d6e",

    "name" : "The Olive Mediterranean Grill and Hookah Bar",

    "opening_hours" : {

    "open_now" : false

    },

    "photos" : [

    {

    "height" : 542,

    "html_attributions" : [

    ],

    "photo_reference" : "CqQBlwAAAH76jhAvNP_TLS7EfhgGiOWGlv1LEpqdfjI8tcvOVPsLLlI3dpEPSACs7FKw7qhrblE-evn1iSX-VdVow9FhvGRmcfonFolN0oDl6bHLnmtoF-jJ2sli0WbPBRmfADYKUr0NFyqzH2atUr-Z8FYC2qWYqE6lqsRZQhsuvhkOhWPEu-7dL4HqV_5M_Ih4Y7P7nmmOnL2RKwunUymiAut51vQSEOOGLCx-80b3BdpzqgjiyQQaFOPz7Tm5ElDkdOwY4ohx9AjaDTKD",

    "width" : 300

    }

    ],

    "rating" : 4.2,

    "reference" : "CpQBjgAAAH_bh79oBdWIcHbMSK9gh85T7bOuoRprenJtDwVAHLQLFWYpuX6oVCGSkjp6-CpeIwRBRa3KVWwjHK_Huje5t5PoN02nGOIMc7fFsGQ4A3WjeeRpyHEN46omlNxAUJ1ydgNTx1ul_IxKNV-QVrQvn3TlAtDiXRcuRbk96_p9RyAOiIwkifQYSfewL8q_smYJjhIQdrXLnhtGQkuVRY-oY2-8LRoUzAkkgpTyRMU--P9t5f7h067Zt7A",

    "types" : [
    "bar",
    "restaurant",
    "food",
    "establishment"
    ],

    "vicinity" : "3850 E Sunset Rd, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.108938,

    "lng" : -115.278211

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "8c73db77f05e908e55f6d34c6cedab0e825bf2f9",

    "name" : "Kaliopi Hookah & Lounge",

    "opening_hours" : {

    "open_now" : false

    },

    "photos" : [

    {

    "height" : 720,

    "html_attributions" : [

    ],

    "photo_reference" : "CnRnAAAAUoEt_BPztETw2-9f4bCs5learReCUCiIy-APTotC0y4NUH3PQVAEncPJ2qCyunNp8lHnBBHhEr5q3iz1MLQV09FWqxw82mcxjLpzqU-sKooaCCAM5j6obGwJ6Fe-MM2cUDSdYnhTTZpQBiX0vifGaBIQEBYLlXY6aKuZLQmhoDKq_RoUiFVYdtF0UAoOdEHYAvk0ULvTImI",

    "width" : 720

    }

    ],

    "reference" : "CoQBeQAAALHmTkX5DQSHq74t0nsHVcW2kPo8nvC6L88bJS92HvNzDAza1mN7TjJ3btlRnc_EshNo48d8dtp8iN_VIF_tQTzCrZe3YpENMrHXzUoZLKDritUTlW4hNoV97l0M15DhORCaIum4-V31QxsTQQjxMtEmQqtweEVl6mllj1AR1ZPkEhDaJhY0yDQm7obGNycGEwJeGhRz73uex4LMDJZNR3Tm7kxTj8vvkQ",

    "types" : [
    "bar",
    "establishment"
    ],

    "vicinity" : "4440 S Durango Dr, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.159551,

    "lng" : -115.222214

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "945c2bd47f8968fcd3a801a2288d1c71eac9caed",

    "name" : "Hookah MASTER's Lounge",

    "opening_hours" : {

    "open_now" : false

    },

    "photos" : [

    {

    "height" : 1536,

    "html_attributions" : [

    ],

    "photo_reference" : "CnRnAAAAX6S1Wjv0lV4ll23rzph6HNgvYB3ozODWyKS2KC7obth5q6udsqTIhq-TOsErApiraBUzyzFTZg8g-SICd7gVuskTYQ5j9ao2OJbEq3cK6jhw7wtKCcSx-UMfEnELA8PwovELzEJ06ZJqOY5LUgDNdxIQfNmhoY7aAjBvLcxF1mt9ZBoUz5Yhcf7xebY68ee0b-l6Ic30J10",

    "width" : 2048

    }

    ],

    "rating" : 3.1,

    "reference" : "CoQBdwAAABOEOSPqnPN886SLgul_lVlXDZV-LvOjlIG-yhzdmybSJi_mxmrIdgPUOMvSI3ren4wmviyasI9gdbve7TCUCLgOQRR8vyMzCwfdgQBtCklj2EjPvqpPgDifNWdSkduhBeeAl80p-2mj1cWiaOY8XGY_Apd_6grZFEJkRG24hZGjEhBMl7bvccm-pMpSlWb_PZ2nGhSnsBr5PY-gwmHts9MoHi2F4sOJGQ",

    "types" : [
    "store",
    "night_club",
    "bar",
    "restaurant",
    "food",
    "establishment"
    ],

    "vicinity" : "5900 W Charleston Blvd #8, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.100974,

    "lng" : -115.103015

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "034479c280a2bcfe4828c93df1fbf71cfa8a1db7",

    "name" : "Red Hookah Lounge",

    "photos" : [

    {

    "height" : 1024,

    "html_attributions" : [
    "From a Google User"
    ],

    "photo_reference" : "CnRwAAAAi20H_p9fDKZTk5wreJkbD83aMIOxh2kV6-qw_a0_mMSWTTk65OB-DRRnVQK0pIqV_GXnEw58IkeuWjxwjC1BFTY6UP3QzELcjP0ehXinDZAHvAyHxjQBrXaXR0NsPDQyI2687YiWbao1Xi6IJqQFOBIQ1oQ-_zwjYpSVYXNNp6YEthoU9X_l8IgXN_h-g2U8Eu0OSRU_JRc",

    "width" : 768

    }

    ],

    "rating" : 3.5,

    "reference" : "CoQBcwAAAK9D_tSUQt1ttc2zb638tCZ1WBnhepqlgm6EVFxbz_CDyLh2YLp5AcvbjndN6wRS0jJhTchNXkQh1YnLDQUrBhBNVsUtZUfgtz3KMrl0jzUFnbCME54PCrJwGzFpLQw-S2iTIc6Z0uhWXar5vsqypSGYx8yOyvafmD2hcLehHNRsEhDW67getVEB37dMyoWyNA5-GhTAgUGgaulKreTPt72enHns-nTqgw",

    "types" : [
    "bar",
    "establishment"
    ],

    "vicinity" : "3330 E Tropicana Ave, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.123589,

    "lng" : -115.207504

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "80b416fa7a907bc9d7cb9e09c95858eb308a0a87",

    "name" : "nubius hookah lounge",

    "photos" : [

    {

    "height" : 296,

    "html_attributions" : [

    ],

    "photo_reference" : "CnRnAAAAsdJlW8K0JHaEEnuqblCvG0aX44PKUG2zH27XXDVs924WnVKhFhImQxiWtMcpu_HfKtpf74hAmZOFbjz0nwps2Jrco-y31KxWFMLpMUbV75KQO8DO1cCYua71yf2ruy4Waw3fnNfXn66Nhdm9NjFctxIQHszX3r88k06WRRzq7rirAhoULXiJ0gVoXROQM5rCyGQ3ALaZxpI",

    "width" : 500

    }

    ],

    "reference" : "CoQBdgAAAEm8siKioWK8puWg-W_giyuTofvVRqtU5DmMbbEljsPtzP34Gonto5jJYIT7hTnm5STBGyw1f2MXx4z6DV6HoOkzUzNxjvqY1bwsT_2enoR-YmrJ68Ud3Y7qhFgjlrre-P_HIB1a7KsklDbXHp2HioWREGdFur41iFFjJZVjemvkEhCsxKOF79jz7XwFZh6MIM7XGhSYWNFY8r3R1VmKnCrDTV_yobPSwA",

    "types" : [
    "night_club",
    "bar",
    "establishment"
    ],

    "vicinity" : "3650 S Decatur Blvd #24, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.159467,

    "lng" : -115.232895

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "dc2c50d440693c7a3826a4d671d6424dfe3c986c",

    "name" : "Azuza Hookah Lounge",

    "opening_hours" : {

    "open_now" : false

    },

    "photos" : [

    {

    "height" : 853,

    "html_attributions" : [

    ],

    "photo_reference" : "CpQBiQAAAI16szysbsv9KZz-A9SYC_3A_KLMWy5A2N-ZjJb3hoTFGztuCos9cR_zOomcjketcnaXCB9JBEByegVtd7pBdZWvP0aTTKdPXL5zki8h89fMjNg6bGv5CbZZCP-_9nqacYPMFT8kJ0NsNtKXqQCItde_s07dzr6pzl10rn4nKteAzFmD7VH-B7oMLyXsbV0R0RIQtXV1CP_pBenC-beNdAaeCxoUbDfo5QD-JjOIt43fVbQQUHKlvAc",

    "width" : 1280

    }

    ],

    "rating" : 4.2,

    "reference" : "CoQBdQAAALBWuoSqTWCumREbzD0vIZfxGyjhQsnQ6BAURLD5OyzO0E5I85jpvUJO_KkgR1vZuCTMYuNifbuqdt9niqJTjSvInemQljynIYzCUX_hG1acJvZ8veY9hv0X-cgkq4VBxY_ajR77crm4xo7KeyjQLzXjdDLdW1H-IfD70N2MN2V2EhBuLsITv9yRwaxgLeN2UXVcGhToT_Z25711aTuqNBjHEjbDnrItKg",

    "types" : [
    "bar",
    "establishment"
    ],

    "vicinity" : "6340 W Charleston Blvd #140, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.144724,

    "lng" : -115.273924

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "1db01ee5a830e7165b794a2beadb820a2f68f1e0",

    "name" : "Paymon's Mediterranean Cafe & Lounge",

    "opening_hours" : {

    "open_now" : false

    },

    "photos" : [

    {

    "height" : 853,

    "html_attributions" : [

    ],

    "photo_reference" : "CpQBiwAAAOKUPa780jSQTHqqUyB87B8S_Q6gVQBE4SxgDhanwnkTpUfv9BFKd5IjXp4ndcqFIE9J5JZS-0OYTRuZqxhQG8yigfVUoN9_J43jE7RP3oFbwIvnJmN0yZvjUNkmf6iNtV4szy-b-RzQEGKwumESYyyv2T_IeANEUbDwLgGX2VhhvrPiWM7MOi3rVtGK4uqjThIQ-hmC3po1e-oE_NYbn04B7xoUjVGK6EP8Hi5zo155C1b9d7r5uKo",

    "width" : 1280

    }

    ],

    "price_level" : 2,

    "rating" : 3.8,

    "reference" : "CpQBhgAAAMOM5LollwcrJyW-JYXnLXyjysf0YrvMtO4wbXz45Q3DsJuW8ANiSTuo7XZjP8xGPeODAA1jM4Pjl2-U1B79jS5bQzPw5Q6xiXhZawePayvBI7jzkVEA87mYmzuF7tcJPaQQ6Y8M_wKjF8N2dfo81vYfH24KI6l6yFH0MK9YsVqy8fHiguoNYAFoi_NMmIGvuxIQjwRgiUbwuniZugLCCHbSVRoUE-H1YO7jlKTKXJxs9-m0MXG8B5c",

    "types" : [
    "cafe",
    "restaurant",
    "food",
    "establishment"
    ],

    "vicinity" : "8380 W Sahara Ave, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.113236,

    "lng" : -115.29727

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "428077572f5c249eae093e0aa9bc5b0c6d083f88",

    "name" : "3Kings Hookah Longe",

    "opening_hours" : {

    "open_now" : false

    },

    "photos" : [

    {

    "height" : 488,

    "html_attributions" : [

    ],

    "photo_reference" : "CnRnAAAAX0jSOUNdaO_kZ5dObQVYbmOQXDwL_FAPrmGUR_RCuTKmKa0eFf0P3X03jtXL5HCxLaTcZ96MsK2INFuwRbR_jh_zqGCfx7v1Nq0qGJ2rQEwxN16tPQEc1PAFxn9jZY1KaF5x1vkDDz_ZbMD7cgqcRxIQpCpPTGBrJJGlzbgbnyVVfhoUFUElfORpL-R5UkQ787yE9zilreo",

    "width" : 723

    }

    ],

    "reference" : "CoQBdAAAANE1YaiiRMS-2Z5D73yoOsWVUUuLSuNupY2ALb-tXXdOfStX_oax4LhVsztJwiX4sDnVb9zL9hdCoBB7dts002iL2gpYCE20E9q1vyXc6voPsGZyCQblRMmmgsN4Aoa6Jth8bD-3_FtJVC6Ei4w32qb1dc7YO0N6WH_tkABRgLghEhB8mZ-1ajAVL8wXXaQ6NdlxGhRyEZwldOf26zhgoJ-Jho7pop0PWw",

    "types" : [
    "night_club",
    "bar",
    "establishment"
    ],

    "vicinity" : "4199 S Fort Apache Rd, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.125162,

    "lng" : -115.297648

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "d38456d60e19a4d3c136ee649dbdd3732c2b4972",

    "name" : "Joker of Clubs",

    "opening_hours" : {

    "open_now" : false

    },

    "photos" : [

    {

    "height" : 720,

    "html_attributions" : [

    ],

    "photo_reference" : "CnRnAAAAthrJOs5Ezcd442MEOnJL7nwSaYAy5oYLKc9wFFFn7DIUAz4cg0Ezfv-V4kFEChhzVxBkpcbwL1-YRdly8fkpy-IfxZOLBcdTYnx7OwIg8PpGFlTZiIXY3NVnP8ZO-HzGAZxDtdWaC4HCv6fs9nwytRIQhreemwRV0cL6Js83pcxmjhoUz5Gzr3744-6zTQ3UPuKV0jr9_F4",

    "width" : 960

    }

    ],

    "reference" : "CnRuAAAABdJS3pUQQM67uKyZlA78o_5RLPk06IHepIoMNF7ngiJSUhkxIJGfiQeGsWNkaZvpHIrJswsyQDK6To9A_ZXvLUdMBzYQ1NX98aIXjPQbt9Rnvho7cla8onaRZNZxvI8vTTLrOCjnI4TUStRfR7rt-xIQro8l4sXRRD9IcJXZfNy9eBoUSDu8ahd5gvg5GrMEjr_EP6R2rao",

    "types" : [
    "night_club",
    "bar",
    "establishment"
    ],

    "vicinity" : "3555 S Fort Apache Rd #136, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.145892,

    "lng" : -115.189124

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "fd4dc8fae913305db6e969d06ad39a751f1d5a76",

    "name" : "Hookah Empire",

    "opening_hours" : {

    "open_now" : true

    },

    "photos" : [

    {

    "height" : 199,

    "html_attributions" : [

    ],

    "photo_reference" : "CnRnAAAAtr8oNnlbPQuR4Qg5uxGKYCXSzcSKPMAA67IAACDKMwK4gWJdNzh3EtKuimGSELWh7Yq3CTXz1X8cVNCS1OX347Ra6qFPsuZX_5dzad6rCUzfYkn-D6v5d1x-434EBzoiddHCha7-QVeBfBxNK4mYXBIQs9uuLlOW81F6cg3zG5UDGRoUT0eG4eyvFAPYgQA61QwTJokv39U",

    "width" : 209

    }

    ],

    "reference" : "CnRvAAAA5_G7Vr8VDUYk1ZWMoxbcFY6jMwt3Kz63wFwp05YuGJdyl3LUsABkSt3_dzZCLZvL0fdj-awy4doaGaO1XoogT6vIH0AhcC-j9N6Xkg4tNx42Hr_FCjqhxrG3LI6BAUNqntGn1qvIZfB4_4AoUZ3UJBIQ2f0sUPrs-3mwmh4pEJqW0RoUOPT4mCielcmrpabOmgxDbvjdozg",

    "types" : [
    "store",
    "bar",
    "establishment"
    ],

    "vicinity" : "3540 W Sahara Ave, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.159749,

    "lng" : -115.232661

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "afcc403c25380dec8defff65789476b8ec936022",

    "name" : "Blaqcat ultra hookah lounge",

    "opening_hours" : {

    "open_now" : false

    },

    "photos" : [

    {

    "height" : 1265,

    "html_attributions" : [

    "\u003ca href=\"https://plus.google.com/1178929483171... Hookah\u003c/a\u003e"

    ],

    "photo_reference" : "CnRoAAAA8fKvfU3e_XzU5HK2-6h8bgpcZSyOlcpUGzE_o85f6SMmaVEvdi4O8zx2hnfoTkWvA4SKDYFhKmOqyquCthtAg-SdTXbgwnXwh5Y8H1547rLYswUAshGQSNsMRLDF1ZSiJpYco0JaKmAEeszvLilV0xIQLsgocTlvzqdKQInsJLMGaBoUVF9bMeyUFSSA4jAyzZ5XIDb56do",

    "width" : 949

    }

    ],

    "reference" : "CoQBfQAAALTeqn4sb3juM1BYMF7tITwfnDnVsqkFigGSxYOyVfwvd_9xsejkttMSoHN_pe2hsFCF7IH_LB_5zk6t3rcil05zCkMvrLPV3LsMiVciMNZdkHT2NVfi6S-mW-fnS_5uMiQ1KWlFbdjnhGkoMVcevIOBaSQa_AmAErJaq9wZnb2cEhCNynKtagX826MhdAvlERLeGhRkX6nLzWPXyqiyK3Yhs1PBz9s-kw",

    "types" : [
    "night_club",
    "cafe",
    "bar",
    "food",
    "establishment"
    ],

    "vicinity" : "6340 W Charleston Blvd #140, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.114992,

    "lng" : -115.221988

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "891b0a56a5ead6c2299114088639e68e106d86cb",

    "name" : "CEO Hookah Lounge",

    "opening_hours" : {

    "open_now" : false

    },

    "reference" : "CoQBcwAAAFmWaq1v1aNhJ076btgCfXcgiTW7j4Cdux9VkKYRvODd7oPrVfEcePYdGAKubOwp8dqxr1p77SehN-kLawUCCnCGumQb5XIleFHjledt3Mggty5l8dvzYM4DLqEaG3s1npeiFlouZ549KhiqWohDx1NZHk6Y4ouOKeezMBL8PzDlEhAg5kVbh3VkQqHFMt4xLKHZGhRjC56bRSduHuYq5a9eJDaCGG5c3g",

    "types" : [
    "bar",
    "establishment"
    ],

    "vicinity" : "5900 W Flamingo Rd, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.057271,

    "lng" : -115.128918

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "7fe0c6bd29c1a55a5c6b227083d6207d7cea8b01",

    "name" : "Legacy Hookah Lounge",

    "opening_hours" : {

    "open_now" : false

    },

    "photos" : [

    {

    "height" : 720,

    "html_attributions" : [
    "From a Google User"
    ],

    "photo_reference" : "CnRoAAAAXthj4IbsjAPqHgFC6jbzsTq2okc0oZj7hS_PCHUTRiA0IZ6rJjPC_MSUmpYL-j8JkbiJUL20EkOMIC0PlUmZpIycNbV321baxhleGH05e5bUpyfmgWLOrewBR2QHQZQ9MwK5ZmMQ8E7TDFtN0SIKyRIQri5LqwKfAnSXiqjX8qdyuxoUzHzWUktu0cVgAbklagcLPVAvoDc",

    "width" : 960

    }

    ],

    "reference" : "CoQBdQAAAIm32Z1IVp9_sV68FGuwf54W_ZDNHVipyaMxtXOA-hKgcGoscuEUfH6vG6HW9ffs9Y4djJNwe9Zf1KaIOWVJmazRK8CfmSwy7JCPQvcuuqAxB3AvYdIP0mvt9DE5Z_y25eFhDsIZV_WrnqvZE0dUyiLNpspWTV_0phPOQ6CDSVc-EhD68cWUTMaTyKTiLcrEfvUjGhRTtvyOdDVh--PpMpHxWHPAnsizCg",

    "types" : [
    "store",
    "bar",
    "establishment"
    ],

    "vicinity" : "1725 E Warm Springs Rd, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.116938,

    "lng" : -115.139303

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "37f0c3e6a2a234f345a418494648b89435d79955",

    "name" : "Hookah Palace",

    "opening_hours" : {

    "open_now" : false

    },

    "reference" : "CnRuAAAA64YKyfJYUNBkQkYtSZoxXZyO3qyIKMvI-4K7zVT6kxZNnPd2s0N4RAUXSoviHI_osC4oncvSVhoxw46BIFUb_KBeI7sVJHIuoiOhATb_D6WOukyjrIhnRmXvehGDEF4_v0fs9k5hwipQNZCVPE6HlRIQ5jmos7g0-xfNzyLLfBATJRoUnK7Rzvnq6xp9m_0hluXJVbRUIuk",

    "types" : [
    "night_club",
    "restaurant",
    "food",
    "establishment"
    ],

    "vicinity" : "1030 E Flamingo Rd, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.143242,

    "lng" : -115.244849

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "ff00f537e81bcbde5115f14606c3abdffce1b845",

    "name" : "Kaliopi Hookah & Lounge",

    "opening_hours" : {

    "open_now" : false

    },

    "photos" : [

    {

    "height" : 1200,

    "html_attributions" : [

    ],

    "photo_reference" : "CnRnAAAA60AnT75p_wX-81X-dTVMojZLDclp-lcIfQIYTwwpjoL-4SIg4rQ9t6Ir-azGP5VHK4hpyb021FEw_AHNNeqsZHAFJhsGuYR4wBsTVNuKPbjcSSPTbShLOIsmqXxlk-RAN0TYe9C_nN4c5MzQpK3ovxIQ5Sh2WPpmt6N3mV3hAtrMbRoUr5ctc3uvev-93MEJCXlCBPq2j4E",

    "width" : 1600

    }

    ],

    "reference" : "CoQBeQAAAK-CmuJBts2PgROMbNjCM5dCco6IIUHRZiYtOGuUhYdgQTslwr9eV055wG8__HLKgMvPTY16uszxss8jKzG190_GJ6z6qIvpvuHIxg54mIogJsWUPwUO4WXnjwUVFZ7hgTbMJVWPYcbYLCLqBU5e19MGmmsgEkyL_oVv3cZANT_OEhBT-Ym7MaAZCQJCcm3RHEN_GhSivUcqxF4xtYvCOED4HuzEmL7qSQ",

    "types" : [
    "night_club",
    "bar",
    "establishment"
    ],

    "vicinity" : "6985 W Sahara Ave, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.114646,

    "lng" : -115.172816

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "d2ad3b1ed8c9d1a7552c1d5c110609a322bfc151",

    "name" : "Sexy Ladies Of Hookah",

    "photos" : [

    {

    "height" : 526,

    "html_attributions" : [

    ],

    "photo_reference" : "CoQBeQAAAD8_6Jy0RlRrrD08-10Rkughp6IXS1-uXvCrRnFvvIS4mIWACAi3Par089hxKxxOyob4kVMDXF6Zab99kjeR1vW4VJYx2p7hj_ORfsWnqe5YbGsyCYCnC4DeX2DeZ7Esusyv7XNue5BdJZHLv6hbA3QJQlrH9p5Uq3S9eylbjqMBEhDXl3qCk9MECo6dJWi6SiLRGhQAyZwvbF-6hjTdj_tDHv-0C-3kng",

    "width" : 499

    }

    ],

    "reference" : "CoQBdwAAALDujHyAJ-I4LQ_gQTp4QfSjbd2gaIZe1gBzrWeqVzt3-gdzs3HUK5JtHxwfrGJbFf6_W7-F6ZqZWcXqEdqnVkpoqrF8XJE6zz6XzXiRw4P12kIIppM0G-7CF8Qdws6K0TOv2aXu-7SOH3suELvjbilzuz2Le-7SkHgGXM9tBY27EhBSGTl1aTdADONt2zX8Dtf0GhR5LPi11pKdRkT-IXoaYUvcvjAUmA",

    "types" : [
    "bar",
    "establishment"
    ],

    "vicinity" : "Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.201909,

    "lng" : -115.241766

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "c5b6943514a89b51823aa5cd8aec96e00636841f",

    "name" : "ReEvolution Hookah Lounge",

    "opening_hours" : {

    "open_now" : false

    },

    "photos" : [

    {

    "height" : 900,

    "html_attributions" : [

    ],

    "photo_reference" : "CnRnAAAAegQn-wrBP-jVxFqim69I5d42nULAAvhPqUO7Y5wnS5pKQ3J_EoDZC3jwh9WusdiV0BvoGDjNw_ZqQkrQOzmVhhC0_LKq0NtBNiBPnjjZrpZb-QCDm1kptVdblBGmPmhPaoiYe4JD_5Nf3sfcmnGXQRIQbXn0-5KvQ88RxOww_4hO3hoUvrgVdnyuIxmLBOZ2ygPXGXQ06rI",

    "width" : 1500

    }

    ],

    "reference" : "CoQBegAAAAvsihC9YRt-WfEuwwMj31WSt6kQTIFkUf9HSa1CKry2CWuyRWQ2NBZ_m7EgMt2BjM8nodrKhIato9CSTn7cB3ZrQrJyJV--lso2Samr0tNf4yEGDO9enwiyyzyzEVIeYFYXM1TCZ5u2meW5kQ2FUDu7dnLUlLHGyUMuP8gMjW0vEhAx0YlGugL6rKG9qJHtNN4UGhSw5ksubBx03Pfjll7cONMfB9GuKQ",

    "types" : [
    "bar",
    "establishment"
    ],

    "vicinity" : "2300 N Rainbow Blvd #122, Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.114646,

    "lng" : -115.172816

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "d1a865c85d177ff59b467b5677dffdaa15601818",

    "name" : "Vegas Hookah Party",

    "opening_hours" : {

    "open_now" : false

    },

    "photos" : [

    {

    "height" : 350,

    "html_attributions" : [

    ],

    "photo_reference" : "CnRnAAAA_LwFP90BZfbHt_yXE4DKnlD-1udz6zhtigcCqJ2odx1SsDP6bRfaN8DEFqkBufiAJA4kppg_mNw0EqehaXvlVc1Dt1fjLZetJFP-kLLD5vbmystnWCLOnSkkpA7LFxEc-KTku-F1HbDY9zgDyeh1pRIQ6ZoAukb-3e9XyMGJrsmIFhoUCo46YexlFNMpQLnvmgj4FTpfXdc",

    "width" : 512

    }

    ],

    "reference" : "CoQBdAAAAPtLmk-so5BLBROAGl9YwVGuk5SLwuFCeEK7MFbl2RXKT2WqGrMhpyJnmuLBsrqwjR7Q_bUPFKffAnx41XnDvYfrge1gemsD4VtbbiNv0BD2j8Wr97WZ59vwq0trSSeX3S_0d1TOINCyyGllc_IBfOew32dcDEVKvwR1ZbCLfLG0EhDIdH_3OABZxUb04fORxOaOGhRxKPKNm_AeppJlmZFWIyYdxB_EpA",

    "types" : [
    "bar",
    "establishment"
    ],

    "vicinity" : "Las Vegas"

    },

    {

    "geometry" : {

    "location" : {

    "lat" : 36.113677,

    "lng" : -115.138254

    }

    },

    "icon" : "http://maps.gstatic.com/mapfiles/plac...",

    "id" : "be5f5002efc79fabd78ab905943852da13af588c",

    "name" : "Paymon's Mediterranean Café & Lounge",

    "opening_hours" : {

    "open_now" : false

    },

    "photos" : [

    {

    "height" : 107,

    "html_attributions" : [

    ],

    "photo_reference" : "CnRmAAAA5QsWfN6aruLuERyIc0S1hrUnGaFy9ibH8IbAW2sdNyOmje2Nxu4DxKjzfi4a30LH8HfmdbBkekPzN-tYpGJmeMrkitod5SuIJnjdH1A3vStMIHMSZk1Fg6K7svl7PJwGU2_Sv9Im8qLarWFe1aUplhIQ6qU7Q52O806oL8N4agWfpRoUtbn0UL7BdHY_LDkaR5cjPkQ_s2A",

    "width" : 164

    }

    ],

    "price_level" : 2,

    "rating" : 4,

    "reference" : "CpQBhgAAAM7PULQLkGzWcCcZ-eAW-XqFUVgFmt9xPNmbv6dA4CYtoq_DG9klH6cf8cC6YAIf3Rb5KuGXB60pZ1eo9TVIsPbzrubcr0VaKn6iEEUGEk8bNzBROFKnq35MD6IQ3WpPyINQ6zwFj2A44ZcdMHpBV6N-p6aVzs-wrOksV4a9NuuMNCt9ECwnOqugCevdVdPooBIQK4CGu6O9vUlwYE9mNXGA_RoU0yn3uNIhNKoNXb_ABqCPpU86aF8",

    "types" : [
    "restaurant",
    "food",
    "establishment"
    ],

    "vicinity" : "4147 S Maryland Pkwy, Las Vegas"

    }

    ],

    "status" : "OK"

    }
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • This is what the response looks like when it has no records.

    {

    "html_attributions" : [

    ],

    "results" : [

    ],

    "status" : "ZERO_RESULTS"

    }
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited

  • I’m happy
    Okay, I realize what I was doing wrong.

    I had to target the results data directly like this.

    if(data.status == 'ZERO_RESULTS'){
    // do something....
    }
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. sad, anxious, confused, frustrated kidding, amused, unsure, silly indifferent, undecided, unconcerned happy, confident, thankful, excited