Solved

Google Dictionary API

Posted on 2014-03-12
16
2,919 Views
Last Modified: 2014-03-13
I have been using the Google Dictionary API and accessing it with this url that returns JSON:
http://www.google.com/dictionary/json?callback=a&q='test'&sl=en&tl=en&restrict=pr,de&client=te
However, now this url throws 404 error.
I found this site: http://google-dictionary.so8848.com  and it seems accessing the same Google Dictionary API that returns the JSON and their site is working.  
Does anyone have any idea of what I might be doing wrong?  I am using this for a language training site and it is too bad the dictionary now doesn’t work.  If you have other ideas for dictionary APIs if this will no longer work, then that would be much appreciated.
Thanks in advance.
Cheers,
0
Comment
Question by:1Cougar
  • 7
  • 6
  • 3
16 Comments
 
LVL 19

Expert Comment

by:Peter Hutchison
ID: 39922925
it looks like it is an 'unofficial' API and developers have been told to stop using it.
See this blog: http://googlesystem.blogspot.co.uk/2009/12/on-googles-unofficial-dictionary-api.html
0
 

Author Comment

by:1Cougar
ID: 39922948
Yes, I believe it is an unofficial API, but I don't understand how the site listed above still is able to get the definitions and my url has ceased to work.
0
 
LVL 19

Expert Comment

by:Peter Hutchison
ID: 39923045
Looks like that may be a copy of the Google API website or even the original developer web server. The IP address seems to come from a similar IP address range (173.194.x.x) as www.google.com servers.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

Author Comment

by:1Cougar
ID: 39923106
That is interesting about the IP.  However, they say they are no connection to Google and in their code I found the same url as mine.  They also have other dictionaries on the site such as Oxford and this is what they say on the home page:

This site uses the Google Dictionary json API to provide service for English Learners, who prefer to read the explanations in English itself.

So, I am baffled as to why their code works and mine now fails.
0
 
LVL 19

Expert Comment

by:Peter Hutchison
ID: 39923124
I think only Google themselves can really answer this.
0
 

Author Comment

by:1Cougar
ID: 39923144
I don't think I was clear.  I found the same url in their code as mine and copying and pasting that in a browser window yields the same 404 error.  Yet, their site is still showing the same Google definitions as usual if you type in a word in the Google Dictionary.  This makes me think they are using a different url somewhere else in the code.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39923315
Looks like this thing has been dead for years!
http://en.wikipedia.org/wiki/Google_Dictionary

What is the functionality you want to achieve?
0
 

Author Comment

by:1Cougar
ID: 39923386
It has not been dead for years, as my little dictionary page worked fine until 2 weeks and I think the site I listed above still seems to be able to use it.

I have a dictionary that is in an iframe on a language learning site where the user can enter a word and it gives the definition and also pronunciation of the word.

It would be preferable to modify my code to completely rewriting my code and since I saw another site that apparently has perhaps done a work around to do so, I was hoping someone might have an idea of what might fix the issue.

Otherwise, I will have to try to find another dictionary API and rewrite my code.

Thanks for any ideas...
0
 
LVL 109

Assisted Solution

by:Ray Paseur
Ray Paseur earned 500 total points
ID: 39923443
Well, the good news is that it's in an iFrame, so the client experience does not have to change - just the stuff under the covers.  

By "dead" I meant that Google stopped supporting it.  The blog post linked above dates from 2009!  Only recently have they removed it, I guess.  That's one of the risks with free APIs - they can suddenly become worth exactly what you're paying for them.  Good APIs carry version numbers and message properties, so you can detect things like deprecation before any damage is done.

Are there any other suitable dictionary APIs that you've identified?
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39923451
This is interesting: https://www.google.com/#q=so8848
0
 

Author Comment

by:1Cougar
ID: 39923460
Not yet.  I was hoping that a closer investigation of the site listed above might help me fix my code, but I have tried to inspect it and cannot find a different url than the one I already have/had.

I was hoping to just alter code instead of basically rewriting it as any other API would most probably render the JSON in a different format than what I have been using.
0
 
LVL 109

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 39923537
any other API would most probably render the JSON in a different format
Probably, but it might not be too hard to "translate" the information.

The general design I've followed for something like this is an adapter pattern.  I've worked with weather APIs that give back essentially the same information but in different forms.  The adapter takes a request for weather data from, for example, a ZIP code, and calls its list of weather APIs.  The one that responds first produces the weather data in its own format, and the adapter dispatches the appropriate translation method to reformat the weather data into a standard structure that the rest of the application can depend on.  In a design like this, the adapter becomes a black box -- you send it a word, and you get a definition (or pronunciation, or list of synonyms, or whatever) in a standard data structure.

I think for your app, you should consider the Google API to be dead, and look for another data source.  A Google search for "free online dictionary api" turns up a collection of results.  If you want to show us a little more about the inputs you have and the outputs you need we might be able to help you bridge the gap.
0
 

Author Comment

by:1Cougar
ID: 39923552
I did find this:

http://softstribe.com/webdesign/google-unofficial-dictionary-api

Clicking on their demo goes to a dictionary that still works with the Google Dictionary API.

So, there must be a functioning URL in there somewhere.

I understand what you are saying.  My page is set up pretty much like this link except I also link to an audio for pronunciation.
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39923585
there must be a functioning URL in there somewhere
Or maybe a hacker in Pakistan stole a copy of the data before Google took it down?  You might find yourself again dependent on an unversioned and unsupported API.  That may be an "acceptable risk," but only you can determine whether this is a reasonable business practice.
0
 

Author Comment

by:1Cougar
ID: 39926479
Thanks a lot for your comments.  I will look for a different dictionary API to integrate in my site.

Cheers,
0
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 39926568
Thanks for the points and thanks for using EE.  I hope you can find a suitable dictionary, ~Ray
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Get to know the ins and outs of building a web-based ERP system for your enterprise. Development timeline, technology, and costs outlined.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question