4

I was using Google Directions Api within the limit of 2500 route queries per day which is free. It was working fine. Now out of nowhere it gives this error while requesting the api when it is clearly written in https://developers.google.com/maps/documentation/directions/start that Client Id is for premium plan.

Downloaded URL: { "error_message" : "You must enable Billing on the Google Cloud Projectassociated to this client ID, at https://console.cloud.google.com/project/_/billing/enable.Learn more at https://developers.google.com/maps/premium/new-plan-migration", "routes" : [], "status" : "REQUEST_DENIED"} Background task data { "error_message" : "You must enable Billing on the Google Cloud Projectassociated to this client ID, at https://console.cloud.google.com/project/_/billing/enable.Learn more at https://developers.google.com/maps/premium/new-plan-migration", "routes" : [], "status" : "REQUEST_DENIED"}

How can I solve this issue

Nimra
  • 67
  • 1
  • 1
  • 6
  • 1
    You need to do what the error message says (Enable billing on the Google Cloud Project associated with the key). There is no more "free", although Google does (at present), give you some usage without charging. – geocodezip Aug 01 '19 at 17:18
  • 1
    Google Maps Premium plan is deprecated. Once your license is expired you have to migrate to Google Maps platform where billing account is mandatory. You can continue using client ID, but now it is related to cloud project, so you need enable billing there. – xomena Aug 01 '19 at 22:48

1 Answers1

15

From the google maps documentation:

Reminder: To use the Directions API, you must include an API key with all API requests and you must enable billing on each of your projects.

I know they used to allow using the API without a key or billing enabled but they changed their policy a while back.

If you are willing to use an alternative to google maps you can look into OSRM (Open Source Routing Machine), this is completely free but requires some setup and you have to host it yourself. We use OSRM for directions and get much better performance hosting it ourselves for a fraction of the cost of googlemaps.

maschaub
  • 752
  • 4
  • 10