Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7738743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T08:20:45+00:00 2026-06-01T08:20:45+00:00

I am trying to use the Places API and I was initially trying to

  • 0

I am trying to use the Places API and I was initially trying to use $.ajax from jQuery but I kept getting an unexpected token error on the first element of the file. But I realized then that you can’t get JSONP from the Places API. So below is a sample of what it returns, I can’t for the life of me get it to print id into console (for starters)…Could someone maybe point me in the right direction?

JSON returned from Places:

{
   "html_attributions" : [],
   "results" : [
      {
         "geometry" : {
            "location" : {
               "lat" : 33.7862590,
               "lng" : -117.8531270
            }
         },
         "icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/restaurant-71.png",
         "id" : "5be9a13a28635cf8fd2ef3c62c24d51277a4ba58",
         "name" : "Kimmies Coffee Cup",
         "rating" : 3.30,
         "reference" : "CnRpAAAANKLoOHJ1STFaFavIPjm2bpMDneGTv0AXfixyl-koF7KSK-lQSldk3c01RFJu9Gf62zXnRScte-dkPCBU8KuxCo7AMctfuaIhNkPE8RKENF9HeMlkuEg-Scp97--1VWJvjpNQjc6xRvdXsbf7V8NrSRIQnXjZBKbrSeSg2sTwBosKghoUEFlNDIN5cnVbn5n7aNtwycord-E",
         "types" : [ "restaurant", "food", "establishment" ],
         "vicinity" : "190 S Glassell St # B, Orange"
      }
      ]
}

And this is what I was trying but obviously I can’t use it anymore…

 $(document).ready(function () {
    $.ajax({
      url: 'https://maps.googleapis.com/maps/api/place/search/json',
      dataType: 'jsonp',
      type: 'GET',
      data: {
        location: '33.787794,-117.853111',
        radius: 100,
        name: 'coffee',
        key: 'KEY_HERE',
        sensor: false,
      },
      success: function(data) {
        console.log(data.results[0].id);
    }
  });
});

Any suggestions would be great, thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T08:20:46+00:00Added an answer on June 1, 2026 at 8:20 am

    jQuery has a parseJSON method which will create a javascript object from JSON.

    Once you have this object then

    obj.results will return you the results array.

    results[0].id will give you the id of the first result.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to request JSON from Google Places API, but I am still
I'm trying to use wordpress api, but have unknown problem with my request: First
I am trying to use places api for google map on my website. As
I am trying to use Google's places API. I downloaded google-api-java-client-1.6.0-beta.zip library and I'm
I'm creating an Android app and trying to use Google Places API through Google
I am trying to use the Streaming API from php, I use the code
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I am trying to build a desktop app to use facebook api and get
I am trying to use Facebook Connect to connect to Facebook but all the
I'm trying to use the Google Geocoder API to get me a Latitude and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.