Database Postcode Records, Google Maps? - sql

Currently I have a website and database solution, however I would like to take 'Postcodes' from the records and place corresponding markers for them on a Google maps view.
Is this possible? And where would I start? Thanks

You can use the Google Maps Javascript API to place a map on your webpage. There is a good code example section. Markers should be easy to find.
The process of translating a postcode to a map location is called geocoding. There are code samples here too. The geocoding API has a usage limit and it takes time to do its work. SO if you have many postcodes, you might want to cache geocoding results.
There are many, many ways to get postcodes from a database to JavaScript. If you have an issue there, you'd better ask a more specific question, including the platform and language tag.

Related

Knowledge graph API returning different results than site

When I Google for something and click on a heading from the Knowledge Graph, Google displays a list of the results just below the search bar:
Screenshot here
I typed in the same thing in my Knowledge Graph API:
https://kgsearch.googleapis.com/v1/entities:search?query=apple%20products&key=[MY_KEY]&indent=True&limit=100
and the results are not the same. Short of scraping, is there a way of obtaining the exact list shown within the results via a Google API? It doesn't seem to be Knowledge Graph, or at least the queries are not the same.
Short of scraping, is there a way of obtaining the exact list shown
within the results via a Google API? It doesn't seem to be Knowledge
Graph
Apparently not, you are using the correct API but unfortunately that is how the API works—it usually gives you a different result than if you do a simple Google search.
Why this is the case—I don't know. I decided scrape google instead.
The Knowledge Graph API doesn't have access to the same data sources as a simple Google search. You can read about here if interested (https://web.archive.org/web/20130329151128/http://zecblog.com/2012/09/16/the-short-life-of-the-open-knowledge-graph/).
But yes in short, you'll have to do your own scraping if you want the same information, although it's difficult because Google purposely obfuscates the HTML tags.

Google Adwords Keyword Tool API to automatically extract data onto a website

Im looking to use Google Adwords Keyword tool data on a website. Ive been looking around in the API and I cant find much to match what I need. I noticed a lot of keyword research tool websites use google as their main source for their information. How would I go about doing this and extracting the data and have it run on a website automatically so it wouldnt need to be updated manually each month?
you can use the Traffic Estimator service in the AdWords API:
https://developers.google.com/adwords/api/docs/reference/v201409/TrafficEstimatorService
Be warned that this is notoriously inaccurate (which is odd given that you would think Google had its own data to call upon!)
I use the TargetingIdea service in the AdWords API to generate lists of keywords to use for building AdWords campaigns. (https://developers.google.com/adwords/api/docs/reference/v201409/TargetingIdeaService.TargetingIdea)
First off you need an API key - they're not that easy to get and your app needs to offer a whole lot of features to meet the required minimum functionality - take a look here https://developers.google.com/adwords/api/docs/requirements
Once you've jumped over that hurdle you get the data from Google by sending a request to the service. That request includes some targeting criteria like location and language and also a "seed" keyword. You can also specify if you want closely related results or broadly related results.
For example if you sold tractors you'd put 'tractors' in as a seed keyword and then the API would return either closely related terms like 'tractors for sale', 'used tractor spares' etc or more broadly related terms like 'agricultural machinery'.

The Geocoding api returns a wrong location for a pincode, but Google maps returns right location

I used the pincode (400036) in the geocoding webservice, but got a location in China. The webservice is shared below.
http://maps.google.com/maps/api/geocode/json?address=india&components=postal_code:400036&sensor=false
Ideally it should be a location in Mumbai (Bombay) in the state of Maharashtra, India.
Any ideas why this could occur?
Also, any other parameters that can be passed to make this particular pin code work?
Thanks and regards,
Anand
P.S.: I'm a Business Analyst, so my technical know-how and command of programming languages is pretty limited. However, I'll be most happy to receive help from the community here and pass it on to my dev team. Thanks.
Geocoding and working with real-world data is hard, and not even the great Google (no sarcasm, I'm a fan) gets it right all the time. Apparently there is a software or data bug in the Google API, since this works (added Country India to the component filter):
http://maps.google.com/maps/api/geocode/json?components=postal_code:400001%7Ccountry:IN&sensor=false
But this does not, and is not even filtering by country because it still returns Chinese results:
http://maps.google.com/maps/api/geocode/json?components=postal_code:400036%7Ccountry:IN&sensor=false
If you're a paying customer, you can contact Google for support here: http://www.google.com/enterprise/portal
You can use http://geoanalyzer.in for this. Google maps and google api are slighly different as Google Maps shows you results from both Google Maps API and also from Google places hence a lot of time you get wrong data in case of Google Maps API. Geo Analyzer solved this and has been built specifically for Indian addresses.
This is one of the few available solutions that is targeted for Indian address system complexity. I hope this will help.

What is the best way to get an image URL from a certain query?

I have a book recommendation project for school, and I want to add a picture for each book. I was thinking I could use a search engine API to return the first result, but I'm having trouble with them:
The Google .NET Api seems to be unsupported
The Bing API
The Flickr Api is well documented and it actually works, but the images on there aren't what I'm looking for
Have you tried http://jpg.to ?
[searchterm].jpg.to
i.e.
http://programmingfordummies.jpg.to/
http://clockworkorange.jpg.to/
http://fantasticmrfox.jpg.to/

Get Coordinates for given Location

OK, here's what I want to implement and I need your ideas :
Input a geo location by name/address/etc (e.g. London, Oxford Street 20)
Get the point's longitude/latitude
My Questions :
How would you go about that?
Is using Google Maps API (that's what I first thought of) my only solution?
It'd be better if the service used CAN be freely integrated in a commercial app - so any idea is welcome... :-)
What you are trying to do is basically geocoding. Major map providers like Google, Bing and Yahoo (and many more) all offer some form of Geocoding API for you to take advantage of. Check out the following quick links:
Google Maps Geocoding API
Bing Locations API
Yahoo! Maps Web Services (Geocoding API)
Edit: (just saw the objective-c tag)
Note that these are non-native solutions. However, the provided APIs are typically REST-based (with output as xml/json), it shouldn't be hard for you to consume these services to grab the gecoded lat-long that you want from within your app.
There is a built in API for that.
For iOS 5 and newer you can use CLGeocoder and for older version you will need to use some extern libraries.
Just call
- (void)geocodeAddressString:(NSString *)addressString completionHandler:(CLGeocodeCompletionHandler)completionHandler
where you want to get the location. It runs async and in the completionHandler you will get an array of all possible placemarks for your address where the first one is the most accurate. As apple says:
For most geocoding requests, this array should contain only one
entry. However, forward-geocoding requests may return multiple
placemark objects in situations where the specified address could not
be resolved to a single location.
Off topic:
Am I the only one whos first thoughts about Oxford was "What does he mean with this weird Hex value?"