Skip to content

Collins API

Methods

  • Get list of available dictionaries
  • Get a dictionary
  • Search (array of entries with entry Id,Label,Url) (*)
  • Get did you mean entries (*)
  • Get the first/best matching (*)
  • Get an entry (*)
  • Get pronunciations (*)
  • Get nearby entries (*)

Those marked with a (*) are the ones to be implemented.

JSON responses

{
    "resultNumber": 1,
    "results": [
        {
            "entryLabel": "legitim",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legitim_1",
            "entryId": "legitim_1"
        }
    ],
    "dictionaryCode": "english",
    "currentPageIndex": 1,
    "pageNumber": 1
}

did_you_mean

{
    "searchTerm": "legitim",
    "dictionaryCode": "english",
    "suggestions": [
        "legit",
        "legitimist",
        "legitimize",
        "legitimate",
        "flexitime",
        "legitimizer",
        "legitimator",
        "legitimiser",
        "gregatim",
        "legalism"
    ]
}

get_best_matching

{
    "topics": [],
    "dictionaryCode": "english",
    "entryLabel": "legitim",
    "entryContent": "<div class=\"entry_container\"><div class=\"entry lang_en-gb\" id=\"legitim_1\"><span class=\"inline\"><h1 class=\"hwd\">legitim<\/h1><span> (<\/span><span class=\"pron\" type=\"\">ˈlɛdʒɪtɪm<\/span><span>)<\/span><\/span><div class=\"hom\" id=\"legitim_1.1\"><span class=\"gramGrp\"><span>   <\/span><span class=\"pos\">noun<\/span><\/span><div class=\"sense\"><span>     <\/span><span class=\"lbl\">Scots law<\/span><span> <\/span><span class=\"def\">the part of a person's moveable estate that is inherited by his or her children on that person's death<\/span><\/div><!-- End of DIV sense--><\/div><!-- End of DIV hom--><\/div><!-- End of DIV entry lang_en-gb--><\/div><!-- End of DIV entry_container-->\n",
    "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legitim_1",
    "format": "html",
    "entryId": "legitim_1"
}
HTML content
<div class="entry_container">
     <div class="entry lang_en-gb" id="legitim_1">
        <span class="inline">
            <h1 class="hwd">
                legitim
            </h1>
            <span> (</span>
            <span class="pron" type="">ˈlɛdʒɪtɪm</span>
            <span>)</span>
        </span>
        <div class="hom" id="legitim_1.1">
            <span class="gramGrp">
                <span></span>
                <span class="pos">noun</span>
            </span>
            <div class="sense">
                <span>     </span>
                <span class="lbl">Scots law</span>
                <span> </span>
                <span class="def">the part of a person's moveable estate that is inherited by his or her children on that person's death</span>
            </div><!-- End of DIV sense-->
        </div><!-- End of DIV hom-->
    </div><!-- End of DIV entry lang_en-gb-->
</div><!-- End of DIV entry_container-->

get_entry

{
    "topics": [],
    "dictionaryCode": "english",
    "entryLabel": "legit",
    "entryContent": "<div class=\"entry_container\"><div class=\"entry lang_en-gb\" id=\"legit_1\"><span class=\"inline\"><h1 class=\"hwd\">legit<\/h1><span> (<\/span><span class=\"pron\" type=\"\">lɪˈdʒɪt<a href=\"#\" class=\"playback\"><img src=\"https://api.collinsdictionary.com/external/images/redspeaker.gif?version=2016-11-09-0913\" alt=\"Pronunciation for legit\" class=\"sound\" title=\"Pronunciation for legit\" style=\"cursor: pointer\"/><\/a><audio type=\"pronunciation\" title=\"legit\"><source type=\"audio/mpeg\" src=\"https://api.collinsdictionary.com/media/sounds/sounds/e/en_/en_gb/en_gb_legit.mp3\"/>Your browser does not support HTML5 audio.<\/audio><\/span><span>)<\/span><span class=\"lbl\"><span> <\/span>slang<\/span><\/span><div class=\"hom\" id=\"legit_1.1\"><span class=\"gramGrp\"><span>   <\/span><span class=\"pos\">adjective<\/span><\/span><div class=\"sense\"><span class=\"sensenum\">     1 <\/span><span class=\"xr\"><span class=\"lbl\">short for<\/span><span> <\/span>\n                \n        \t\t<a data-resource=\"english\" data-topic=\"legitimate_1\" href=\"\">legitimate<\/a><\/span><\/div><!-- End of DIV sense--><\/div><!-- End of DIV hom--><div class=\"hom\" id=\"legit_1.2\"><span> <br/>▷ <\/span><span class=\"gramGrp\"><span class=\"pos\">noun<\/span><\/span><div class=\"sense\"><span class=\"sensenum\">     2 <\/span><span class=\"def\">legitimate or professionally respectable drama<\/span><\/div><!-- End of DIV sense--><\/div><!-- End of DIV hom--><\/div><!-- End of DIV entry lang_en-gb--><\/div><!-- End of DIV entry_container-->\n",
    "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legit_1",
    "format": "html",
    "entryId": "legit_1"
}

get_pronunciations

[
    {
        "dictionaryCode": "english",
        "pronunciationUrl": "https://api.collinsdictionary.com/media/sounds/sounds/e/en_/en_gb/en_gb_legit.mp3",
        "lang": "uk",
        "entryId": "legit_1"
    }
]

get_nearby_entries

{
    "nearbyFollowingEntries": [
        {
            "entryLabel": "legitim",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legitim_1",
            "entryId": "legitim_1"
        },
        {
            "entryLabel": "legitimate",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legitimate_1",
            "entryId": "legitimate_1"
        },
        {
            "entryLabel": "legitimator",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legitimator_1",
            "entryId": "legitimator_1"
        },
        {
            "entryLabel": "legitimiser",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legitimiser_1",
            "entryId": "legitimiser_1"
        },
        {
            "entryLabel": "legitimist",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legitimist_1",
            "entryId": "legitimist_1"
        },
        {
            "entryLabel": "legitimistic",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legitimistic_1",
            "entryId": "legitimistic_1"
        },
        {
            "entryLabel": "legitimize",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legitimize_1",
            "entryId": "legitimize_1"
        },
        {
            "entryLabel": "legitimizer",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legitimizer_1",
            "entryId": "legitimizer_1"
        },
        {
            "entryLabel": "legless",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legless_1",
            "entryId": "legless_1"
        },
        {
            "entryLabel": "leglessness",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/leglessness_1",
            "entryId": "leglessness_1"
        }
    ],
    "dictionaryCode": "english",
    "nearbyPrecedingEntries": [
        {
            "entryLabel": "legionnaire's disease",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legionnaires-disease_1_1",
            "entryId": "legionnaires-disease_1_1"
        },
        {
            "entryLabel": "legislate",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legislate_1",
            "entryId": "legislate_1"
        },
        {
            "entryLabel": "legislation",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legislation_1",
            "entryId": "legislation_1"
        },
        {
            "entryLabel": "legislative",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legislative_1",
            "entryId": "legislative_1"
        },
        {
            "entryLabel": "legislative assembly",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legislative-assembly_1",
            "entryId": "legislative-assembly_1"
        },
        {
            "entryLabel": "legislative council",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legislative-council_1",
            "entryId": "legislative-council_1"
        },
        {
            "entryLabel": "legislator",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legislator_1",
            "entryId": "legislator_1"
        },
        {
            "entryLabel": "legislatorial",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legislatorial_1",
            "entryId": "legislatorial_1"
        },
        {
            "entryLabel": "legislature",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legislature_1",
            "entryId": "legislature_1"
        },
        {
            "entryLabel": "legist",
            "entryUrl": "http://localhost/api/v1/dictionaries/english/entries/legist_1",
            "entryId": "legist_1"
        }
    ],
    "entryId": "legit_1"
}

XML responses

search

<?xml version="1.0" encoding="utf-8"?>
<search>
    <resultNumber>1</resultNumber>
    <results>
        <entry>
            <entryLabel>legitim</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/legitim_1
            </entryUrl>
            <entryId>legitim_1</entryId>
        </entry>
    </results>
    <dictionaryCode>english</dictionaryCode>
    <currentPageIndex>1</currentPageIndex>
    <pageNumber>1</pageNumber>
</search>

did_you_mean

<?xml version="1.0" encoding="utf-8"?>
<didyoumean>
    <searchTerm>legitim</searchTerm>
    <dictionaryCode>english</dictionaryCode>
    <suggestions>
        <suggestion>legit</suggestion>
        <suggestion>legitimist</suggestion>
        <suggestion>legitimize</suggestion>
        <suggestion>legitimate</suggestion>
        <suggestion>flexitime</suggestion>
        <suggestion>legitimizer</suggestion>
        <suggestion>legitimator</suggestion>
        <suggestion>legitimiser</suggestion>
        <suggestion>gregatim</suggestion>
        <suggestion>legalism</suggestion>
    </suggestions>
</didyoumean>

get_best_matching

<?xml version="1.0" encoding="utf-8" ?>
<entry>
    <topics>
</topics>
<dictionaryCode>english</dictionaryCode>
<entryLabel>legitim</entryLabel>
<entryContent>
    &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
    &lt;entry id=&quot;legitim_1&quot; lang=&quot;en-gb&quot;
    idm_id=&quot;000092803&quot;&gt;&lt;form&gt;&lt;orth&gt;legitim&lt;/orth&gt;&lt;span&gt;
    (&lt;/span&gt;&lt;pron
    type=&quot;&quot;&gt;ˈlɛdʒɪtɪm&lt;/pron&gt;&lt;span&gt;)&lt;/span&gt;&lt;/form&gt;&lt;hom
    id=&quot;legitim_1.1&quot;&gt;&lt;gramGrp&gt;&lt;span&gt; 
    &lt;/span&gt;&lt;pos&gt;noun&lt;/pos&gt;&lt;/gramGrp&gt;&lt;sense&gt;&lt;span&gt;
      &lt;/span&gt;&lt;lbl type=&quot;subj&quot;&gt;Scots
    law&lt;/lbl&gt;&lt;span&gt; &lt;/span&gt;&lt;def&gt;the part of a person's
    moveable estate that is inherited by his or her children on that person's
    death&lt;/def&gt;&lt;/sense&gt;&lt;/hom&gt;&lt;/entry&gt;
</entryContent>
<entryUrl>
    http://localhost/api/v1/dictionaries/english/entries/legitim_1
</entryUrl>
<format>xml</format>
<entryId>legitim_1</entryId>
</entry>

get_entry

<?xml version="1.0" encoding="utf-8" ?>
<entry>
    <topics>
</topics>
<dictionaryCode>english</dictionaryCode>
<entryLabel>legitim</entryLabel>
<entryContent>
    &lt;div class=&quot;entry_container&quot;&gt;&lt;div class=&quot;entry
    lang_en-gb&quot; id=&quot;legitim_1&quot;&gt;&lt;span
    class=&quot;inline&quot;&gt;&lt;h1
    class=&quot;hwd&quot;&gt;legitim&lt;/h1&gt;&lt;span&gt;
    (&lt;/span&gt;&lt;span class=&quot;pron&quot;
    type=&quot;&quot;&gt;ˈlɛdʒɪtɪm&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;div
    class=&quot;hom&quot; id=&quot;legitim_1.1&quot;&gt;&lt;span
    class=&quot;gramGrp&quot;&gt;&lt;span&gt;  &lt;/span&gt;&lt;span
    class=&quot;pos&quot;&gt;noun&lt;/span&gt;&lt;/span&gt;&lt;div
    class=&quot;sense&quot;&gt;&lt;span&gt;   &lt;/span&gt;&lt;span
    class=&quot;lbl&quot;&gt;Scots law&lt;/span&gt;&lt;span&gt;
    &lt;/span&gt;&lt;span class=&quot;def&quot;&gt;the part of a person's
    moveable estate that is inherited by his or her children on that person's
    death&lt;/span&gt;&lt;/div&gt;&lt;!-- End of DIV
    sense--&gt;&lt;/div&gt;&lt;!-- End of DIV hom--&gt;&lt;/div&gt;&lt;!-- End
    of DIV entry lang_en-gb--&gt;&lt;/div&gt;&lt;!-- End of DIV
    entry_container--&gt;
</entryContent>
<entryUrl>
    http://localhost/api/v1/dictionaries/english/entries/legitim_1
</entryUrl>
<format>html</format>
<entryId>legitim_1</entryId>
</entry>

get_pronunciations

<?xml version="1.0" encoding="utf-8"?>
<pronunciations>
    <pronunciation>
        <dictionaryCode>english</dictionaryCode>
        <pronunciationUrl>
            https://api.collinsdictionary.com/media/sounds/sounds/2/254/25406/25406.mp3
        </pronunciationUrl>
        <lang>uk</lang>
        <entryId>happy_1</entryId>
    </pronunciation>
</pronunciations>

get_nearby_entries

<?xml version="1.0" encoding="utf-8"?>
<entry>
    <nearbyFollowingEntries>
        <nearbyEntry>
            <entryLabel>-happy</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happy_2
            </entryUrl>
            <entryId>happy_2</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happy as a sandboy</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happy-as-a-sandboy_1
            </entryUrl>
            <entryId>happy-as-a-sandboy_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happy as Larry</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happy-as-larry_1
            </entryUrl>
            <entryId>happy-as-larry_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happy camper</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happy-camper_1
            </entryUrl>
            <entryId>happy-camper_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happy clapper</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happy-clapper_1
            </entryUrl>
            <entryId>happy-clapper_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happy couple</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happy-couple_1
            </entryUrl>
            <entryId>happy-couple_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happy event</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happy-event_1
            </entryUrl>
            <entryId>happy-event_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happy families</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happy-families_1
            </entryUrl>
            <entryId>happy-families_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happy family</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happy-family_1
            </entryUrl>
            <entryId>happy-family_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happy hour</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happy-hour_1
            </entryUrl>
            <entryId>happy-hour_1</entryId>
        </nearbyEntry>
    </nearbyFollowingEntries>
    <dictionaryCode>english</dictionaryCode>
    <nearbyPrecedingEntries>
        <nearbyEntry>
            <entryLabel>happen</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happen_1
            </entryUrl>
            <entryId>happen_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happen by</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happen-by_1
            </entryUrl>
            <entryId>happen-by_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happen on</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happen-on_1
            </entryUrl>
            <entryId>happen-on_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happenchance</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happenchance_1
            </entryUrl>
            <entryId>happenchance_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happening</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happening_1
            </entryUrl>
            <entryId>happening_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happenstance</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happenstance_1
            </entryUrl>
            <entryId>happenstance_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happier</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happier_1
            </entryUrl>
            <entryId>happier_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happiest</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happiest_1
            </entryUrl>
            <entryId>happiest_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happing</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happing_1
            </entryUrl>
            <entryId>happing_1</entryId>
        </nearbyEntry>
        <nearbyEntry>
            <entryLabel>happoshu</entryLabel>
            <entryUrl>
                http://localhost/api/v1/dictionaries/english/entries/happoshu_1
            </entryUrl>
            <entryId>happoshu_1</entryId>
        </nearbyEntry>
    </nearbyPrecedingEntries>
    <entryId>happy_1</entryId>
</entry>

Typical chain of calls

(didyoumean) -> (getentry) -> (get pronunciation)