title: Sending a details request to Google Places API - (CORS error)
body: <p>I'm trying to augment the collection of photos I have for public artworks in this project I'm working on with photos from the Google Places API. It says <a href="https://developers.google.com/places/web-service/details" rel="noreferrer">here</a> that you can send a details request to get an array of ten photos. Eventually I will unpack the response to get Google's <a href="https://developers.google.com/places/web-service/photos" rel="noreferrer">photo reference</a> for each photo and make requests for each photo in the array and display it.</p>
  
  <p>Unfortunately, this plan breaks when I send my details request. This is the exact error I'm getting:</p>
  
  <pre><code>Fetch API cannot load https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJ5zf5lfXKRIYR8rPafbwaL68&amp;key=MY_API_KEY. 
  No 'Access-Control-Allow-Origin' header is present on the requested resource. 
  Origin 'http://localhost:4040' is therefore not allowed access. 
  If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
  </code></pre>
  
  <p>I'm running this from my localhost and I'm pretty sure that matters. All of my other API calls (Google Maps API and a couple others) are written exactly as this is, so I'm a little confused why I'm getting the error. Here is the relevant code:</p>
  
  <pre><code>The actual API call:
  
  export function getPhotos(placeID) {
    let obj = {
      method: 'GET'
    };
    return fetch('https://maps.googleapis.com/maps/api/place/details/json?placeid=' + placeID + '&amp;key=MY_API_KEY')
      .then((response) =&gt; {
        if (response.status &gt;= 400){
          throw new Error("Error getting photos for placeID: " + placeID)
        }
        return response.json()
      })
  }
  </code></pre>
  
  <p>Let me know if you need any other information, I'd be happy to provide it. Thanks!</p>