Giter Site home page Giter Site logo

meetdeveloper / freedictionaryapi Goto Github PK

View Code? Open in Web Editor NEW
2.3K 2.3K 240.0 2.45 MB

There was no free Dictionary API on the web when I wanted one for my friend, so I created one.

Home Page: https://dictionaryapi.dev/

License: GNU General Public License v3.0

JavaScript 100.00%
api dictionary-api dictonary free-api google google-dictionary scraper

freedictionaryapi's People

Contributors

alixsep avatar manishsaraan avatar martin-martin avatar meetdeveloper avatar tomslloyd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freedictionaryapi's Issues

API is crashing sometime

The API is crashing sometime, I am trying to find the solution and will fix it today itself, sorry for inconvenience.

If website crashes for you, you can use dictionaryapi.herokuapp.com, for time being.

Thank You for your patience.

Support for English (UK)

It used to be possible to pass en_GB and get the definition from Oxford Dictionary of English instead of the American version. I think that has stopped to work since last week. I Would be happy if this option is officially supported since this is the default shown worldwide (except North America).

Cannot get definitions for phrases

When I use the api to query a phrase, e.g. et cetera, I can't get the definition. But Google Dictionary actually supports phrase lookup:
`
Screen Shot 2019-10-26 at 12 48 11 PM

No Data From Response

I use axios get method but I didn't saw any data from the JSON response. Please help

axios.get('https://googledictionaryapi.eu-gb.mybluemix.net?define=apple') .then(function(response){ console.log(response) }

Multiple Languages Added

I have added more languages in dictionary API.

Kindly provide your feedback if the feature is working correct.

What it does is if you send extra parameter lang='language code' along with define, then the word is searched in that language dictionary, example if you send request /?define=bonjour&lang=fr, where fr is language code for french. The result will be meaning of bonjour in french. The word have to be present in that language, i.e if you send /?define=hello&lang=fr, it will not give you french meaning as hello is not present in french language.

List of languages supported can be found here for your reference.

Kindly Suggest New Features

To all people who are using this API, or want to use this API and does not find some features they want, kindly suggest me here in comments, and I will implement them, I was busy lately and was not able to take care of many things, now I will update this API on regular basis, your feedback is appreciated.

P.S : Kindly Suggest new features as its own new issue.

CORS

The website does not support cross-origin resource sharing (CORS). I'm not an expert in terms of back-end web development, but I feel like this should be easy to fix server-sided, right? Whenever I send an API request via AJAX in Javascript, I get the following error:
image

I must say though that I really like the API you created and its simplicity, albeit a little slow due to the high latency. Keep up the good work!

Stability issues?

I'm adding a define command to my Discord bot, Mewtwo, using this API. Unfortunately, after attempting to define a word, the API sometimes stops responding with JSON for some minutes and sends a 404 page instead. This isn't an issue with the bot itself, as this issue is confirmed by opening the page in a web browser. I can't push an unstable command to the stable version of the bot, so I was wondering if you could look into what may be causing this.

Poor JSON response structure

Really dig what you've done @meetDeveloper! Was not aware that Google is using Oxford Dictionaries behind the scenes.

While I really dig the API, the current structure of the API responses makes it very unusable (at least in my JavaScript web-based client). Having values as keys is non-standard and iterating over them is a nightmare. For example, the meaning property should be an array and contain a standard object response with partOfSpeech (e.g. { "partOfSpeech": "noun", ... }).

I'd suggest a response that takes cues from the JSON:API spec.

Here's an example of the suggested improvement to the current structure:

{
    "word": "work",
    "phonetic": [
        "wəːk"
    ],
    "meanings": [{
        "partOfSpeech": "noun",
        "definitions": [
            {
                "definition": "activity involving mental or physical effort done in order to achieve a purpose or result.",
                "example": "he was tired after a day's work in the fields",
                "synonyms": [
                    "labour",
                    "toil",
                    "exertion",
                    "effort",
                    "slog",
                    "drudgery",
                    "the sweat of one's brow"
                ]
            },
            {
                "definition": "a task or tasks to be undertaken.",
                "example": "they made sure the work was progressing smoothly",
                "synonyms": [
                    "tasks",
                    "jobs",
                    "duties",
                    "assignments",
                    "commissions",
                    "projects"
                ]
            }
        ]
    }, {
        "partOfSpeech": "verb",
        "definitions": [
            {
                "definition": "be engaged in physical or mental activity in order to achieve a result; do work.",
                "example": "an engineer who was working on a design for a more efficient wing",
                "synonyms": [
                    "toil",
                    "labour",
                    "exert oneself",
                    "slave (away)",
                    "plod away"
                ]
            },
            {
                "definition": "(of a machine or system) function, especially properly or effectively.",
                "example": "his phone doesn't work unless he goes to a high point",
                "synonyms": [
                    "function",
                    "go",
                    "run",
                    "operate",
                    "perform"
                ]
            }
        ]
    }]
}

Regrettably, I'm going to use the Oxford Dictionaries API.

Support for languages other than English stop

Good morning, sir!

First off, thank you for this amazing service! This API is so useful.
I am incorporating this service to my website; however, I am facing a problem where no JSONs are returned except for English words.
I have tested with multiple languages such as French, German and Chinese, but so far this API only works when the searched word is in English. In other languages, it won't return any JSON results.
Does this API currently not support languages other than English?
Could you try to look into it when you have some time?
Thank you very much!

Photo attached below shows the result when searched word was in German.

notFoundPage

Best regards!

An searchbar in the welcome page

I would understand if you would prefer it to be a minimalistic API, but an optional welcome page with a search bar would help alot for UX. I would delete the Google dictionary add-on and bookmark if it were the case :D

Looking for the word pronunciation

This is not an issue, it works great.. just a tip

I'd be more happy to see the word pronunciation included in this awesome script, e.g: Love: /lʌv/
And +1 if you could order the data as an array

Multiple definition support for languages other than english.

I have finally added multiple definitions feature. If you google suppose define set, it will give you many definitions, I till now only used the first definition it provided, but now instead of first I show every definition. Thanks to @ScottEnock for suggesting the feature #5 and @martin-martin and @roaugusto for giving me motivation to do it finally #23 . I apologise for implementing it so late. It is a very useful feature, life caught me and I was not able to commit whole time to implement it.

Coming to developers who uses this API, you only have to change single line of code, and and I am giving array now, which contains multiple sets of definitions, earlier I was giving only the first set of definition, so if you want first set you only have to select first object from the array, and nothing else would be changed.

I am attaching the images to tell what I mean by multiple sets of definitions.

Thank you for your continuous support.

capture
capture2

Empty objects are returned when provided certain words.

For example 'Zinc'

[
  {
    "word": "zinc",
    "phonetic": "/zɪŋk/",
    "origin": "Mid 17th century from German Zink, of unknown origin.",
    "meaning": {
      "noun": [
        {
          
        }
      ],
      "verb": [
        {
          "definition": "Coat (iron) with zinc or a zinc compound to prevent rust.",
          "example": "the street lamps are adorned with tiny zinced crowns"
        }
      ]
    }
  }
]

For example 'Women'

[
  {
    "word": "women",
    "phonetic": "/ˈwɪmɪn/",
    "meaning": {
      
    }
  }
]

For example 'Men'

[
  {
    "word": "men",
    "phonetic": "/mɛn/",
    "meaning": {
      
    }
  }
]

I reviewed your code and found out that there is an issue with the code in line 205 to 207 in app.js.

if (definition.length === 0) {
           definition = $(item).find(".crossReference").first().text();
}

I suggest you to check the crossReference class again in the Lexico.com site and refactor the code.

Best regards.

Synonyms are missing

I build my app on the synonyms that this API used to return but now it doesn't which is rendering my app useless.

How easy is it to find what's happened?

Phonetic critical problem

Hi
There is an issue with phonetic extraction, which I consider it as critical. The pronunciation of a word may differ in its many usages, but the API returns only one pronunciation for a word. For example word "use", it has two pronunciations: /ju:z/ as a verb and /ju:s/ as a noun, but the API returns only /ju:z/.
Thanks

Not Found and Bad Gateway response

It will not allow me to request the output with my local server i keep getting the following results,

404 Not Found: Requested route ('googledictionaryapi.eu-gb.mybluemix.net') does not exist.
Bad Gateway response too.

please fix this,

what are the request limits for your server.

404 Not Found

Hi, service was working fine yesterday, but when I try to today I get a 404 Not Found with the following message:
Not Found
We're sorry, we couldn't find what you were looking for.
You can try a search or start over on the home page.

The starting webpage loads okay, but any query returns the above error.

I have fixed multiple languages issue, sorry for the long delay. (working only for https://googledictionaryapi.eu-gb.mybluemix.net/)

I have fixed multiple languages, and it is working again. Though for time being multiple definitions will cease to work, I will add them again in weekend.

If you were using that, kindly use the other URL https://mydictionaryapi.appspot.com/. I will fix the issue for https://googledictionaryapi.eu-gb.mybluemix.net/, in weekend and then there will be consistency across all.

Reached 100 stargazers.

Thank you all, I had never even thought that something that I build will reach 100 stargazers. This was my first open source project, I want to thanks you all from bottom of my heart, without your support and continuous ask for new features, I would not have thought of endless possibilities with this project, Thank you once again.

Notable Mentions:
@veganexe
@ScottEnock
@martin-martin
@tomslloyd
@kovinet

https://mydictionaryapi.appspot.com/ not working anymore

I run a Discord bot that uses this API for dictionary definitions. It began throwing errors about "Attempt to decode JSON with unexpected mimetype", and I looked on the API which is no longer returning any definitions at all. The other URL seems to still work fine, however.

API Response Issue

I am using this API for last year. Thanks a lot for this service.
Have you changed response in latest update ?? Because my work not working now.
Please share all possible responses of API.
I shall be very thankful to you.

word connotation missing

Hi, buddy.

It seems like the word connotation (e.g., derogatory) is missing.

import requests

url = 'https://googledictionaryapi.eu-gb.mybluemix.net/'

r = requests.get(url, params=dict(define='upstart'))
r.json()
[{'word': 'upstart',
  'phonetic': '/ˈʌpstɑːt/',
  'meaning': {'noun': [{'definition': 'A person who has risen suddenly in rank or importance, especially one who behaves arrogantly.',
     'example': 'the upstarts who dare to challenge the legitimacy of his rule',
     'synonyms': ['parvenu',
      'parvenue',
      'arriviste',
      'nouveau riche',
      'vulgarian']},
    {'definition': 'A series of movements on the parallel or asymmetric bars, by which a gymnast swings to a position in which their body is supported by their arms above the bar, especially at the start of a routine.'}]}}]

image

I checked Oxford Dictionary API and they seems to store the data as registers

{
  "id": "upstart",
  "metadata": {
    "operation": "retrieve",
    "provider": "Oxford University Press",
    "schema": "RetrieveEntry"
  },
  "results": [
    {
      "id": "upstart",
      "language": "en-gb",
      "lexicalEntries": [
        {
          "entries": [
            {
              "senses": [
                {
                  "definitions": [
                    "a person who has risen suddenly in rank or importance, especially one who behaves arrogantly"
                  ],
                  "examples": [
                    {
                      "text": "the upstarts who dare to challenge the legitimacy of his rule"
                    }
                  ],
                  "id": "m_en_gbus1114570.006",
                  "registers": [
                    {
                      "id": "derogatory",
                      "text": "Derogatory"
                    }
                  ],
                  "shortDefinitions": [
                    "person who has risen suddenly in rank"
                  ],
                  "thesaurusLinks": [
                    {
                      "entry_id": "upstart",
                      "sense_id": "t_en_gb0015762.001"
                    }
                  ]
                },
                {
                  "definitions": [
                    "a series of movements on the parallel or asymmetric bars, by which a gymnast swings to a position in which their body is supported by their arms above the bar, especially at the start of a routine."
                  ],
                  "domains": [
                    {
                      "id": "gymnastics",
                      "text": "Gymnastics"
                    }
                  ],
                  "id": "m_en_gbus1114570.010",
                  "shortDefinitions": [
                    "series of movements on parallel or asymmetric bars, by which gymnast swings to position in which their body is supported by their arms above bar"
                  ]
                }
              ]
            }
          ],
          "language": "en-gb",
          "lexicalCategory": {
            "id": "noun",
            "text": "Noun"
          },
          "pronunciations": [
            {
              "audioFile": "http://audio.oxforddictionaries.com/en/mp3/upstart_gb_1.mp3",
              "dialects": [
                "British English"
              ],
              "phoneticNotation": "IPA",
              "phoneticSpelling": "ˈʌpstɑːt"
            }
          ],
          "text": "upstart"
        }
      ],
      "type": "headword",
      "word": "upstart"
    }
  ],
  "word": "upstart"
}

Hopefully, you could find a way to add it. Btw, really like your work!!!

API failing with non English characters

For Turkish language, a request for a word which has one of the non standard characters, such as: Ş, Ç, I, Ü, Ğ, Ö returns an error.

For example the word "kuş": request to /?define=kuş&lang=tr returns 404 error, but Google search for "kus nedir" produces normal results. Same for other word for Turkish with characters not present in English alphabet.

Usage rights

Hi,
I really like your API and I'm considering introducing it in one of my websites as "free feature", even if inside a commercial website, with paying customers. I was wondering if you have any insights about what are the usage limits of the data your API fetches: do I risk anything in showing API results in my website? (I would obviously cache results so that the volume of searches would be negligible)
Thank you

Language of origion

Hi Suraj Jain,

I love the api provided by you to learn about words. Can this api be extended to provide etymology (languageOfOrigin).

You can either show full graph in transformed text if possible. If not possible, just the text also would be fine ("early 17th century: from French, from Provençal acolada, literally ‘embrace around the neck (when bestowing knighthood)’, from Latin ad- ‘at, to’ + collum ‘neck’.").

Thanks,
Rajesh

Thanks,
unnamed

Rajesh

Support for Chinese

Queries for Chinese words don't seem to be working. Definitions not found.

Dictionary Won't Work for other languages for some time

Due to having change the structure of the program and various significant parameters.
Dictionary API won't work for languages other than English for sometime.
I will soon patch the issue and get it working.
Thanks for your support.

Order things as an Array

Hello there,

Thank you for the great effort you put in to this, we have an application and we use your script to scrape Google Dictionary Data.

At this moment, we have to loop through word classes e.g noun, verb, adjective in order to get the data, However. these three aren't the only ones, there are nounarchaic, nounBotany, verbFormal and a lot more we don't know..

So, we can't actually get the data, since it's a Dictionary, we have to indicate the word class in our code to get a word data, for example

screenshot at may 28 20-30-18
Language: Swift

Here json2 is a Dictionary on your server, and we use the word class to get the word details, without that, we can't grab the data

So my question is, can you re-order the data?

Something like this?
https://api.myjson.com/bins/bwrf2

Use https://jsonlint.com to view it more precisely

This would be so awesome, can you do this?

German to English possbile?

Is it possible to lookup a word in one language and get the explanation in another language? For example, look up a German word machen, and get the meaning in English?

Thank a lot.

502 Bad Gateway

The API is down right now. Can you please fix it, we need it for our school project.

Support for multiple Definitions.

Depending on the word, Google will return multiple definitions for a word. For example, "steer" returns two separate definitions, the first being "guide or control the movement of (a vehicle, vessel, or aircraft)" and the second being "another term for Bullock.".

At the moment the API only scrapes the first definition, It would be a nice addition if you could return all definitions. Thanks!

Your Review for new Website

I have changed website for the API, and I need your feedback on how it is. Kindly tell me if you want any changes or addition. Your feedback is appreciated.

Due to High Traffic - API gets detected by google

Due to high amount of traffic, now the request I send to google server side does not go through and instead, it shows recaptcha page, and so all of you people must be experiencing downtime. I am finding solution for the problem, Sorry for inconvenience caused.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.