GET /stats/frequency/words/{source_lang}/

oxforddictionaries.com

Summary: Retrieve a list of frequencies of a word/words derived from a corpus.
Operation ID:
Auth: unknown
Description

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): ```javascript { "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: ```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') ```

Parameters (17)

app_id (string, header, required, default: 5037d509)

App ID Authentication Parameter

app_key (string, header, required, default: 4dc1aebaa63721f0f8e79a55e2514bc7)

App Key Authentication Parameter

collate (string, query, optional)

collate the results by wordform, trueCase, lemma, lexicalCategory. Multiple values can be separated by commas (e.g., collate=trueCase,lemma,lexicalCategory).

corpus (string, query, optional, default: nmc)

For corpora other than 'nmc' (New Monitor Corpus) please contact api@oxforddictionaries.com

grammaticalFeatures (string, query, optional)

The grammatical features of the word(s) to look up entered as a list of k:v (e.g., degree_type:comparative)

lemma (string, query, optional, default: test)

The lemma of the word to look up (e.g., Book, booked, books all have the lemma "book")

lexicalCategory (string, query, optional)

The lexical category of the word(s) to look up (e.g., adjective or noun)

limit (integer, query, optional, default: 100)

pagination - results limit

maxFrequency (integer, query, optional)

Restrict the query to entries with frequency of at most `maxFrequency`

maxNormalizedFrequency (number, query, optional)

Restrict the query to entries with frequency of at most `maxNormalizedFrequency`

minFrequency (integer, query, optional)

Restrict the query to entries with frequency of at least `minFrequency`

minNormalizedFrequency (number, query, optional)

Restrict the query to entries with frequency of at least `minNormalizedFrequency`

offset (integer, query, optional, default: 0)

pagination - results offset

sort (string, query, optional)

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)

source_lang (string, path, required, default: en)

IANA language code

trueCase (string, query, optional)

The written form of the word to look up with normalised case (Books --> books)

wordform (string, query, optional)

The written form of the word to look up (preserving case e.g., Book vs book)

No probe data for this endpoint yet.