rajani reddy
rajani reddy

Reputation: 67

Google place api - application specific search

I am trying to do application specific places search with google place api. Here is how I am adding a place:

Request:

{
    "location": {
        "lat": 37.760538,
        "lng": -121.900879
    },
    "accuracy": 50,
    "name": "p2p",
    "types": ["other"]
}

I get success response as shown below:

Response:

{
    "id" : "dfe583b1ac058750cf524f958afc5e82ade455d7",
    "place_id" : "qgYvCi0wMDAwMDBhNWE4OWU4NTMzOjgwOGZlZTBhNjI3OjBjNTU1OTU4M2Q2NDI5YmM",
    "reference" : "CkQxAAAAsPE72V-jhHUjj6vPy2HdC__2MhAdXanL6mlFBA4bcayRabKyMlfKFiah7U2vkoCj1P_0w9ESFSv5mfDkyufaZhIQTHBHY_jPGRHEE3EmEAGElhoUXTSylMslwHSTK5tYdstW2rOZKbw",
    "scope" : "APP",
    "status" : "OK"
}

When I search for this place using radar search, I get ZERO_RESULTS.

Request:

https://maps.googleapis.com/maps/api/place/radarsearch/json?key=key&radius=5000&location=37.761926,-121.891856&keyword=p2p

Response:

{
"html_attributions": [ ],
"results": [ ],
"status": "ZERO_RESULTS"
}

Is there something that I am doing the right way? Please help.

Thanks & Regards, --Rajani

Upvotes: 0

Views: 288

Answers (1)

Scott
Scott

Reputation: 3732

Your scope is "APP". That means you can access it (via PlaceID) from the application that created the entry only. If the location passes Google's moderation process, then it will gain scope "GOOGLE" and be accessible from the general searches.

scope — Indicates the scope of the place_id. The possible values are:

APP: The place ID is recognised by your application only. This is because your 
      application added the place, and the place has not yet
      passed the moderation process.
GOOGLE: The place ID is available to other applications and on Google Maps.

Note: The scope field is included only in Nearby Search results and Place Details results. You can only retrieve app-scoped places via the Nearby Search and the Place Details requests. If the scope field is not present in a response, it is safe to assume the scope is GOOGLE.

See: https://developers.google.com/places/documentation/search

Upvotes: 0

Related Questions