simondlevy/GooMPy

urllib.error.HTTPError: HTTP Error 403: Forbidden

Opened this issue · 9 comments

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

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

ditto

Same

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.
ubx commented

`
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 74d264a)
@@ -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

`

Hello

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

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.

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

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?