1.0.0 • Published 4 years ago

emsi-skills-api v1.0.0

Weekly downloads
58
License
MIT
Repository
github
Last release
4 years ago

Emsi Skills Classification API

The unofficial Node.js package for the Emsi Skills Classification API

This package covers all available endpoints for the Emsi Skills Classification API. Official API docs are available here

Installing / Getting started

npm install --save emsi-skills-api

or

yarn add emsi-skills-api

To require the full set of endpoints use:

const SkillsAPI = require("emsi-skills-api");

To target a particular group of endpoints, object destructuring can be used:

const { skillTypes } = require("emsi-skills-api");

Initial Configuration

This package requires two environment variables to be set: EMSI_CLIENT_ID and EMSI_SECRET. These are the values provided by Emsi when you sign up for API access on their site. The environment variable EMSI_SCOPE can be set, but it defaults to the only valid value (emsi_open);

Example

Get all skills:

const SkillsAPI = require("emsi-skills-api");

SkillsAPI.skills.listAllSkills().then((skills) => {
  console.log(skills);
});

API

All functions return a Promise. They can be chained with .then() or used with async/await;

const SkillsAPI = require("emsi-skills-api");

/*
 * Status
 */

SkillsAPI.status.getStatus(); // Boolean

/*
 * Meta
 */

SkillsAPI.meta.getMeta(); // { attribution, latestVersion }

/*
 * Versions
 */

SkillsAPI.versions.getVersions(); // [string]

/*
 * Skills
 */

// List all skills
SkillsAPI.skills.listAllSkills({ version? }); // [{ type, id, name, infoUrl }]

// Search for skills
SkillsAPI.skills.searchSkills({ term, version? }); // [{ type, id, name, infoUrl }]

// Get skills by type
SkillsAPI.skills.skillsByType({ typeIds, version? }); // [{ type, id, name, infoUrl }]

// Get a skill by ID
SkillsAPI.skills.skillById({ skillId, version? }); // { type, id, name, infoUrl }

/*
 * Related
 */

// List related skills
SkillsAPI.related.getRelated({ ids, version? }); // [{ type, id, name, infoUrl }]

/*
 * Extract
 */

// Extract skills from document
SkillsAPI.extract.extractFromDocument({ documentText, version? });
// {
//   data: [
//     {
//       confidence: 1,
//       skill: { id, infoUrl, name, tags, type }
//     }
//   ]
// }

// Extract skills with source
SkillsAPI.extract.extractFromDocumentWithSource({ documentText, version? }); // { data: { skills: [], trace: [] } }

Contributing

If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are welcome.

This project uses ESLint defaults and Prettier for linting/formatting. Mocha/Chai are used for testing.

Links

Licensing

The code in this project is licensed under MIT license.

1.0.0

4 years ago

0.1.3

4 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago