Use Google Places API to autocomplete input in subscribe form - google-api

For a commercial website, I would like users to fill out a field with their shop name, and if the shop is found by google, fill out the subscription form (for example: phone number, address, logo, etc).
My question: is it possible to use this Api with that? I find that the terms of use are not clear.
PS : Sorry about my english :/

In short a few of the important terms of use are:
http://code.google.com/apis/maps/terms.html#section_9_1
You must not charge access to use your implementation of the Places Autocomplete API and it must be freely accessible to the public. Unless its part of a Mobile Application or you have a Google Enterprise agreement or obtained Google's written permission.
http://code.google.com/apis/maps/documentation/places/autocomplete.html#requirements
You must show a "Powered by Google" logo with any data accessed using the Places Autocomplete API if you do no show this data with a Google Map
If the Places Autocomplete API responses contains Listing provider information it must be displayed to the user.
If your implementation adheres to the terms of use, than it is possible for you to use the Places Autocomplete API for the purpose described.

Related

Google Place API, advanced place details: amenities, crowd, accessibility

I'm successfully using Google Places API to get details like name, address, phone, lat/lng, opening hours, etc. No problem with that.
However, the data I can't get a hold of is the deeper data.
For example, if you open up a McDonald's, and click on its short description, it will show things like Amenities, Crowd, Atmosphere, Accessibility.
Question is - is it possible to access this information via Places API?
Thanks
According to the documentation. That information is not returned by the API. You can link directly to that place on Google Maps to show your users that information though.
Remember that APIs like this usually don't return all of the information available to the native service so that the native service (in this case Google Places) retains a competitive advantage.

how to implement Complex Web API queries in ASP Core

I'm new to web API design, so I've tried to learn best practices of web API design using these articles:
1.Microsoft REST API Guidelines
2.Web API Design-Crafting Interfaces that Developers Love from "Apigee"
Apigee is recommending web API developers to use these recommendations to have better APIs.
I quote here two of the recommendations:
I need C# code for implementing these recommendations in my Web APIs (in ASP Core) which is a back-end for native mobile apps and AngularJs web site.
Sweep complexity behind the ‘?’
Most APIs have intricacies beyond the base level of a resource. Complexities can include many states that can be updated, changed, queried, as well as the attributes associated with
a resource.
Make it simple for developers to use the base URL by putting optional states and attributes behind the HTTP question mark. To get all red dogs running in the park:
GET /dogs?color=red&state=running&location=park
Partial response allows you to give developers just the information they need.
Take for example a request for a tweet on the Twitter API. You'll get much more than a typical twitter app often needs - including the name of person, the text of the tweet, a timestamp, how often the message was re-tweeted, and a lot of metadata.
Let's look at how several leading APIs handle giving developers just what they need in
responses, including Google who pioneered the idea of partial response.
LinkedIn
/people:(id,first-name,last-name,industry)
This request on a person returns the ID, first name, last name, and the industry.
LinkedIn does partial selection using this terse :(...) syntax which isn't self-evident.
Plus it's difficult for a developer to reverse engineer the meaning using a search engine.
Facebook
/joe.smith/friends?fields=id,name,picture
Google
?fields=title,media:group(media:thumbnail)
Google and Facebook have a similar approach, which works well.
They each have an optional parameter called fields after which you put the names of fieldsyou want to be returned.
As you see in this example, you can also put sub-objects in responses to pull in other information from additional resources.
Add optional fields in a comma-delimited list
The Google approach works extremely well.
Here's how to get just the information we need from our dogs API using this approach:
/dogs?fields=name,color,location
Now I need C# code that handles these kind of queries or even more complex like this:
api/books/?publisher=Jat&Writer=tom&location=LA?fields=title,ISBN?$orderBy=location desc,writerlimit=25&offset=50
So web API users will be able to send any kind of requests they want with different complexities, fields, ordering,... based on their needs.

Yahoo, Google, Yelp API

Is there any php API to gather information about a business(address, reviews) by its phone number from Yelp, Google, Insiderpages, Yahoo..
Please help, i have done research about these, but did't get the right info, though yelp is providing info by it's phone number but there they ask ywsid as mendatory (http://api.yelp.com/phone_search?phone=1234567890&ywsid=XXXXXXXXXXXXXXXX) but i want by phone number only.
Please note that all APIs have terms, most of them won't allow you to store their data in your own database and most of them have display requirements, before proceeding with any developing please read carefully their display requirements and terms.
Depending on your project you might not be allowed to use the data as you might need/want to on your project.
The other alternative would be scrapping sites, but most sites have rules against scraping too...
And again read a lot before putting too effort on something you are prohibited to in first place.
Yelp
ywsid = API key, you need to get your own key if you are using the yelp API, get it here
if you are using it to add it to your own database or storing the information anywhere it is against their policies display requirements & api terms.
if you are using any API you must read their terms before even thinking of doing anything.
Google Places
API
Insiderpages
I Don't think they have one but you could use the citygrid API that does a [lot of sites] search at once.
Yahoo
Yahoo API
CityGrid
As mentioned before citygrid API
Foursquare
Foursquare API
Merchant Circle
Merchant Circle API
White Pages
White Pages API
Yellow Pages
Yellow Pages API
Bottom line is, all these companies have put a lot of time and effort and money to build their databases, and they want you to redirect people back to their pages so they can make their money back/profit.

Google Places API Email/Website

Is there a way to get Email/Website of a particular place using Google Places API? If this is not possible is there a way other than using Google API?
To retrieve a places website address using Google Places API, you could perform a Places Autocomplete Request with the input parameter value set to the name of the place: e.g.input=Amoeba
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Amoeba&sensor=false&key=your_api_key
Then using the reference from the response you could perform a Places Details Request: e.g.
reference=ClRMAAAAVzPUTLym999EXs4mKkpTqEmzX0a2kfXCUs4enTvWMHDd06VLvlzsGOdfrRd2QvkiRWs4sNkraAAJlMdytt4O4kYGoJZn4ENL5Ig5QYyeJmMSECDOGMO1MnDFtqzdqD8oDk0aFJr8_s-Y946QOz24YubPUsmoC2vl
https://maps.googleapis.com/maps/api/place/details/json?reference=ClRMAAAAVzPUTLym999EXs4mKkpTqEmzX0a2kfXCUs4enTvWMHDd06VLvlzsGOdfrRd2QvkiRWs4sNkraAAJlMdytt4O4kYGoJZn4ENL5Ig5QYyeJmMSECDOGMO1MnDFtqzdqD8oDk0aFJr8_s-Y946QOz24YubPUsmoC2vl&sensor=false&key=you_api_key
This would return the details for Amoeba including if available, the parameter website which would contain the places website address.
Google Places API provides Details requests and responses using your API key.
The tag allows for the google places url for that places
e.g.
http://maps.google.com/maps/place?cid=10704550479004381649
If you wish to harvest website, fax and opening hours information, it can only be done here.
There is no direct api in the Google Places API that will provide that info.
Just as addressComponents are part of the Details response, i assume tags will be added to the Place Details responses from the API to address this problem.
I have been trying to use Google Places API, and I have successful queries, fetching Places details, which has all the address information for the place I want to find, but ironically, there is NO WEBSITE attribute in the returned JSON!
The first version of Local search was MUCH better, and always accurate for searches when you know the business name.

How can i get list of domain users from Google Apps account without administrative access?

This is a similar question to How can i get list of Domain user's from Google Apps account?
However, I'd like to use a normal account (not an administrative account) to retrieve the user list. It seems like this should be possible as the gmail autocomplete returns domain contacts not listed in the user's contact store. I've looked at the autocomplete Ajax call, but it requires something in the beginning of the string (and no, I don't really want to loop through a-z one by one - that is just way to hacky). For example:
https://mail.google.com/mail/c/u/0/data/contactstore?ac=true&ct=true&gp=true&hl=en&id=domain&max=15&out=js&tok=beginningOfUsersName&type=4
Both versions of the Google contacts API seem to omit domain users unless you have them imported into your own contacts list. I've also looked at querying users in the "Coworkers" system group, all to no avail. I also find it interesting that "add a coworker's calendar" on Google calendar does not provide autocomplete - they use a popup instead.
I'm working on a C# project, but this is a general Google API question, so any pointers in any language would help.
Update
It looks like this is feasible now with admin/directory google api endpoints
see: https://developers.google.com/admin-sdk/directory/v1/guides/manage-users?authuser=0#retrieve_users_non_admin
Original answer
I was able to work around this issue, so I'll document the workaround, even if it doesn't involve Google. I wrote a program (in C#) to query the internal Active Directory (LDAP) store and pick up all the users from there instead. At that point I could get their email addresses and query Google with it. Not the best method, but it worked for my needs.
The C# was roughly patterned from this powershell script, although I pulled out the computers query and added in the capture of the user's email address: http://www.visualbasicscript.com/List-all-users-or-computers-in-the-default-domain-m35650.aspx
The LDAP property I included to get the proper email address for Google was 'proxyAddresses', although this will not be correct for all environments.

Resources