Skovvuri / travel-mate

https://skovvuri.github.io/travel-mate/
MIT License
2 stars 0 forks source link

Investigating Places API #20

Open Skovvuri opened 7 months ago

Skovvuri commented 7 months ago

You can add everything related to the issue here!

Kirila https://www.youtube.com/watch?v=Tva5HvZLN7g

https://stackoverflow.com/questions/54505814/using-fetch-with-google-places-api

https://developers.google.com/maps/documentation/places/web-service/search-text

// Example code to find restaurants in a specific city using Google Places API

// Define your API key const apiKey = 'YOUR_API_KEY';

// Define the city name const city = 'New York';

// Define the type of place (restaurant) const type = 'restaurant';

// Construct the request URL const url = https://maps.googleapis.com/maps/api/place/textsearch/json?query=${type}+in+${city}&key=${apiKey};

// Make a request to the Google Places API fetch(url) .then(response => response.json()) .then(data => { // Process the results const restaurants = data.results; console.log(restaurants); // You can now use the information in the 'restaurants' array }) .catch(error => { console.error('Error fetching data:', error); });

Skovvuri commented 7 months ago

So ive created the project under my account and restricted the key to specficially out deployed github site. will get this reviewed by Donnahue later to make sure.

NOTE:I have not restricted to what api this key has access too.

Next is to try and test implementations of what this key can do