npm package: @sharpapi/sharpapi-node-parse-resume
Description: SharpAPI.com Node.js SDK for parsing resumes
Author: Dawid Makowski
Latest version: 1.0.1

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

# Resume/CV Parser API for Node.js

## 📄 Parse resumes and extract structured data with AI — powered by SharpAPI.

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

**SharpAPI Resume Parser** extracts structured information from resume/CV documents in various formats (PDF, DOC, DOCX, TXT). Perfect for ATS systems, recruitment platforms, and HR automation tools.

---

## 📋 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-parse-resume
```

### Step 2. Get your API key

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

---

## Usage

```javascript
const { SharpApiParseResumeService } = require('@sharpapi/sharpapi-node-parse-resume');
const fs = require('fs');

const apiKey = process.env.SHARP_API_KEY;
const service = new SharpApiParseResumeService(apiKey);

async function parseResume() {
  try {
    // Read resume file
    const resumeFile = fs.readFileSync('/path/to/resume.pdf');

    // Submit parsing job
    const statusUrl = await service.parseResume(resumeFile, 'resume.pdf', 'English');
    console.log('Job submitted. Status URL:', statusUrl);

    // Fetch results (polls automatically until complete)
    const result = await service.fetchResults(statusUrl);
    const parsedData = result.getResultJson();

    console.log('Candidate:', parsedData.result.name);
    console.log('Email:', parsedData.result.email);
    console.log('Skills:', parsedData.result.skills.join(', '));
  } catch (error) {
    console.error('Error:', error.message);
  }
}

parseResume();
```

---

## API Documentation

### Methods

#### `parseResume(fileBuffer: Buffer, fileName: string, language?: string): Promise<string>`

Parses a resume/CV file and extracts structured information.

**Parameters:**
- `fileBuffer` (Buffer, required): The resume file content as a Buffer
- `fileName` (string, required): Original filename with extension (e.g., 'resume.pdf')
- `language` (string, optional): Expected resume language (default: 'English')

**Supported File Formats:**
- PDF (.pdf)
- Microsoft Word (.doc, .docx)
- Plain Text (.txt)
- Rich Text Format (.rtf)

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

---

## Response Format

The API returns comprehensive structured data extracted from the resume:

```json
{
  "data": {
    "type": "api_job_result",
    "id": "5de4887a-0dfd-49b6-8edb-9280e468c210",
    "attributes": {
      "status": "success",
      "type": "hr_parse_resume",
      "result": {
        "name": "John Doe",
        "email": "john.doe@email.com",
        "phone": "+1-555-123-4567",
        "location": {
          "city": "San Francisco",
          "state": "California",
          "country": "United States"
        },
        "summary": "Experienced software engineer with 8+ years in full-stack development, specializing in cloud-native applications and microservices architecture.",
        "work_experience": [
          {
            "job_title": "Senior Software Engineer",
            "company": "Tech Corp",
            "location": "San Francisco, CA",
            "start_date": "2020-03",
            "end_date": "Present",
            "description": "Led development of microservices architecture, improved system performance by 40%, mentored junior developers."
          },
          {
            "job_title": "Software Engineer",
            "company": "StartupXYZ",
            "location": "San Francisco, CA",
            "start_date": "2017-06",
            "end_date": "2020-02",
            "description": "Developed RESTful APIs and implemented CI/CD pipelines."
          }
        ],
        "education": [
          {
            "degree": "Bachelor of Science in Computer Science",
            "institution": "University of California",
            "location": "Berkeley, CA",
            "graduation_date": "2017-05"
          }
        ],
        "skills": [
          "JavaScript",
          "Node.js",
          "React",
          "AWS",
          "Docker",
          "Kubernetes",
          "PostgreSQL",
          "MongoDB",
          "CI/CD",
          "Agile"
        ],
        "certifications": [
          {
            "name": "AWS Certified Solutions Architect",
            "issuer": "Amazon Web Services",
            "date": "2021-08"
          }
        ],
        "languages": [
          {
            "language": "English",
            "proficiency": "Native"
          },
          {
            "language": "Spanish",
            "proficiency": "Intermediate"
          }
        ]
      }
    }
  }
}
```

---

## Examples

### Parse Single Resume

```javascript
const { SharpApiParseResumeService } = require('@sharpapi/sharpapi-node-parse-resume');
const fs = require('fs');

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

async function parseAndDisplay(resumePath) {
  const fileBuffer = fs.readFileSync(resumePath);
  const fileName = resumePath.split('/').pop();

  const statusUrl = await service.parseResume(fileBuffer, fileName);
  const result = await service.fetchResults(statusUrl);
  const data = result.getResultJson().result;

  console.log('📋 Resume Summary:');
  console.log(`Name: ${data.name}`);
  console.log(`Email: ${data.email}`);
  console.log(`Phone: ${data.phone}`);
  console.log(`Location: ${data.location.city}, ${data.location.country}`);
  console.log(`\nExperience: ${data.work_experience.length} positions`);
  console.log(`Education: ${data.education.length} degrees`);
  console.log(`Skills: ${data.skills.join(', ')}`);
}

parseAndDisplay('./resumes/john_doe_resume.pdf');
```

### Batch Resume Processing

```javascript
const service = new SharpApiParseResumeService(process.env.SHARP_API_KEY);
const fs = require('fs');
const path = require('path');

async function processBatchResumes(resumeDirectory) {
  const files = fs.readdirSync(resumeDirectory);
  const candidates = [];

  for (const file of files) {
    if (file.match(/\.(pdf|docx|doc)$/i)) {
      const filePath = path.join(resumeDirectory, file);
      const fileBuffer = fs.readFileSync(filePath);

      try {
        const statusUrl = await service.parseResume(fileBuffer, file);
        const result = await service.fetchResults(statusUrl);
        const data = result.getResultJson().result;

        candidates.push({
          fileName: file,
          name: data.name,
          email: data.email,
          skills: data.skills,
          experience: data.work_experience.length,
          parsedSuccessfully: true
        });
      } catch (error) {
        candidates.push({
          fileName: file,
          parsedSuccessfully: false,
          error: error.message
        });
      }
    }
  }

  return candidates;
}

const allCandidates = await processBatchResumes('./incoming_resumes');
console.log(`Processed ${allCandidates.length} resumes`);
console.log(`Successful: ${allCandidates.filter(c => c.parsedSuccessfully).length}`);
```

### ATS Integration

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

async function addCandidateToATS(resumeBuffer, fileName, jobId) {
  // Parse resume
  const statusUrl = await service.parseResume(resumeBuffer, fileName);
  const result = await service.fetchResults(statusUrl);
  const parsedData = result.getResultJson().result;

  // Structure for ATS
  const candidateProfile = {
    jobApplicationId: jobId,
    personalInfo: {
      fullName: parsedData.name,
      email: parsedData.email,
      phone: parsedData.phone,
      location: `${parsedData.location.city}, ${parsedData.location.country}`
    },
    professionalSummary: parsedData.summary,
    totalExperience: calculateTotalExperience(parsedData.work_experience),
    skills: parsedData.skills,
    education: parsedData.education,
    workHistory: parsedData.work_experience,
    certifications: parsedData.certifications || [],
    languages: parsedData.languages || [],
    resumeSource: 'automated_parsing',
    parsedAt: new Date().toISOString()
  };

  return candidateProfile;
}

function calculateTotalExperience(workHistory) {
  // Calculate years of experience
  let totalMonths = 0;
  workHistory.forEach(job => {
    const start = new Date(job.start_date);
    const end = job.end_date === 'Present' ? new Date() : new Date(job.end_date);
    totalMonths += (end.getFullYear() - start.getFullYear()) * 12 +
                   (end.getMonth() - start.getMonth());
  });
  return `${Math.floor(totalMonths / 12)} years, ${totalMonths % 12} months`;
}

const candidateProfile = await addCandidateToATS(resumeBuffer, 'resume.pdf', 'JOB-12345');
console.log('Candidate added to ATS:', candidateProfile.personalInfo.fullName);
```

---

## Use Cases

- **Applicant Tracking Systems**: Automatically parse incoming resumes
- **Recruitment Platforms**: Extract candidate information for matching
- **HR Automation**: Streamline resume screening processes
- **Talent Databases**: Build searchable candidate databases
- **Job Boards**: Enable resume upload and parsing features
- **Recruitment Agencies**: Process high volumes of resumes efficiently
- **Career Portals**: Parse user-uploaded resumes for profile creation

---

## Extraction Capabilities

The parser extracts:

- **Personal Information**: Name, email, phone, location
- **Professional Summary**: Career objective or summary statement
- **Work Experience**: Job titles, companies, dates, descriptions
- **Education**: Degrees, institutions, graduation dates
- **Skills**: Technical and soft skills
- **Certifications**: Professional certifications and credentials
- **Languages**: Spoken languages and proficiency levels
- **Projects**: Notable projects (when available)
- **Publications**: Academic or professional publications

---

## API Endpoint

**POST** `/hr/parse_resume` (multipart/form-data)

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

---

## Related Packages

- [@sharpapi/sharpapi-node-resume-job-match-score](https://www.npmjs.com/package/@sharpapi/sharpapi-node-resume-job-match-score) - Resume-job matching
- [@sharpapi/sharpapi-node-job-description](https://www.npmjs.com/package/@sharpapi/sharpapi-node-job-description) - Job descriptions
- [@sharpapi/sharpapi-node-related-skills](https://www.npmjs.com/package/@sharpapi/sharpapi-node-related-skills) - Skills analysis
- [@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**