Restaurants

FREEMIUM
By VidLab | Updated il y a 2 mois | Search
Popularity

9.5 / 10

Latency

1,875ms

Service Level

98%

Health Check

N/A

Back to All Discussions

Getting location_id from address / name

Rapid account: Nickmischke
nickmischke
il y a 6 mois

Hello,

I need assistance in retrieving the location_id for a specific restaurant. I have the following details available:

python
Copy code
starting_details = {
“name”: “Olive Garden Italian Restaurant”,
“formatted_address”: “538 W Main St, American Fork, UT 84003, United States”,
“geometry”: {
“location”: {“lat”: 40.377269, “lng”: -111.81243},
“viewport”: {
“northeast”: {“lat”: 40.37856612989272, “lng”: -111.8112685201073},
“southwest”: {“lat”: 40.37586647010728, “lng”: -111.8139681798927},
},
}
}
Could you please guide me on how to use these details to obtain the location_id for this restaurant using your API? Is there a specific endpoint or method I should use?

Thank you for your assistance.

Rapid account: Nickmischke
nickmischke Commented il y a 6 mois

Thank you for your prompt response. I have a few follow-up questions regarding the use of the Typeahead endpoint:

Does the Typeahead endpoint support retrieving a specific restaurant using the details in my starting_details dictionary, or does it return a set of restaurants?

What are the available keys for the payload in the Typeahead endpoint? For example, can I use keys like ‘name’ and ‘address’ directly from my starting_details?

Is there more detailed documentation available for these endpoints, particularly for the keys that can/should be included in the payload of the endpoints?

I found the API playground on RapidAPI but haven’t come across detailed documentation. Any further assistance, link to detailed documentation or a code snippet illustrating the correct usage would be greatly appreciated.

Thank you

Rapid account: Ptwebsolution
ptwebsolution Commented il y a 6 mois

Hi, this is the flow:

  1. call the Typeahead endpoint (to get the location id that will be used in the search endpoint)
  2. call the search endpoint (using the location id from the Typeahead endpoint result)
  3. Now, in the search results, you have the location_id of each restaurant.
  4. call the detail endpoint (using the location_id of each restaurant in the search result)

Join in the discussion - add comment below:

Login / Signup to post new comments