Solved

Google Dictionary API

Posted on 2014-03-12
16
2,564 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 18

Expert Comment

by:Peter Hutchison
Comment Utility
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
Comment Utility
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 18

Expert Comment

by:Peter Hutchison
Comment Utility
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
 

Author Comment

by:1Cougar
Comment Utility
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 18

Expert Comment

by:Peter Hutchison
Comment Utility
I think only Google themselves can really answer this.
0
 

Author Comment

by:1Cougar
Comment Utility
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 108

Expert Comment

by:Ray Paseur
Comment Utility
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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 500 total points
Comment Utility
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 108

Expert Comment

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

Author Comment

by:1Cougar
Comment Utility
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 108

Accepted Solution

by:
Ray Paseur earned 500 total points
Comment Utility
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
Comment Utility
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 108

Expert Comment

by:Ray Paseur
Comment Utility
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
Comment Utility
Thanks a lot for your comments.  I will look for a different dictionary API to integrate in my site.

Cheers,
0
 
LVL 108

Expert Comment

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

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
The viewer will learn how to count occurrences of each item in an array.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now