Retrieve a list of frequencies of a word/words derived from a corpus.
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. <br> <br> 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'. <br> <br> 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). <br> <br> The parameters wordform/trueCase/lemma/lexicalCategory also exist in a plural form, taking a lists of items. Examples:
- PATH: /wordforms=happy,happier,happiest
- GET: /?wordforms=happy&wordforms=happier&wordforms=happiest
- POST (json):
{
"wordforms": ["happy", "happier", "happiest"]
}
A mor complex example of retrieving frequencies of multiple lemmas:
{
"lemmas": ["happy", "content", "cheerful", "cheery", "merry", "joyful", "ecstatic"],
"grammaticalFeatures": {
"adjectiveFunctionType": "predicative"
},
"lexicalCategory": "adjective",
"sort": ["lemma", "-frequency"]
}
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". <br> <br> 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. <br> <br> Some libraries such as python's requests can parse the header automatically and offer a convenient way of iterating through the results. For example:
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')
Path parameters
IANA language code
Query parameters
For corpora other than 'nmc' (New Monitor Corpus) please contact api@oxforddictionaries.com
The written form of the word to look up (preserving case e.g., Book vs book)
The written form of the word to look up with normalised case (Books --> books)
The lemma of the word to look up (e.g., Book, booked, books all have the lemma "book")
The lexical category of the word(s) to look up (e.g., adjective or noun)
The grammatical features of the word(s) to look up entered as a list of k:v (e.g., degree_type:comparative)
sort the resulting list by wordform, trueCase, lemma, lexicalCategory, frequency, normalizedFrequency. Descending order is achieved by prepending the value with the minus sign ('-'). Multiple values can be separated by commas (e.g., sort=lexicalCategory,-frequency)
collate the results by wordform, trueCase, lemma, lexicalCategory. Multiple values can be separated by commas (e.g., collate=trueCase,lemma,lexicalCategory).
Restrict the query to entries with frequency of at least minFrequency
Restrict the query to entries with frequency of at most maxFrequency
Restrict the query to entries with frequency of at least minNormalizedFrequency
Restrict the query to entries with frequency of at most maxNormalizedFrequency
pagination - results offset
pagination - results limit
Headers
App ID Authentication Parameter
App Key Authentication Parameter
Response
Successful response.