@datafire/wordnik v6.0.0
@datafire/wordnik
Client library for Wordnik
Installation and Usage
npm install --save @datafire/wordnik
let wordnik = require('@datafire/wordnik').create({
api_key: ""
});
.then(data => {
console.log(data);
});
Description
Wordnik is the world's biggest online English dictionary, by number of words
Actions
getApiTokenStatus
Returns usage statistics for the API account.
wordnik.getApiTokenStatus({}, context)
Input
- input
object
- api_key
string
: Wordnik authentication token
- api_key
Output
- output ApiTokenStatus
authenticate
Authenticates a User
wordnik.authenticate({
"username": "",
"password": ""
}, context)
Input
- input
object
- username required
string
: A confirmed Wordnik username - password required
string
: The user's password
- username required
Output
- output AuthenticationToken
authenticatePost
Authenticates a user
wordnik.authenticatePost({
"username": "",
"body": ""
}, context)
Input
- input
object
- username required
string
: A confirmed Wordnik username - body required
string
- username required
Output
- output AuthenticationToken
getLoggedInUser
Requires a valid auth_token to be set.
wordnik.getLoggedInUser({
"auth_token": ""
}, context)
Input
- input
object
- auth_token required
string
: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)
- auth_token required
Output
- output User
getWordListsForLoggedInUser
Fetches WordList objects for the logged-in user.
wordnik.getWordListsForLoggedInUser({
"auth_token": ""
}, context)
Input
- input
object
- auth_token required
string
: auth_token of logged-in user - skip
integer
: Results to skip - limit
integer
: Maximum number of results to return
- auth_token required
Output
- output
array
- items WordList
getWord
Given a word as a string, returns the WordObject that represents it
wordnik.getWord({
"word": ""
}, context)
Input
- input
object
- word required
string
: String value of WordObject to return - useCanonical
string
: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. - includeSuggestions
string
: Return suggestions (for correct spelling, case variants, etc.)
- word required
Output
- output WordObject
getAudio
The metadata includes a time-expiring fileUrl which allows reading the audio file directly from the API. Currently only audio pronunciations from the American Heritage Dictionary in mp3 format are supported.
wordnik.getAudio({
"word": ""
}, context)
Input
- input
object
- word required
string
: Word to get audio for. - useCanonical
string
: Use the canonical form of the word - limit
integer
: Maximum number of results to return
- word required
Output
- output
array
- items AudioFile
getDefinitions
Return definitions for a word
wordnik.getDefinitions({
"word": ""
}, context)
Input
- input
object
- word required
string
: Word to return definitions for - limit
integer
: Maximum number of results to return - partOfSpeech
string
: CSV list of part-of-speech types - includeRelated
string
: Return related words with definitions - sourceDictionaries
array
: Source dictionary to return definitions from. If 'all' is received, results are returned from all sources. If multiple values are received (e.g. 'century,wiktionary'), results are returned from the first specified dictionary that has definitions. If left blank, results are returned from the first dictionary that has definitions. By default, dictionaries are searched in this order: ahd, wiktionary, webster, century, wordnet - useCanonical
string
: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. - includeTags
string
: Return a closed set of XML tags in response
- word required
Output
- output
array
- items Definition
getEtymologies
Fetches etymology data
wordnik.getEtymologies({
"word": ""
}, context)
Input
- input
object
- word required
string
: Word to return - useCanonical
string
: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.
- word required
Output
- output
array
- items
string
- items
getExamples
Returns examples for a word
wordnik.getExamples({
"word": ""
}, context)
Input
- input
object
- word required
string
: Word to return examples for - includeDuplicates
string
: Show duplicate examples from different sources - useCanonical
string
: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. - skip
integer
: Results to skip - limit
integer
: Maximum number of results to return
- word required
Output
- output ExampleSearchResults
getWordFrequency
Returns word usage over time
wordnik.getWordFrequency({
"word": ""
}, context)
Input
- input
object
- word required
string
: Word to return - useCanonical
string
: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. - startYear
integer
: Starting Year - endYear
integer
: Ending Year
- word required
Output
- output FrequencySummary
getHyphenation
Returns syllable information for a word
wordnik.getHyphenation({
"word": ""
}, context)
Input
- input
object
- word required
string
: Word to get syllables for - useCanonical
string
: If true will try to return a correct word root ('cats' -> 'cat'). If false returns exactly what was requested. - sourceDictionary
string
: Get from a single dictionary. Valid options: ahd, century, wiktionary, webster, and wordnet. - limit
integer
: Maximum number of results to return
- word required
Output
- output
array
- items Syllable
getPhrases
Fetches bi-gram phrases for a word
wordnik.getPhrases({
"word": ""
}, context)
Input
- input
object
- word required
string
: Word to fetch phrases for - limit
integer
: Maximum number of results to return - wlmi
integer
: Minimum WLMI for the phrase - useCanonical
string
: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.
- word required
Output
- output
array
- items Bigram
getTextPronunciations
Returns text pronunciations for a given word
wordnik.getTextPronunciations({
"word": ""
}, context)
Input
- input
object
- word required
string
: Word to get pronunciations for - useCanonical
string
: If true will try to return a correct word root ('cats' -> 'cat'). If false returns exactly what was requested. - sourceDictionary
string
: Get from a single dictionary - typeFormat
string
: Text pronunciation type - limit
integer
: Maximum number of results to return
- word required
Output
- output
array
- items TextPron
getRelatedWords
Given a word as a string, returns relationships from the Word Graph
wordnik.getRelatedWords({
"word": ""
}, context)
Input
- input
object
- word required
string
: Word to fetch relationships for - useCanonical
string
: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested. - relationshipTypes
string
: Limits the total results per type of relationship type - limitPerRelationshipType
integer
: Restrict to the supplied relationship types
- word required
Output
- output
array
- items Related
getTopExample
Returns a top example for a word
wordnik.getTopExample({
"word": ""
}, context)
Input
- input
object
- word required
string
: Word to fetch examples for - useCanonical
string
: If true will try to return the correct word root ('cats' -> 'cat'). If false returns exactly what was requested.
- word required
Output
- output Example
deleteWordList
Deletes an existing WordList
wordnik.deleteWordList({
"permalink": "",
"auth_token": ""
}, context)
Input
- input
object
- permalink required
string
: ID of WordList to delete - auth_token required
string
: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)
- permalink required
Output
Output schema unknown
getWordListByPermalink
Fetches a WordList by ID
wordnik.getWordListByPermalink({
"permalink": "",
"auth_token": ""
}, context)
Input
- input
object
- permalink required
string
: permalink of WordList to fetch - auth_token required
string
: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)
- permalink required
Output
- output WordList
updateWordList
Updates an existing WordList
wordnik.updateWordList({
"permalink": "",
"auth_token": ""
}, context)
Input
- input
object
- permalink required
string
: permalink of WordList to update - body WordList
- auth_token required
string
: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)
- permalink required
Output
Output schema unknown
deleteWordsFromWordList
Removes words from a WordList
wordnik.deleteWordsFromWordList({
"permalink": "",
"auth_token": ""
}, context)
Input
- input
object
- permalink required
string
: permalink of WordList to use - body
array
- items StringValue
- auth_token required
string
: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)
- permalink required
Output
Output schema unknown
getWordListWords
Fetches words in a WordList
wordnik.getWordListWords({
"permalink": "",
"auth_token": ""
}, context)
Input
- input
object
- permalink required
string
: ID of WordList to use - sortBy
string
: Field to sort by - sortOrder
string
: Direction to sort - skip
integer
: Results to skip - limit
integer
: Maximum number of results to return - auth_token required
string
: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)
- permalink required
Output
- output
array
- items WordListWord
addWordsToWordList
Adds words to a WordList
wordnik.addWordsToWordList({
"permalink": "",
"auth_token": ""
}, context)
Input
- input
object
- permalink required
string
: permalink of WordList to user - body
array
- items StringValue
- auth_token required
string
: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)
- permalink required
Output
Output schema unknown
createWordList
Creates a WordList.
wordnik.createWordList({
"auth_token": ""
}, context)
Input
- input
object
- body WordList
- auth_token required
string
: The auth token of the logged-in user, obtained by calling /account.{format}/authenticate/{username} (described above)
Output
- output WordList
getRandomWord
Returns a single random WordObject
wordnik.getRandomWord({}, context)
Input
- input
object
- hasDictionaryDef
string
: Only return words with dictionary definitions - includePartOfSpeech
string
: CSV part-of-speech values to include - excludePartOfSpeech
string
: CSV part-of-speech values to exclude - minCorpusCount
integer
: Minimum corpus frequency for terms - maxCorpusCount
integer
: Maximum corpus frequency for terms - minDictionaryCount
integer
: Minimum dictionary count - maxDictionaryCount
integer
: Maximum dictionary count - minLength
integer
: Minimum word length - maxLength
integer
: Maximum word length
- hasDictionaryDef
Output
- output WordObject
getRandomWords
Returns an array of random WordObjects
wordnik.getRandomWords({}, context)
Input
- input
object
- hasDictionaryDef
string
: Only return words with dictionary definitions - includePartOfSpeech
string
: CSV part-of-speech values to include - excludePartOfSpeech
string
: CSV part-of-speech values to exclude - minCorpusCount
integer
: Minimum corpus frequency for terms - maxCorpusCount
integer
: Maximum corpus frequency for terms - minDictionaryCount
integer
: Minimum dictionary count - maxDictionaryCount
integer
: Maximum dictionary count - minLength
integer
: Minimum word length - maxLength
integer
: Maximum word length - sortBy
string
: Attribute to sort by - sortOrder
string
: Sort direction - limit
integer
: Maximum number of results to return
- hasDictionaryDef
Output
- output
array
- items WordObject
reverseDictionary
Reverse dictionary search
wordnik.reverseDictionary({
"query": ""
}, context)
Input
- input
object
- query required
string
: Search term - findSenseForWord
string
: Restricts words and finds closest sense - includeSourceDictionaries
string
: Only include these comma-delimited source dictionaries - excludeSourceDictionaries
string
: Exclude these comma-delimited source dictionaries - includePartOfSpeech
string
: Only include these comma-delimited parts of speech - excludePartOfSpeech
string
: Exclude these comma-delimited parts of speech - minCorpusCount
integer
: Minimum corpus frequency for terms - maxCorpusCount
integer
: Maximum corpus frequency for terms - minLength
integer
: Minimum word length - maxLength
integer
: Maximum word length - expandTerms
string
: Expand terms - includeTags
string
: Return a closed set of XML tags in response - sortBy
string
: Attribute to sort by - sortOrder
string
: Sort direction - skip
string
: Results to skip - limit
integer
: Maximum number of results to return
- query required
Output
- output DefinitionSearchResults
searchWords
Searches words
wordnik.searchWords({
"query": ""
}, context)
Input
- input
object
- query required
string
: Search query - caseSensitive
string
: Search case sensitive - includePartOfSpeech
string
: Only include these comma-delimited parts of speech - excludePartOfSpeech
string
: Exclude these comma-delimited parts of speech - minCorpusCount
integer
: Minimum corpus frequency for terms - maxCorpusCount
integer
: Maximum corpus frequency for terms - minDictionaryCount
integer
: Minimum number of dictionary entries for words returned - maxDictionaryCount
integer
: Maximum dictionary definition count - minLength
integer
: Minimum word length - maxLength
integer
: Maximum word length - skip
integer
: Results to skip - limit
integer
: Maximum number of results to return
- query required
Output
- output WordSearchResults
getWordOfTheDay
Returns a specific WordOfTheDay
wordnik.getWordOfTheDay({}, context)
Input
- input
object
- date
string
: Fetches by date in yyyy-MM-dd
- date
Output
- output WordOfTheDay
Definitions
ApiTokenStatus
- ApiTokenStatus
object
- expiresInMillis
integer
- remainingCalls
integer
- resetsInMillis
integer
- token
string
- totalRequests
integer
- valid
boolean
- expiresInMillis
AudioFile
- AudioFile
object
- attributionText
string
- attributionUrl
string
- audioType
string
- commentCount
integer
- createdAt
string
- createdBy
string
- description
string
- duration
number
- fileUrl
string
- id required
integer
- voteAverage
number
- voteCount
integer
- voteWeightedAverage
number
- word
string
- attributionText
AudioType
- AudioType
object
- id
integer
- name
string
- id
AuthenticationToken
- AuthenticationToken
object
- token
string
- userId
integer
- userSignature
string
- token
Bigram
- Bigram
object
- count
integer
- gram1
string
- gram2
string
- mi
number
- wlmi
number
- count
Category
- Category
object
- id required
integer
- name
string
- id required
Citation
- Citation
object
- cite
string
- source
string
- cite
ContentProvider
- ContentProvider
object
- id
integer
- name
string
- id
Definition
- Definition
object
- attributionText
string
- attributionUrl
string
- citations
array
- items Citation
- exampleUses
array
- items ExampleUsage
- extendedText
string
- labels
array
- items Label
- notes
array
- items Note
- partOfSpeech
string
- relatedWords
array
- items Related
- score
number
- seqString
string
- sequence
string
- sourceDictionary
string
- text
string
- textProns
array
- items TextPron
- word
string
- attributionText
DefinitionSearchResults
- DefinitionSearchResults
object
- results
array
- items Definition
- totalResults
integer
- results
Example
- Example
object
- documentId
integer
- exampleId
integer
- id
integer
- provider ContentProvider
- rating
number
- score ScoredWord
- sentence Sentence
- text
string
- title
string
- url
string
- word
string
- year
integer
- documentId
ExampleSearchResults
ExampleUsage
- ExampleUsage
object
- text
string
- text
Facet
- Facet
object
- facetValues
array
- items FacetValue
- name
string
- facetValues
FacetValue
- FacetValue
object
- count
integer
- value
string
- count
Frequency
- Frequency
object
- count
integer
- year
integer
- count
FrequencySummary
- FrequencySummary
object
- frequency
array
- items Frequency
- frequencyString
string
- totalCount
integer
- unknownYearCount
integer
- word
string
- frequency
Label
- Label
object
- text
string
- type
string
- text
Note
- Note
object
- appliesTo
array
- items
string
- items
- noteType
string
- pos
integer
- value
string
- appliesTo
PartOfSpeech
- PartOfSpeech
object
Related
- Related
object
- gram
string
- label1
string
- label2
string
- label3
string
- label4
string
- relationshipType
string
- words
array
- items
string
- items
- gram
Root
- Root
object
- categories
array
- items Category
- id required
integer
- name
string
- categories
ScoredWord
- ScoredWord
object
- baseWordScore
number
- docTermCount
integer
- id
integer
- lemma
string
- partOfSpeech
string
- position
integer
- score
number
- sentenceId
integer
- stopword
boolean
- word
string
- wordType
string
- baseWordScore
Sentence
- Sentence
object
- display
string
- documentMetadataId
integer
- hasScoredWords
boolean
- id
integer
- rating
integer
- scoredWords
array
- items ScoredWord
- display
SimpleDefinition
- SimpleDefinition
object
- note
string
- partOfSpeech
string
- source
string
- text
string
- note
SimpleExample
- SimpleExample
object
- id
integer
- text
string
- title
string
- url
string
- id
StringValue
- StringValue
object
- word
string
- word
Syllable
- Syllable
object
- seq
integer
- text
string
- type
string
- seq
TextPron
- TextPron
object
- raw
string
- rawType
string
- seq
integer
- raw
User
- User
object
- displayName
string
- email
string
- faceBookId
string
- id
integer
- password
string
- status
integer
- userName
string
- username
string
- displayName
WordList
- WordList
object
- createdAt
string
- description
string
- id
integer
- lastActivityAt
string
- name
string
- numberWordsInList
integer
- permalink
string
- type
string
- updatedAt
string
- userId
integer
- username
string
- createdAt
WordListWord
- WordListWord
object
- createdAt
string
- id required
integer
- numberCommentsOnWord
integer
- numberLists
integer
- userId
integer
- username
string
- word
string
- createdAt
WordObject
- WordObject
object
- canonicalForm
string
- id required
integer
- originalWord
string
- suggestions
array
- items
string
- items
- vulgar
string
- word
string
- canonicalForm
WordOfTheDay
- WordOfTheDay
object
- category
string
- contentProvider ContentProvider
- createdAt
string
- createdBy
string
- definitions
array
- items SimpleDefinition
- examples
array
- items SimpleExample
- htmlExtra
string
- id required
integer
- note
string
- parentId
string
- publishDate
string
- word
string
- category
WordSearchResult
- WordSearchResult
object
- count
integer
- lexicality
number
- word
string
- count
WordSearchResults
- WordSearchResults
object
- searchResults
array
- items WordSearchResult
- totalResults
integer
- searchResults