A powerful AI-driven FastAPI application that extracts structured information from PDF and Word resume documents. This application can be deployed on Vercel as a serverless function.
- Multi-format Support: Parse PDF, DOC, and DOCX resume files
- AI-Powered Extraction: Extract key information using advanced NLP techniques
- Structured Data Output: Returns clean, structured JSON data
- Batch Processing: Process multiple resumes simultaneously
- RESTful API: Clean, documented REST API endpoints
- Serverless Ready: Optimized for Vercel serverless deployment
- CORS Enabled: Ready for frontend integration
The API extracts the following information from resumes:
- Personal Information: Name, contact details
- Contact Information: Email addresses, phone numbers, LinkedIn profiles, location
- Skills: Technical skills with categorization and relevance scoring
- Education: Degrees, institutions, graduation years
- Work Experience: Job titles, companies, years of experience
- Professional Summary: Extracted objective/summary sections
resume-parser-api/
βββ main.py # FastAPI application entry point
βββ resume_parser.py # Core resume parsing logic
βββ requirements.txt # Python dependencies
βββ vercel.json # Vercel deployment configuration
βββ README.md # This file
-
Clone the repository
git clone <your-repo-url> cd resume-parser-api
-
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Download spaCy model (optional but recommended)
python -m spacy download en_core_web_sm
-
Run the application
uvicorn main:app --reload
The API will be available at http://localhost:8000
- GitHub account
- Vercel account (free tier available)
- Git installed locally
-
Push code to GitHub
git init git add . git commit -m "Initial commit: Resume Parser API" git branch -M main git remote add origin <your-github-repo-url> git push -u origin main
-
Deploy to Vercel
Option A: Using Vercel Dashboard
- Go to vercel.com
- Click "New Project"
- Import your GitHub repository
- Vercel will automatically detect the Python project
- Click "Deploy"
Option B: Using Vercel CLI
npm install -g vercel vercel login vercel
-
Environment Variables (if needed)
- In Vercel dashboard, go to Project Settings > Environment Variables
- Add any required environment variables
- File Size Limit: Vercel has a 250MB unzipped size limit for serverless functions
- Execution Time: Maximum 30 seconds per request on free tier
- Memory Limit: 1024MB on free tier
- Cold Starts: First requests might be slower due to cold starts
GET /
GET /healthResponse:
{
"message": "Resume Parser API is running",
"version": "1.0.0",
"status": "healthy",
"supported_formats": ["PDF", "DOC", "DOCX"]
}POST /parse-resume
Content-Type: multipart/form-dataRequest: Upload a resume file (PDF, DOC, or DOCX)
Response:
{
"status": "success",
"message": "Resume parsed successfully",
"filename": "john_doe_resume.pdf",
"file_size": 245760,
"data": {
"personal_info": {
"name": "John Doe"
},
"contact_info": {
"emails": ["john.doe@email.com"],
"phones": ["+1-555-123-4567"],
"linkedin": "john-doe-dev",
"location": ["San Francisco, CA"]
},
"skills": {
"technical_skills": [
{
"skill": "Python",
"mentions": 5,
"category": "programming_language"
}
]
},
"education": {
"degrees": [
{
"degree": "Bachelor",
"field": "Computer Science",
"type": "degree"
}
]
},
"experience": {
"total_years_experience": 3,
"experience_level": "junior"
}
}
}POST /parse-resume-batch
Content-Type: multipart/form-dataRequest: Upload up to 10 resume files
Response:
{
"status": "success",
"message": "Processed 3 files",
"results": [
{
"filename": "resume1.pdf",
"status": "success",
"data": { ... }
}
]
}# Health check
curl https://your-vercel-url.vercel.app/
# Parse resume
curl -X POST https://your-vercel-url.vercel.app/parse-resume \
-F "file=@path/to/your/resume.pdf"import requests
# Parse resume
with open('resume.pdf', 'rb') as f:
response = requests.post(
'https://your-vercel-url.vercel.app/parse-resume',
files={'file': f}
)
print(response.json())const formData = new FormData();
formData.append('file', fileInput.files[0]);
fetch('https://your-vercel-url.vercel.app/parse-resume', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => console.log(data));- Maximum file size: 10MB per file
- Maximum files in batch: 10 files
- PDF (
application/pdf) - Word Document (
application/vnd.openxmlformats-officedocument.wordprocessingml.document) - Legacy Word Document (
application/msword)
- Lazy Loading: NLP models are loaded only when needed
- Text Caching: Extracted text is cached during processing
- Async Processing: All operations are asynchronous
- Memory Management: Large files are processed in streams
-
"Module not found" errors
- Ensure all dependencies in
requirements.txtare correctly specified - Check Python version compatibility
- Ensure all dependencies in
-
File upload fails
- Verify file size is under 10MB
- Check file format is supported
- Ensure proper Content-Type headers
-
Vercel deployment fails
- Check that
vercel.jsonconfiguration is correct - Verify file structure matches expected layout
- Review Vercel build logs for specific errors
- Check that
-
spaCy model not found
- The app will work without spaCy but with reduced accuracy
- For production, consider pre-downloading the model
400: Bad Request (unsupported file type, file too large)413: Payload Too Large (file exceeds 10MB)500: Internal Server Error (processing error)
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
- Built with FastAPI
- PDF processing powered by pdfplumber
- Word document processing with python-docx
- NLP capabilities via spaCy
- Deployed on Vercel
Made with β€οΈ for the developer community