GooMPy icon indicating copy to clipboard operation
GooMPy copied to clipboard

urllib.error.HTTPError: HTTP Error 403: Forbidden

Open geovogel opened this issue 6 years ago • 9 comments

Added my key to the file and got a Forbidden error when the example program tried to acess the Google Maps site.

geovogel avatar Nov 13 '18 18:11 geovogel

I got the same error and I don't know why

ghost avatar Nov 15 '18 12:11 ghost

ditto

nanopete2 avatar Nov 22 '18 18:11 nanopete2

Same

szotyi41 avatar May 12 '19 13:05 szotyi41

Got the same error. Even without adding a key to the file are there any solutions yet?

On google I get: The Google Maps Platform server rejected your request. You must use an API key to authenticate each request to Google Maps Platform APIs. For additional information, please refer to http://g.co/dev/maps-no-account

Actually You have to pay:

You must have a valid API key and a billing account to access our APIs. When you enable billing, you will get $200 free usage every month for Maps, Routes, or Places. Based on the millions of users using our APIs today, most of them can continue to use Google Maps Platform for free with this credit. Having a billing account helps us understand our developers’ needs better and allows you to scale seamlessly.

To avoid a service interruption to your projects, please visit our Get Started page to create a project, generate an API key, and enable a billing account. Once you generate and obtain an API key, make sure to update your application with the new API key.

CesMak avatar Jun 20 '19 07:06 CesMak

` Index: goompy/init.py IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- goompy/init.py (date 1577375762637) +++ goompy/init.py (revision 74d264afa5fe4838657f7d7218e222c7f399eabd) @@ -30,10 +30,9 @@

 import os
 import time

 
 try:
-    from goompy.key import _KEY
+    from key import _KEY
 except:
     _KEY = ''
 
@@ -57,7 +56,7 @@
 
 def _grab_tile(lat, lon, zoom, maptype, _TILESIZE, sleeptime):
 
-    urlbase = 'https://maps.googleapis.com/maps/api/staticmap?center=%f,%f&zoom=%d&maptype=%s&size=%dx%d&format=jpg&key='
+    urlbase = 'https://maps.googleapis.com/maps/api/staticmap?center=%f,%f&zoom=%d&maptype=%s&size=%dx%d&format=jpg'
     urlbase += _KEY
 
     specs = lat, lon, zoom, maptype, _TILESIZE, _TILESIZE

`

ubx avatar Dec 26 '19 17:12 ubx

Hello

Thank you for the code. I have the same problem. Could you please guide me what should I do?

Aminnzh2020 avatar Apr 26 '20 23:04 Aminnzh2020

Hi when you're using goompy, you may need to modify the goompy.py (or in Pycharm, it's in site-packages/goompy/init.py). In function _grab_tile, you need to:

  1. comment "urlbase += _KEY"
  2. modify url base to: https://maps.googleapis.com/maps/api/staticmap?key=YOUR_API_KEY&center=%f,%f&zoom=%d&maptype=%s&size=%dx%d&format=jpg.

I've tested and it works. Enjoy.

siyanhu avatar May 17 '20 15:05 siyanhu

i get this error and i cant solve this i do what you say but still not working @siyanhu

irvan-k avatar Jan 28 '21 07:01 irvan-k

i get this error and i cant solve this i do what you say but still not working @siyanhu

May I see the code pls?

siyanhu avatar Mar 17 '21 09:03 siyanhu