Try to get List of Hospials using Google-places-api - php

i'm using this api below to find out nearest hospitals.In response json i'm not getting the contact number of those hospitals. how do i get that????
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=22.5531,88.3564&radius=500&types=hospital&sensor=false&key=AIzaSyBdBBjxmc51SAqsefefwgwtSyjxT6NPMUAtYA

You can get only thos info which is provided by the api. Please go through this link it has a nice explanation about the apis https://developers.google.com/places/documentation/search

I think, some of these APIs are closed, so i don't see a solution with Google APIs. Maybe geonames.org or OpenStreetMap gives you a better chance for the data you are looking for.
Overpass Turbo

Related

How to use GeoNames Web Services using PHP

I have read this post and it looks very promising. However, the answer does not go in detail with regards the implementation.
Basically, given the latitude and longitude, how can I use the GeoNames Web Service to get the country. I would like the returned result to be stored in a variable so that I can then continue working with it as I wish.
Thanks in advance
Do you have to use javascript for that? Geonames doesn't seem to offer a javascript api for doing your exact query (see here: http://www.geonames.org/export/JSON-webservices.html). And remote file fetching via javascript is not a joy.
If you could use php for that, it would be as easy as
$country = file_get_contents("http://ws.geonames.org/countryCode?lat=49.03&lng=10.2");

PHP Server Side Google Map API v3 Integration

I am trying to accomplish a two step task on the server side using Google Map API v3 rather than on the client side but have not found much documentation as to how to accomplish this. So I was wondering if anyone here can help or guide me in the right direction.
The 1st step is getting the geo-code location of an address using PHP. I think I have figured this out and that is by making a curl call to http://maps.google.com/maps/api/geocode/json?sensor=false&address= and processing the JSON response. Once I have the geo-codes, I store them in my database.
The 2nd step is finding random addresses in a specific radius of the address in 1st step. This I cannot seem to find how to do in the server side.
Any help or guidance would be truly appreciated.
Easiest way
$url = 'http://maps.google.com/maps/api/geocode/json?sensor=false&address=' . urlencode($address);
$data = json_decode(file_get_contents($url), true); // insert in the database
Searching with the given radius and center point (lat, lng): https://developers.google.com/maps/articles/phpsqlsearch

Calculating driving distance using zip codes

How can I code something which'll calculate the driving distance between 2 zip codes within the USA in PHP. An API or web service that has SOAP or REST will also do.
But I understand GoogleMaps API can't be used because it violates the TOS.. So I need a way without using Google Maps, because I have no intention of using their maps, just calculate the distance.
There isn't a whole lot out there that's free, other than Google Maps. The MapQuest API may give you what you need. Here's their guide to the service - it addresses getting driving distances/times between a set of points. Their terms of service don't appear to require that you display a map, but take a look and see if that meets your needs.
Google Maps Distance API has this exact Functionality. You can get a return as either xml or json.
Here is the documentation
https://developers.google.com/maps/documentation/distancematrix/
Here is a sample of the request url :
http://maps.googleapis.com/maps/api/distancematrix/json?origins=Vancouver+BC|Seattle&destinations=San+Francisco|Victoria+BC&mode=bicycling&language=fr-FR&sensor=false
One nice thing is you dont have to calculate the long/lat first

is it possible to find geolocation using zipcode using PHP

Is it possible to find geolocation using zip code using PHP.
For example, if i am entering the zip code i need to find the name of that particular zipcode.
Is that possible? if yes kindly explain me how?
Thanks in advance
See the duplicate question on how to turn an address into coordinates using the Google Geocoding service.
A query in the format [zipcode], United States, e.g..
72116, United States
should always work for you.
Try maps.google.com to simulate the request.
The XML returned from the Google Service will contain the official place name, as well as other information like county and state names etc.
You can do this through Javascript and PHP using Google's Map API - check this question for an example of how this is used.
I dont think it can be done solely through PHP however because you'd need to access an API's data and they normally (not always) do this through javascript.
You should check the API documentation.
You can access the Geocoding API solely using PHP.. you don't even need an API Key anymore.
http://code.google.com/apis/maps/articles/phpsqlgeocode.html
So if understand this correctly, you want to know the City/State of the zip code you have entered?
Maybe you should look into the Access database here :
http://databases.about.com/od/access/a/zipcodedatabase.htm
And if you find it useful, just convert it into a MySQL table and use as you please.

add parameter to google query

I am trying to get the realtime stockquotes from google for some time now.
First I try'd the finance api, but that didd'nt work out.
Then I saw this query and it seems to good to be true
http://www.google.com/finance/info?client=ig&q=goog
It must have some drawbacks that I am not aware off now.
Anyway, it does give realtime, at least that what it is says on the google finance page
Does anyone know if I can add more parameters for the query like + YAHOO (this is falty)
so I can get more then one stock??
Also, is the output in json or do Y have to parse it differently?
I was planning to do this with curl and ajax
thanks, Richard
You can just add more ticker symbols with a comma, as in:
http://www.google.com/finance/info?client=ig&q=goog,msft
The response is indeed json. There is a good discussion on Stackoverflow about using the first-class Google Finance APIs to get stock quotes here:
How can I get stock quotes using Google Finance API?
comma seperate your sybols.
http://www.google.com/finance/info?client=ig&q=goog,osis

Categories