npm package: @sharpapi/sharpapi-node-related-skills
Description: SharpAPI.com Node.js SDK for finding related skills
Author: Dawid Makowski
Latest version: 1.0.1

![SharpAPI GitHub cover](https://sharpapi.com/sharpapi-github-php-bg.jpg "SharpAPI Node.js Client")

# Related Skills Generator API for Node.js

## 🎯 Generate related skills with AI — powered by SharpAPI.

[![npm version](https://img.shields.io/npm/v/@sharpapi/sharpapi-node-related-skills.svg)](https://www.npmjs.com/package/@sharpapi/sharpapi-node-related-skills)
[![License](https://img.shields.io/npm/l/@sharpapi/sharpapi-node-related-skills.svg)](https://github.com/sharpapi/sharpapi-node-client/blob/master/LICENSE.md)

**SharpAPI Related Skills Generator** uses AI to generate a list of related skills based on the provided skill name. Perfect for HR tech, recruitment platforms, skill assessment tools, and career development applications.

---

## 📋 Table of Contents

1. [Requirements](#requirements)
2. [Installation](#installation)
3. [Usage](#usage)
4. [API Documentation](#api-documentation)
5. [Response Format](#response-format)
6. [Examples](#examples)
7. [License](#license)

---

## Requirements

- Node.js >= 16.x
- npm or yarn

---

## Installation

### Step 1. Install the package via npm:

```bash
npm install @sharpapi/sharpapi-node-related-skills
```

### Step 2. Get your API key

Visit [SharpAPI.com](https://sharpapi.com/) to get your API key.

---

## Usage

```javascript
const { SharpApiRelatedSkillsService } = require('@sharpapi/sharpapi-node-related-skills');

const apiKey = process.env.SHARP_API_KEY; // Store your API key in environment variables
const service = new SharpApiRelatedSkillsService(apiKey);

const skillName = 'JavaScript';

async function generateRelatedSkills() {
  try {
    // Submit related skills generation job
    const statusUrl = await service.generateRelatedSkills(skillName, 'English', 10);
    console.log('Job submitted. Status URL:', statusUrl);

    // Fetch results (polls automatically until complete)
    const result = await service.fetchResults(statusUrl);
    console.log('Related skills:', result.getResultJson());
  } catch (error) {
    console.error('Error:', error.message);
  }
}

generateRelatedSkills();
```

---

## API Documentation

### Methods

#### `generateRelatedSkills(skillName: string, language?: string, maxQuantity?: number, voiceTone?: string, context?: string): Promise<string>`

Generates a list of related skills based on the provided skill name.

**Parameters:**
- `skillName` (string, required): The skill name to find related skills for
- `language` (string, optional): Output language (default: 'English')
- `maxQuantity` (number, optional): Maximum number of related skills to return (default: 10)
- `voiceTone` (string, optional): Tone of the response (e.g., 'Professional', 'Casual')
- `context` (string, optional): Additional context for the AI

**Returns:**
- Promise<string>: Status URL for polling the job result

**Example:**
```javascript
const statusUrl = await service.generateRelatedSkills(
  'Python',
  'English',
  5,
  'Professional',
  'Focus on data science and machine learning skills'
);
const result = await service.fetchResults(statusUrl);
```

---

## Response Format

The API returns related skills with relevance scores (weight: 0-10, where 10 is the highest relevance):

```json
{
  "data": {
    "type": "api_job_result",
    "id": "bac70cd7-5347-4443-9632-c82019f73e9a",
    "attributes": {
      "status": "success",
      "type": "hr_related_skills",
      "result": {
        "skill": "Quicken",
        "related_skills": [
          {
            "name": "Accounting",
            "weight": 8.7
          },
          {
            "name": "Bookkeeping",
            "weight": 7
          },
          {
            "name": "Financial Management",
            "weight": 6.8
          },
          {
            "name": "Financial Reporting",
            "weight": 7.5
          },
          {
            "name": "Microsoft Excel",
            "weight": 6.5
          },
          {
            "name": "QuickBooks",
            "weight": 9.2
          }
        ]
      }
    }
  }
}
```

**Weight Scale:**
- `10.0` - Extremely related (essential companion skill)
- `8.0-9.9` - Highly related (commonly used together)
- `6.0-7.9` - Moderately related (useful complementary skill)
- `4.0-5.9` - Somewhat related (beneficial to know)
- `1.0-3.9` - Loosely related (nice to have)

---

## Examples

### Basic Related Skills Generation

```javascript
const { SharpApiRelatedSkillsService } = require('@sharpapi/sharpapi-node-related-skills');

const service = new SharpApiRelatedSkillsService(process.env.SHARP_API_KEY);

service.generateRelatedSkills('HTML', 'English', 5)
  .then(statusUrl => service.fetchResults(statusUrl))
  .then(result => {
    const data = result.getResultJson();
    console.log(`Related skills for ${data.result.skill}:`);

    data.result.related_skills.forEach((skill, index) => {
      console.log(`${index + 1}. ${skill.name} (relevance: ${skill.weight}/10)`);
    });
  })
  .catch(error => console.error('Generation failed:', error));
```

### Skills Mapping for Job Descriptions

```javascript
const service = new SharpApiRelatedSkillsService(process.env.SHARP_API_KEY);

async function expandJobSkills(primarySkills) {
  const allRelatedSkills = [];

  for (const skill of primarySkills) {
    const statusUrl = await service.generateRelatedSkills(skill, 'English', 8);
    const result = await service.fetchResults(statusUrl);
    const data = result.getResultJson();

    allRelatedSkills.push({
      primary: skill,
      related: data.result.related_skills
    });
  }

  return allRelatedSkills;
}

const jobSkills = ['React', 'Node.js', 'PostgreSQL'];
const expandedSkills = await expandJobSkills(jobSkills);

console.log('Expanded skill requirements:');
expandedSkills.forEach(skillSet => {
  console.log(`\n${skillSet.primary}:`);
  skillSet.related
    .filter(s => s.weight >= 7)
    .forEach(s => console.log(`  - ${s.name} (${s.weight}/10)`));
});
```

### Skill Assessment Tool

```javascript
const service = new SharpApiRelatedSkillsService(process.env.SHARP_API_KEY);

async function assessSkillGap(currentSkills, targetSkill) {
  const statusUrl = await service.generateRelatedSkills(targetSkill, 'English', 15);
  const result = await service.fetchResults(statusUrl);
  const data = result.getResultJson();

  const recommendedSkills = data.result.related_skills
    .filter(skill => !currentSkills.includes(skill.name))
    .filter(skill => skill.weight >= 7)
    .sort((a, b) => b.weight - a.weight);

  return {
    targetSkill,
    currentSkills,
    recommendedSkills,
    message: `To master ${targetSkill}, consider learning these ${recommendedSkills.length} related skills`
  };
}

const assessment = await assessSkillGap(
  ['HTML', 'CSS'],
  'Front-End Development'
);

console.log(assessment.message);
assessment.recommendedSkills.forEach((skill, index) => {
  console.log(`${index + 1}. ${skill.name} (priority: ${skill.weight}/10)`);
});
```

---

## Use Cases

- **Job Description Enhancement**: Automatically suggest related skills for job postings
- **Resume Optimization**: Help candidates identify relevant skills to add
- **Skill Gap Analysis**: Identify missing skills for career development
- **Training Recommendations**: Suggest complementary skills for learning paths
- **Recruitment Matching**: Improve candidate-job matching with skill relationships
- **Career Counseling**: Guide professionals on skill development paths
- **Course Recommendations**: Suggest related courses in learning platforms

---

## API Endpoint

**POST** `/hr/related_skills`

For detailed API specifications, refer to:
- [Postman Documentation](https://documenter.getpostman.com/view/31106842/2sBXVeGsVS)
- [Product Page](https://sharpapi.com/en/catalog/ai/hr-tech/related-skills-generator)

---

## Related Packages

- [@sharpapi/sharpapi-node-related-job-positions](https://www.npmjs.com/package/@sharpapi/sharpapi-node-related-job-positions) - Related job positions
- [@sharpapi/sharpapi-node-job-description](https://www.npmjs.com/package/@sharpapi/sharpapi-node-job-description) - Job descriptions
- [@sharpapi/sharpapi-node-parse-resume](https://www.npmjs.com/package/@sharpapi/sharpapi-node-parse-resume) - Resume parsing
- [@sharpapi/sharpapi-node-client](https://www.npmjs.com/package/@sharpapi/sharpapi-node-client) - Full SharpAPI SDK

---

## License

This project is licensed under the MIT License. See the [LICENSE.md](LICENSE.md) file for details.

---

## Support

- **Documentation**: [SharpAPI.com Documentation](https://sharpapi.com/documentation)
- **Issues**: [GitHub Issues](https://github.com/sharpapi/sharpapi-node-client/issues)
- **Email**: contact@sharpapi.com

---

**Powered by [SharpAPI](https://sharpapi.com/) - AI-Powered API Workflow Automation**