Assuming that you have already created the key... Go to https://console.developers.google.com/apis/credentials Make sure you have the right project selected from the dropdown at the top Click the API Key Under "Application restrictions" select "HTTP referrers (websites)" Under "Website restrictions" click "ADD AN ITEM" Put __file_url__//* into the box that appears Click "SAVE"