Skip to main content
This endpoint takes raw resume text and uses OpenAI (via OpenRouter) to extract structured JSON data according to a predefined schema. It’s typically used after parsing a PDF with the /api/parse-resume endpoint.

Endpoint

POST /api/extract-info

Request

text
string
required
Raw resume text to parse. This is typically the text field returned from the /api/parse-resume endpoint.

Response

The response is a structured resume object with the following fields:
personalInfo
object
Personal information and contact details
personalInfo.name
string
Full name
personalInfo.title
string
Job title or professional headline
personalInfo.location
string
City and state/country
personalInfo.phone
string
Phone number
personalInfo.email
string
Email address
personalInfo.website
string
Personal website URL
personalInfo.linkedin
string
LinkedIn profile URL
personalInfo.github
string
GitHub profile URL
summary
string
Professional summary or objective statement
skills
object
Categorized list of skills
skills.languages
array of strings
Programming languages
skills.frameworksAndTools
array of strings
Frameworks, libraries, and development tools
skills.libraries
array of strings
Specific libraries and packages
skills.softSkills
array of strings
Soft skills and interpersonal abilities
experience
array of objects
Work experience entries
experience[].company
string
Company name
experience[].position
string
Job title
experience[].location
string
Job location
experience[].startDate
string
Start date
experience[].endDate
string
End date or “Present”
experience[].isCurrentRole
boolean
Whether this is the current position
experience[].description
array of strings
Bullet points describing responsibilities and achievements
experience[].technologies
array of strings
Technologies used in this role
projects
array of objects
Project entries
projects[].name
string
Project name
projects[].role
string
Role in the project
projects[].startDate
string
Start date
projects[].endDate
string
End date
Project URL or repository link
projects[].description
array of strings
Bullet points describing the project
projects[].technologies
array of strings
Technologies used in the project
education
array of objects
Education entries
education[].university
string
Institution name
education[].degree
string
Degree type (e.g., “Bachelor of Science”)
education[].branch
string
Major or field of study
education[].location
string
Institution location
education[].sgpa
string
GPA or grade
education[].startDate
string
Start date
education[].endDate
string
End date or expected graduation
extracurricular
array of strings
Extracurricular activities, awards, and achievements
customSections
array of objects
Additional custom sections (e.g., certifications, languages)
customSections[].title
string
Section title
customSections[].items
array of strings
Items in this section

Example

curl -X POST https://wrkks.vercel.app/api/extract-info \
  -H "Content-Type: application/json" \
  -d '{
    "text": "John Doe\nSoftware Engineer\[email protected]\n..."
  }'

Response

{
  "personalInfo": {
    "name": "John Doe",
    "title": "Software Engineer",
    "location": "San Francisco, CA",
    "phone": "+1 (555) 123-4567",
    "email": "[email protected]",
    "website": "https://johndoe.com",
    "linkedin": "https://linkedin.com/in/johndoe",
    "github": "https://github.com/johndoe"
  },
  "summary": "Experienced software engineer with 5+ years building scalable web applications",
  "skills": {
    "languages": ["JavaScript", "TypeScript", "Python"],
    "frameworksAndTools": ["React", "Next.js", "Node.js"],
    "libraries": ["TailwindCSS", "Prisma"],
    "softSkills": ["Leadership", "Communication"]
  },
  "experience": [
    {
      "company": "Tech Corp",
      "position": "Senior Software Engineer",
      "location": "San Francisco, CA",
      "startDate": "Jan 2020",
      "endDate": "Present",
      "isCurrentRole": true,
      "description": [
        "Led development of customer-facing dashboard",
        "Improved page load times by 40%"
      ],
      "technologies": ["React", "TypeScript", "AWS"]
    }
  ],
  "projects": [],
  "education": [
    {
      "university": "State University",
      "degree": "Bachelor of Science",
      "branch": "Computer Science",
      "location": "Berkeley, CA",
      "sgpa": "3.8",
      "startDate": "2015",
      "endDate": "2019"
    }
  ],
  "extracurricular": [],
  "customSections": []
}

Error responses

500 Internal Server Error

Returned when AI extraction fails or returns invalid data:
{
  "msg": "Failed to parse resume details"
}
Or with API error details:
{
  "msg": "Failed to parse PDF",
  "details": "Rate limit exceeded"
}

Implementation

The endpoint uses OpenAI’s chat completion API via OpenRouter with:
  • Model configured via OPENROUTER_MODEL_NAME environment variable
  • Temperature set to 0 for consistent extraction
  • JSON response format enforced
  • System prompt instructing the model to output only valid JSON
Source: /app/api/extract-info/route.ts:84-98

Build docs developers (and LLMs) love