Oxford Dictionaries API Documentation

Oxford Dictionaries API Documentation

The Oxford Dictionaries API allows easy access to our world-renowned dictionary content. Use the live documentation below to try it out, view real responses, and explore a growing number of code samples to help you get started.

The documentation is already populated with test credentials to allow you to get started straight away, but to get full, unrestricted use of the API you need to sign up for an account. Once you login to your account the base URL for your API requests will be shown here.

Take a look at our FAQ page if you have any questions, or feel free to contact us.

You can explore the API functionality using the REST client Postman. Click below to import a Collection of useful examples to get you started.

. The full list of filters can be retrieved from the filters Utility endpoint. You can also specify values within the filter using '='. For example 'grammaticalFeatures=singular'. Filters can also be combined using a semicolon.

/inflections/{source_lang}/{word_id}:

Use this to check if a word exists in the dictionary, or what 'root' form it links to (e.g., swimming > swim). The response tells you the possible lemmas

match the filter, or only its 'prime sense'. You can also filter by word length or match by substring (prefix).

/entries/{source_language}/{word_id}/sentences:

Use this to retrieve sentences extracted from corpora which show how a word is used in the language. This is available for English and Spanish. For English, the sentences are linked to the correct sense

This endpoint provides the frequency of a given word. When multiple database records match the query parameters, the returned frequency is the sum of the individual frequencies. For example, if the query parameters are lemma=test, the returned frequency will include the verb "test", the noun "test" and the adjective "test" in all forms (Test, tested, testing, etc.)

If you are interested in the frequency of the word "test" but want to exclude other forms (e.g., tested) use the option trueCase=test. Normally, the word "test" will be spelt with a capital letter at the beginning of a sentence. The option trueCase will ignore this and it will count "Test" and "test" as the same token. If you are interested in frequencies of "Test" and "test", use the option wordform=test or wordform=Test. Note that trueCase is not just a lower case of the word as some words are genuinely spelt with a capital letter such as the word "press" in Oxford University Press.

Parameters can be provided in PATH, GET or POST (form or json). The parameters in PATH are overriden by parameters in GET, POST and json (in that order). In PATH, individual options are separated by semicolon and values are separated by commas (where multiple values can be used). Examples:

PATH: /lemma=test;lexicalCategory=noun

GET: /?lemma=test&lexicalCategory=noun

POST (json):

{
"lemma": "test",
"lexicalCategory": "noun"
}

One of the options wordform/trueCase/lemma/lexicalCategory has to be provided.

/stats/frequency/words/{source_lang}/:

This endpoint provides a list of frequencies for a given word or words. Unlike the /word/ endpoint, the results are split into the smallest units.

To exclude a specific value, prepend it with the minus sign ('-'). For example, to get frequencies of the lemma 'happy' but exclude superlative forms (i.e., happiest) you could use options 'lemma=happy;grammaticalFeatures=-degreeType:superlative'.

Parameters can be provided in PATH, GET or POST (form or json). The parameters in PATH are overridden by parameters in GET, POST and json (in that order). In PATH, individual options are separated by semicolon and values are separated by commas (where multiple values can be used).

The parameters wordform/trueCase/lemma/lexicalCategory also exist in a plural form, taking a lists of items. Examples:

Some queries with "collate" or "sort" can exceed the 30s timeout, in which case the API will return an error message with status code 503. You mitigate this by providing additional restrictions such as "minFrequency" and "maxFrequency".

You can use the parameters "offset" and "limit" to paginate through large result sets. For convenience, the HTTP header "Link" is set on the response to provide links to "first", "self", "next", "prev" and "last" pages of results (depending on the context). For example, if the result set contains 50 results and the parameter "limit" is set to 25, the Links header will contain an URL for the first 25 results and the next 25 results.

Some libraries such as python's requests can parse the header automatically and offer a convenient way of iterating through the results. For example:
```python def get_all_results(url):
while url:

This endpoint returns frequencies of ngrams of size 1-4. That is the number of times a word (ngram size = 1) or words (ngram size > 1) appear in the corpus. Ngrams are case sensitive ("I AM" and "I am" will have different frequency) and frequencies are calculated per word (true case) so "the book" and "the books" are two different ngrams. The results can be filtered based on query parameters.

Parameters can be provided in PATH, GET or POST (form or json). The parameters in PATH are overridden by parameters in GET, POST and json (in that order). In PATH, individual options are separated by semicolon and values are separated by commas (where multiple values can be used).

Example for bigrams (ngram of size 2):

PATH: /tokens=a word,another word

GET: /?tokens=a word&tokens=another word

POST (json):

{
"tokens": ["a word", "another word"]
}

Either "tokens" or "contains" has to be provided.

Some queries with "contains" or "sort" can exceed the 30s timeout, in which case the API will return an error message with status code 503. You mitigate this by providing additional restrictions such as "minFrequency" and "maxFrequency".

You can use the parameters "offset" and "limit" to paginate through large result sets. For convenience, the HTTP header "Link" is set on the response to provide links to "first", "self", "next", "prev" and "last" pages of results (depending on the context). For example, if the result set contains 50 results and the parameter "limit" is set to 25, the Links header will contain an URL for the first 25 results and the next 25 results.

Some libraries such as python's requests can parse the header automatically and offer a convenient way of iterating through the results. For example:
python def get_all_results(url):
while url:
r = requests.get(url)
r.raise_for_status()
for item in r.json()['results']:
yield item
url = r.links.get('next', {}).get('url')

/languages:

Returns a list of monolingual and bilingual language datasets available in the API

/filters:

Returns a list of all the valid filters to construct API calls.

/filters/{endpoint}:

Returns a list of all the valid filters for a given endpoint to construct API calls.