Bus Stop Details - google-places-api

I am trying to get bus stop details from the Google Places API. I have been able to get the actual bus stops but now I'd like to grab the details.
For example: This is the URL Google gives me from the response. https://maps.google.com/maps/place?cid=14960400563022267569
I'd like to get a JSON representation of this information (if its available). Appending output=json just returns an empty json document.
Does anyone know how to grab the info without putting it through a parser?
EDIT: So continuing to dig through the flow I got SOME information from this URL but still doesn't seem to show me the bus numbers or anything. http://maps.google.com/maps?cid=14960400563022267569&q=a&output=json

Currently, there seems to be no option in google apis to retrieve the public transit information the way you are seeing on google maps. Your best bet is to use google places api and to filter for bus_station to get details about the bus stations , but the information returned will be limited these result details . Another option is to use google directions api, where you can search for directions by keeping your bus station as the source and a suitable destination and the returned results will provide some transit details which include departure time, headways, etc.

Related

Is there a way to get train lines that connect to a given Place of type 'train_station' [duplicate]

I've seen that you can retrieve nearby subway stations for a location using the Google Maps Places API, as explained here:
Google Maps: Retrieve nearby subway station's latitude and longtitude?
But in addition to that data, I would also like to retrieve the subway lines available at that station. Is this possible?
Currently the Places API doesn't expose this information for transit stations. There is a feature request in Google issue tracker to make it possible to retrieve lines numbers for each stop. You can find this feature request at
https://issuetracker.google.com/issues/35827961
Please feel free to star this feature request to express your interest and subscribe to further notifications from Google.

Detecting redirected Google Maps place_id via API

I'm looking for a way to determine if a place_id and the Google Maps URL obtained by firing a details request for that place_id to the Google Places API Web Service is being redirected to another Google Maps result.
I thought this question about getting the redirected Photo URL would be relevant, but it appears to be behavior different than what I'm seeing.
Here goes:
The Good Listing
Place ID: ChIJF07Dwbbv3IARm-54MM1clQE represents a listing with the following NAP:
Full House Casino Events
17941 Sky Park Cir Suite B, Irvine, CA 92614, USA
(949) 439-5207
Its Maps ID is 114099401919098523. Visiting that URL on Google Maps returns me a listing with the same NAP as the API details request.
The Redirected Listing
Place ID: ChIJF07Dwbbv3IARv0ORjjGlaFg represents a listing with the following NAP:
Full House Casino Events
24752 Cutter, Laguna Niguel, CA 92677, USA
(949) 439-5207
Note that the name and phone are the same as the first place_id
NOTE: The API HTTP response returns a 200 (not a 30x) with the same ID as the one requested. So this rules out following a redirect or checking for a different ID in the reply.
Its Maps ID is 6370523305179431871. Visiting that URL on Google Maps redirects me to a listing with a different address as the details API request.
Moreover, it has been redirected to the first listing pointed out above.
From the consumer's perspective, this makes sense because the latter is likely a duplicate of the former, and has been merged to send user traffic in the browser to the correct location.
The Question
How would I determine this programmatically? I have stepping through the redirects one by one using curl. However, the IDs end up getting mangled into some encoded hex value that I don't understand how to parse yet.
If there isn't some feasible way to determine this other than checking the resulting listing in the browser, I might check with the Google Maps team to see what they suggest.
Thanks for any approach you might have to suggest, or clarity you can offer on the relationship among place_ids and Google Maps IDs.
UPDATE(2016-09-19): This issue is fixed in Places API now: a Details request for The Redirected Listing (ChIJF07Dwbbv3IARv0ORjjGlaFg) returns The Good Listing (ChIJF07Dwbbv3IARm-54MM1clQE)
Previously, redirected places would show up in the Places API with a flag:
permanently_closed: true
There is a feature request to Add redirecting Place or Maps ID in "Place Details" request that you may be interested in. If so, star it to receives updates.
If you're curl-downloading URLs from Google Maps (not the API) and relying on HTTP redirects... well, that's bound to change at any unpredictable time, I'd recommend very much against it.

Google Places webservice returns nextpage token as 0x0 after two requests

I have written a d code to retrieve the available places (like hospitals in US) from google places web service. I am able to retrieve place details only continuously for 2 requests only. afterwards the pagination token is set as 0x0 in the json response.
But if i manually do the search in the google then it keep on moving more than that. What is wrong am i doing here. Google says that it allows 1000 request per day limit for free. But it doesn't serve more than 2 requests. I have used d lang "requests" module for making the http request.
You only get 60 results across three pages, because that's the maximum provided by the API.
Nearby Search and Text Search requests in the Google Places API web service return a maximum of 60 results. See the Accessing Additional Results section of the documentation, which says:
each search can return as many as 60 results, split across three pages.
(Emphasis mine.)
dlang-requests can display (to stdout) detailed info on request and response if you use verbosity=3.
Also you can compile sources it with -debug=requests and set globalLogLevel(LogLevel.trace) to produce even more detailed log information. If this doesn't help, then please give me detailed info on failed API call so that I can reproduce problem.

How do I find the current temperature of a city with NCDC API v2?

I'm a beginner with APIs but I feel this one is still a bit more vast and complex.
I want to find the air temperature of Boston. Or really, output any useful weather data.
Using this URL in JSON I can find the location of Boston:
http://www.ncdc.noaa.gov/cdo-web/api/v2/locations/CITY:US250002
Response:
{"mindate":"1885-01-01","maxdate":"2015-07-25","name":"Boston, MA US","datacoverage":1,"id":"CITY:US250002"}
Using this I can find the data category of "Air Temperature":
http://www.ncdc.noaa.gov/cdo-web/api/v2/datacategories/TEMP
Response:
{"name":"Air Temperature","id":"TEMP"}
This gives me no helpful information, so here is my effort to combine the two:
http://www.ncdc.noaa.gov/cdo-web/api/v2/datacategories/TEMP?locationid=CITY:US250002 (Air Temperature in Boston)
Response:
{"name":"Air Temperature","id":"TEMP"}
Normally when I enter an API all the information is there and available to filter via parameters. Here it seems the data is all divided. It will show you all the locations, all the data sets, all the categories that exist in the API, but how do I see the actual meat of the data? Ex. Current water temperature of Chicago, IL? Air Temperature on 3/14/2014 in Los Angeles, CA?
Here's my jsfiddle I'm using:
http://jsfiddle.net/f98dauaz/1/
You need to use a different endpoint, that endpoint I believe is just used for locations if you are looking for a location and data on that location itself.
You would need to pull from the data endpoint instead of the location endpoint, which you can find info on here http://www.ncdc.noaa.gov/cdo-web/webservices/v2#data
an example would be:
http://www.ncdc.noaa.gov/cdo-web/api/v2/data?datasetid=GHCND&datatypeid=TMAX&datatypeid=TMIN&locationid=ZIP:(zip_code_here)&limit=(your_data_limit_for_file)&startdate=(YYYY-MM-DD)&enddate=(YYYY-MM-DD)
Note this is for historical data not for current data

Get all addresses for specific place/company

What I'm trying to do is collect all addresses for list of companies and trying to get it with Google Map Api.
For example when I search for "Burger King" at maps.google.com I recieve 600k+ results:
20 pages of detailed results I can use
Way more "pointers" on map - but they come with images as part of map data - so can't parse it.
There is new Google Places API - I'm not sure if it fit my requirements - I need to specify coordiantes+radius there so I can't get data for whole US or World.
My question is - if there any way to get that kind of data with Google API or are there any other reliable sources?
Thanks!

Resources