How to Parse Resumes to JSON in Python and TypeScript
Arthur Sterling
Lead Developer Advocate, Parse
How to Parse Resumes to JSON in Python and TypeScript
Building an Applicant Tracking System (ATS) or HR platform? One of the biggest friction points in recruitment is data entry. Candidates upload messy, inconsistently formatted PDFs, and recruiters spend hours manually typing names, skills, and work histories into a database.
Automating this process saves thousands in administrative costs and dramatically speeds up the time-to-hire. In this tutorial, we will build a script that takes a PDF or DOCX resume and converts it into a clean, structured JSON object using the Parse API.
What We Are Building
We are going to send a document to the API and receive a normalized JSON object containing over 20 data fields, including:
- •Personal Details: Name, email, phone, LinkedIn, and location.
- •Work Experience: Job titles, companies, dates, and full descriptions.
- •Skills & Tech Stack: Extracted and normalized lists of technical and soft skills.
- •Education: Degrees, institutions, and graduation dates.
Step 1: Get Your API Key
To get started, you need a Parse API key.
- •Sign up at cparse.com/dashboard. New accounts include free credit — no credit card required.
- •Once signed in, copy your API key from the dashboard.
Pass it on every request using the X-API-Key header.
Step 2: Implementation in Python
Using the requests library, we can handle the multipart file upload in just a few lines.
import requests
import json
def parse_resume(file_path: str, api_key: str) -> dict:
url = "https://api.cparse.com/resume/v1/parse"
with open(file_path, "rb") as file:
response = requests.post(
url,
files={"file": file},
headers={"X-API-Key": api_key},
)
response.raise_for_status()
results = response.json()
return results[0] # API returns an array; take the first result
# Execute
api_key = "YOUR_API_KEY_HERE"
result = parse_resume("resume.pdf", api_key)
print(json.dumps(result["data"], indent=2))
Step 3: Implementation in TypeScript (Node.js)
For Next.js or Node environments, axios and form-data are the standard choice.
import axios from 'axios';
import FormData from 'form-data';
import fs from 'fs';
async function parseResume(filePath: string, apiKey: string): Promise<object> {
const url = 'https://api.cparse.com/resume/v1/parse';
const form = new FormData();
form.append('file', fs.createReadStream(filePath));
const response = await axios.post(url, form, {
headers: {
...form.getHeaders(),
'X-API-Key': apiKey,
},
});
// API returns an array; take the first result
return response.data[0];
}
// Execute
parseResume('resume.pdf', 'YOUR_API_KEY_HERE').then((result) => {
console.log(JSON.stringify(result, null, 2));
});
Step 4: Understanding the JSON Output
When the script finishes (typically within seconds), the API returns a normalized object. The true power of the Parse engine is that it doesn't just perform OCR. It understands the semantic context of the document.
[
{
"success": true,
"file_name": "resume.pdf",
"data": {
"name": "Jane Smith",
"headline": "Senior Software Engineer",
"email": "jane.smith@example.com",
"phone": "+447700900123",
"skills": ["python", "javascript", "react", "aws"],
"experience": [
{
"title": "Senior Software Engineer",
"company": "Tech Corp",
"employment_type": "Full-time",
"start_date": "2021-03",
"end_date": "Present",
"tech_stack": ["react", "node.js", "aws"],
"description": "- Led development of microservices architecture.\n- Implemented CI/CD pipelines reducing deploy time by 40%."
}
],
"education": [
{
"degree": "BSc Computer Science",
"institution": "University of Edinburgh",
"date": "2019"
}
]
},
"ocr_used": false,
"pages_processed": 2
}
]
Why this structure matters
- •Tech Stack Detection: The API separates overall
skillsfrom the specifictech_stackused at each job, allowing your ATS to weight candidates by the recency of their experience. - •Smart Date Normalisation: All dates are normalised to
YYYY-MMorYYYY, making database sorting trivial. - •Bullet Point Preservation: The
descriptionfield retains the original structure via newline characters, keeping your UI clean.
Security & Privacy First
When dealing with PII like resumes, security is non-negotiable. The Parse API processes all documents entirely in-memory. Once the JSON is generated and returned to your script, the original file is permanently deleted. No candidate data is ever stored on our servers, keeping your application fully compliant with GDPR and CCPA.
Next Steps
AI-powered resume parsing is the fastest way to upgrade your HR platform. Instead of forcing candidates to manually re-enter their work history, let them upload a PDF and auto-fill your forms in seconds.
Ready to scale? Check out the PRO and ULTRA plans in the Parse dashboard to process high-volume document workloads. Full API reference is available in the Resume Parser docs.
Arthur Sterling is the Lead Developer Advocate at Parse.