{"openapi":"3.0.3","info":{"title":"KelimetriK API","version":"1.0.0","description":"Lexical and orthographic statistics for Turkish words. Default lexicon version: 2014.2; pass `lexicon=<version>` (one of 2014.2) to choose another. All responses are JSON unless noted; errors use `{ error: { code, message } }`. Fields are only ever added, never renamed or removed, within /api/v1.\n\nPlease cite: Erten, B., Bozsahin, C., & Zeyrek, D. (2014). Turkish Resources for Visual Word Recognition. LREC'14, 2106–2110."},"servers":[{"url":"https://kelimetrik.onthejourney.nl/api/v1"}],"components":{"schemas":{"WordResult":{"type":"object","properties":{"query":{"type":"string","description":"The input as received"},"normalized":{"type":"string","description":"Trimmed, Turkish lower-cased, NFC, circumflex folded (â→a, î→i, û→u)"},"inLexicon":{"type":"boolean"},"pos":{"type":"string","nullable":true,"description":"Part of speech; null for nonwords"},"frequency":{"type":"number","nullable":true,"description":"Occurrences per million; null for nonwords"},"count":{"type":"integer","nullable":true,"description":"Raw corpus count; null for nonwords or lexicons without counts"},"zipf":{"type":"number","nullable":true,"description":"Zipf-scale frequency: log10 of occurrences per billion"},"posFrequencies":{"type":"object","nullable":true,"additionalProperties":{"type":"integer"},"description":"Corpus count per POS reading; null for nonwords and for lexicons without counts"},"spellings":{"type":"object","nullable":true,"additionalProperties":{"type":"integer"},"description":"Source spellings folded into this form (circumflex variants), with counts"},"length":{"type":"integer"},"n":{"type":"integer","description":"Orthographic neighbourhood size (Coltheart's N)"},"old20":{"type":"number","description":"Orthographic Levenshtein Distance 20"},"bigrams":{"type":"array","items":{"$ref":"#/components/schemas/NgramStat"}},"bigramMeans":{"$ref":"#/components/schemas/NgramMeans"},"trigrams":{"type":"array","items":{"$ref":"#/components/schemas/NgramStat"}},"trigramMeans":{"$ref":"#/components/schemas/NgramMeans"},"neighbors":{"$ref":"#/components/schemas/WordList"},"transposed":{"$ref":"#/components/schemas/WordList"},"subsets":{"$ref":"#/components/schemas/WordList"},"supersets":{"$ref":"#/components/schemas/WordList"},"lexiconVersion":{"type":"string"}},"required":["query","normalized","inLexicon","pos","frequency","count","zipf","posFrequencies","spellings","length","n","old20","bigrams","bigramMeans","trigrams","trigramMeans","neighbors","transposed","subsets","supersets","lexiconVersion"]},"NgramStat":{"type":"object","properties":{"ngram":{"type":"string"},"positional":{"type":"integer","description":"Other same-length words with this n-gram at the same position"},"total":{"type":"integer","description":"Occurrences of this n-gram at any position across other same-length words"}},"required":["ngram","positional","total"]},"NgramMeans":{"type":"object","properties":{"positional":{"type":"number","nullable":true},"total":{"type":"number","nullable":true}},"required":["positional","total"]},"WordList":{"type":"object","properties":{"count":{"type":"integer"},"words":{"type":"array","items":{"type":"string"},"description":"Omitted when lists=false"}},"required":["count"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_input","batch_too_large","rate_limited","not_found","internal_error"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["error"]},"BatchResponse":{"type":"object","properties":{"lexiconVersion":{"type":"string"},"results":{"type":"array","items":{"anyOf":[{"$ref":"#/components/schemas/WordResult"},{"$ref":"#/components/schemas/BatchItemError"}]}}},"required":["lexiconVersion","results"]},"BatchItemError":{"type":"object","properties":{"query":{"type":"string"},"error":{"type":"object","properties":{"code":{"type":"string","enum":["invalid_input","batch_too_large","rate_limited","not_found","internal_error"]},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["code","message"]}},"required":["query","error"]},"BatchRequest":{"type":"object","properties":{"words":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":2000,"example":["kule","kale","süt"]},"lists":{"type":"boolean","default":false}},"required":["words"]},"LexiconPage":{"type":"object","properties":{"lexiconVersion":{"type":"string"},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"},"records":{"type":"array","items":{"$ref":"#/components/schemas/LexiconRecord"}}},"required":["lexiconVersion","total","limit","offset","records"]},"LexiconRecord":{"type":"object","properties":{"word":{"type":"string"},"pos":{"type":"string"},"frequency":{"type":"number"},"count":{"type":"integer","nullable":true},"zipf":{"type":"number","nullable":true},"posFrequencies":{"type":"object","nullable":true,"additionalProperties":{"type":"integer"},"description":"Corpus count per POS reading; null for nonwords and for lexicons without counts"},"spellings":{"type":"object","nullable":true,"additionalProperties":{"type":"integer"},"description":"Source spellings folded into this form (circumflex variants), with counts"},"length":{"type":"integer"},"n":{"type":"integer"},"old20":{"type":"number"},"bigramPositionalMean":{"type":"number","nullable":true},"bigramTotalMean":{"type":"number","nullable":true},"trigramPositionalMean":{"type":"number","nullable":true},"trigramTotalMean":{"type":"number","nullable":true},"transposedCount":{"type":"integer"},"subsetCount":{"type":"integer"},"supersetCount":{"type":"integer"}},"required":["word","pos","frequency","count","zipf","posFrequencies","spellings","length","n","old20","bigramPositionalMean","bigramTotalMean","trigramPositionalMean","trigramTotalMean","transposedCount","subsetCount","supersetCount"]},"Meta":{"type":"object","properties":{"apiVersion":{"type":"string"},"lexiconVersion":{"type":"string"},"entryCount":{"type":"integer"},"defaultLexicon":{"type":"string"},"lexicons":{"type":"array","items":{"type":"object","properties":{"version":{"type":"string"},"label":{"type":"string"},"entryCount":{"type":"integer"},"source":{"type":"string"},"description":{"type":"string"},"totalTokens":{"type":"integer","nullable":true}},"required":["version","label","entryCount","source","description","totalTokens"]}},"author":{"type":"string"},"citation":{"type":"string"},"license":{"type":"string"},"licenseUrl":{"type":"string"},"limits":{"type":"object","properties":{"maxBatchWords":{"type":"integer"},"maxQueryLength":{"type":"integer"},"requestsPerMinute":{"type":"integer"},"batchRequestsPerMinute":{"type":"integer"}},"required":["maxBatchWords","maxQueryLength","requestsPerMinute","batchRequestsPerMinute"]}},"required":["apiVersion","lexiconVersion","entryCount","defaultLexicon","lexicons","author","citation","license","licenseUrl","limits"]}},"parameters":{}},"paths":{"/words/{word}":{"get":{"summary":"All KelimetriK measures for one word or nonword","description":"Returns lexicon membership, POS, frequency, Coltheart's N, OLD20, bigram/trigram statistics and orthographic similarity lists. Nonwords are accepted: pos and frequency are null and all orthographic measures are still computed.\n\n**curl**\n```\ncurl https://kelimetrik.onthejourney.nl/api/v1/words/kule\ncurl \"https://kelimetrik.onthejourney.nl/api/v1/words/k%C3%A2r\"   # circumflex is folded: same result as kar\n```\n**Python**\n```python\nimport requests\nr = requests.get('https://kelimetrik.onthejourney.nl/api/v1/words/kule').json()\nprint(r['n'], r['old20'])\n```\n**R**\n```r\nlibrary(jsonlite)\nr <- fromJSON('https://kelimetrik.onthejourney.nl/api/v1/words/kule')\nr$n; r$old20\n```","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":40,"example":"kule"},"required":true,"name":"word","in":"path"},{"schema":{"type":"string","enum":["true","false"],"default":"true","description":"Set to false to omit neighbour/transposed/subset/superset word lists"},"required":false,"description":"Set to false to omit neighbour/transposed/subset/superset word lists","name":"lists","in":"query"},{"schema":{"type":"string","enum":["2014.2"],"default":"2014.2","description":"Lexicon version to compute against (default 2014.2). See /meta for the list."},"required":false,"description":"Lexicon version to compute against (default 2014.2). See /meta for the list.","name":"lexicon","in":"query"}],"responses":{"200":{"description":"Measures","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WordResult"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited (see Retry-After header)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/batch":{"post":{"summary":"Measures for up to 2,000 words in one request","description":"Results are returned in input order; invalid entries become error objects instead of failing the whole request. Add `?format=csv` for a CSV of the summary columns.\n\n**curl**\n```\ncurl -X POST https://kelimetrik.onthejourney.nl/api/v1/batch -H 'Content-Type: application/json' -d '{\"words\":[\"kule\",\"kale\"]}'\n```\n**Python**\n```python\nimport requests\nr = requests.post('https://kelimetrik.onthejourney.nl/api/v1/batch', json={'words': ['kule', 'kale']}).json()\n```\n**R**\n```r\nlibrary(httr); library(jsonlite)\nres <- POST('https://kelimetrik.onthejourney.nl/api/v1/batch', body = list(words = c('kule','kale')), encode = 'json')\nfromJSON(content(res, 'text'))\n```","parameters":[{"schema":{"type":"string","enum":["json","csv"]},"required":false,"name":"format","in":"query"},{"schema":{"type":"string","enum":["2014.2"],"default":"2014.2","description":"Lexicon version to compute against (default 2014.2). See /meta for the list."},"required":false,"description":"Lexicon version to compute against (default 2014.2). See /meta for the list.","name":"lexicon","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchRequest"}}}},"responses":{"200":{"description":"Results in input order","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchResponse"}},"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Body too large","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited (see Retry-After header)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/lexicon":{"get":{"summary":"Browse the precomputed lexicon table","parameters":[{"schema":{"type":"string","enum":["2014.2"],"default":"2014.2","description":"Lexicon version to compute against (default 2014.2). See /meta for the list."},"required":false,"description":"Lexicon version to compute against (default 2014.2). See /meta for the list.","name":"lexicon","in":"query"},{"schema":{"type":"string"},"required":false,"name":"prefix","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":30},"required":false,"name":"length","in":"query"},{"schema":{"type":"string"},"required":false,"name":"pos","in":"query"},{"schema":{"type":"number","nullable":true,"minimum":0},"required":false,"name":"minFreq","in":"query"},{"schema":{"type":"number","nullable":true,"minimum":0},"required":false,"name":"maxFreq","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"A page of records","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LexiconPage"}}}},"400":{"description":"Invalid input","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Rate limited (see Retry-After header)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/lexicon/download":{"get":{"summary":"Download the full lexicon as CSV","parameters":[{"schema":{"type":"string","enum":["2014.2"],"default":"2014.2","description":"Lexicon version to compute against (default 2014.2). See /meta for the list."},"required":false,"description":"Lexicon version to compute against (default 2014.2). See /meta for the list.","name":"lexicon","in":"query"}],"responses":{"200":{"description":"CSV with header row","content":{"text/csv":{"schema":{"type":"string"}}}}}}},"/meta":{"get":{"summary":"API and lexicon metadata","responses":{"200":{"description":"Metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Meta"}}}}}}}}}