Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get co-ordinates of all gas/fuel/petrol stations on Google Maps?

I'm developing a petrol price comparison app for my final year project in university (something similar to GasBuddy or PetrolPrices if you're living in the UK/US). I want to create an Android app that features an in-app map that's prepopulated with all the petrol stations in the country (Ireland).

I was going to use the Google Maps API for the in-app map and then add custom markers for all the petrol stations. I'm going to use Firebase as my database and wanted a section of it to be a list of all the petrol stations with their information such as; co-ordinates, opening times, petrol prices etc. I would use the Google Places API but I only want petrol stations to come up on the app without a user having to input a search query for them, which means the map will have to be pre-populated already.

Is there anyway that I can get all the co-ordinates of all the petrol stations listed on Google Maps to input into my database so I can prepopulate the in-app map with custom markers?

like image 538
rookiecookie Avatar asked Nov 23 '25 22:11

rookiecookie


1 Answers

You can use Places API - Nearby Search to achieve this. And by using the type filter and setting it to gas_station, you will get details of the place such as their coordinates. See this for the list of supported types.

IMPORTANT NOTE:

Be careful on what you store in your database. According to Google Maps Terms of service under 3.2.3 (a) No Scraping, customer will not: (i) pre-fetch, index, store, reshare, or rehost Google Maps Content outside the services

There is, however, some data that you can store/cache temporarily. See their service specific terms for more information on this.

like image 72
Ricky Cuarez Avatar answered Nov 25 '25 10:11

Ricky Cuarez