Skip to content

BenediktGeiger/ekilex-api-client

Repository files navigation

EKILEX-NODEJS-API-CLIENT

Status

This NodeJs API-Client is still WIP

Getting started

To install this package, you can run this on your terminal:

npm install @vanakaru/ekilex-api-client
Node.js
import { EkilexClient } from '@vanakaru/ekilex-api-client';

Next, configure the library - you'll need an API-KEY in advance:

import { EkilexClient } from '@vanakaru/ekilex-api-client';

const ekilexClient = new EkilexClient({
	apiKey: '123456789', // api key from your ekilex user profile page
	environment: 'prod', // or 'test' depending in which environment you created your key
});

const result = await ekilexClient.words.search('tubli', ['eki']);

/* Example Response
{
    "totalCount": 1,
    "words": [
        {
            "wordId": 247445,
            "wordValue": "tubli",
            "wordValuePrese": "tubli",
            "homonymNr": 1,
            "lang": "est",
            "datasetCodes": [
                "eki",
                "les"
            ],
            ...
        }
    ]
}
*/

// Retrieve WordId from result
const wordId = result.words[0].wordId;

const wordDetails = await ekilexClient.words.getDetails(wordId);

/* Example Response
{
    "word": {
        "wordId": 247445,
        "wordValue": "tubli",
        "wordValuePrese": "tubli",
        "homonymNr": 1,
        "lang": "est",
        "morphophonoForm": "tubli",
        "prefixoid": false,
        "suffixoid": false,
        "foreign": false,
        "lexemesTagNames": [
            "kakskeelne: vaste puudub (prantsuse)",
            "koostamisel",
            "süno valmis"
        ],
        "lastActivityEventOn": "2022-10-27T22:31:01.177+00:00",
        "manualEventOn": "2022-10-27T22:31:01.177+00:00"
    },
    "wordTypes": [...],
    "paradigms": [...],
    "lexemes": [...],
    "wordEtymology": [...],
    "odWordRecommendations": [...],
    "wordRelationDetails": {...}
}

*/

About

A node api client for the Ekilex API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published