← Back to Blog

Extract Resume Data with AI in Python

tutorialaiapiextractresumedata

How to Extract Resume Data with AI in Python

Manually reading through stacks of resumes is one of those tasks that sounds manageable until you’re actually doing it at scale. Whether you’re building an applicant tracking system, a recruiting tool, or just trying to automate your hiring pipeline, being able to extract resume data with AI in Python can save hours of repetitive work every week.

In this tutorial, we’ll walk through how to use the Today’s World AI API to parse resumes and CVs, pull out structured fields like name, skills, experience, and education, and handle the response in Python. No complex NLP setup required.


Why Use an AI API for Resume Parsing?

Traditional resume parsing relies on rigid template matching — it works until a candidate formats their CV differently, uses columns, or submits a PDF with embedded images. AI-based resume parsing handles these edge cases much more gracefully.

Here’s why developers and teams are moving toward API-based CV data extraction:

  • Format flexibility: Works with PDFs, DOCX files, plain text, and more
  • Structured output: Returns clean JSON you can insert directly into a database
  • Speed: Process hundreds of resumes in the time it would take to read one
  • Accuracy: AI models understand context, so “Python” under skills means something different than “Python” in a job title

If you’re building any kind of automated resume screening system, a reliable parsing API is the foundation you want to get right from the start.

Related reading: If you’re working with other document types, check out How to Extract Invoice Data from PDFs Using AI and Parse Receipts Automatically with AI API — both cover similar extraction patterns using the same API.


What Data Can You Extract from a Resume?

Before writing any code, it’s worth knowing what fields a good resume parsing API can typically return. Using the Today’s World AI API, you can extract:

Personal Information

  • Full name
  • Email address
  • Phone number
  • Location / address
  • LinkedIn URL or personal website

Professional Details

  • Current job title
  • Total years of experience
  • Work history (company, role, dates, description)
  • Skills (technical and soft)
  • Certifications and licenses

Education

  • Degree(s) earned
  • Institution names
  • Graduation years
  • Field of study

Additional Fields

  • Languages spoken
  • Summary or objective statement
  • Projects and publications

This structured output is exactly what you need for ATS data extraction in Python — you can map each field directly to your database schema or candidate profile model.


Setting Up Your Python Environment

Let’s get the basics in place. You’ll need Python 3.7+, the requests library, and an API key from Today’s World.

You can get started with a free account to grab your API key, and refer to the full API reference for complete field documentation.

Install the required library if you haven’t already:

pip install requests

Making Your First API Call with curl

Before jumping into Python, it’s useful to test the endpoint directly with curl. This helps confirm your API key is working and gives you a clear picture of the request/response format.

Here’s a basic resume parsing request:

curl -X POST https://api.todaysworld.com/v1/resume/parse \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "document_url": "https://example.com/resumes/john_doe_cv.pdf",
    "output_fields": ["name", "email", "phone", "skills", "experience", "education"],
    "language": "en"
  }'

You should get back a structured JSON response almost immediately. If you want to pass raw text instead of a URL, you can use the document_text field instead of document_url.


Extracting Resume Data in Python

Now let’s build a practical Python script that sends a resume to the API and handles the response cleanly.

Basic Resume Parser

import requests
import json

API_KEY = "YOUR_API_KEY"
API_URL = "https://api.todaysworld.com/v1/resume/parse"

def parse_resume(document_url: str) -> dict:
    headers = {
        "Content-Type": "application/json",
        "x-api-key": API_KEY
    }

    payload = {
        "document_url": document_url,
        "output_fields": [
            "name",
            "email",
            "phone",
            "location",
            "skills",
            "experience",
            "education",
            "summary"
        ],
        "language": "en"
    }

    response = requests.post(API_URL, headers=headers, json=payload)
    response.raise_for_status()

    return response.json()


if __name__ == "__main__":
    resume_url = "https://example.com/resumes/sample_cv.pdf"
    result = parse_resume(resume_url)
    print(json.dumps(result, indent=2))

Handling the Response

A typical response from the resume parsing API looks something like this:

{
  "status": "success",
  "data": {
    "name": "Jane Smith",
    "email": "jane.smith@email.com",
    "phone": "+1-555-0182",
    "location": "Austin, TX",
    "summary": "Full-stack developer with 6 years of experience...",
    "skills": ["Python", "React", "PostgreSQL", "Docker", "REST APIs"],
    "experience": [
      {
        "company": "Acme Corp",
        "title": "Senior Software Engineer",
        "start_date": "2020-03",
        "end_date": "present",
        "description": "Led backend development for SaaS platform..."
      }
    ],
    "education": [
      {
        "institution": "University of Texas",
        "degree": "B.S. Computer Science",
        "graduation_year": 2018
      }
    ]
  }
}

Parsing Multiple Resumes in Bulk

If you’re running automated resume screening across a large applicant pool, you’ll want to loop through a list of files:

import time

resume_urls = [
    "https://example.com/resumes/candidate_1.pdf",
    "https://example.com/resumes/candidate_2.pdf",
    "https://example.com/resumes/candidate_3.pdf",
]

parsed_candidates = []

for url in resume_urls:
    try:
        data = parse_resume(url)
        parsed_candidates.append(data.get("data", {}))
        print(f"Parsed: {data['data'].get('name', 'Unknown')}")
    except requests.HTTPError as e:
        print(f"Failed to parse {url}: {e}")
    
    time.sleep(0.5)  # Be kind to the API rate limits

print(f"\nSuccessfully parsed {len(parsed_candidates)} resumes.")

Practical Tips for Production Use

Once your basic integration is working, here are a few things worth keeping in mind as you scale up your resume parsing API usage.

Validate Required Fields

Not every resume will include every field. Always check for missing values before inserting into a database:

def safe_get(data: dict, field: str, fallback="N/A"):
    return data.get(field) or fallback

name = safe_get(candidate, "name")
email = safe_get(candidate, "email")

Store Raw Responses

Always save the raw API response alongside your parsed data. If you need to re-process or re-map fields later, having the original output is invaluable.

Handle Rate Limits Gracefully

Use exponential backoff if you’re processing large batches. A simple try/except around each request with a short sleep is usually enough for moderate volumes.


When to Use This Approach

CV data extraction via API makes the most sense when:

  • You’re receiving more than a few dozen applications at a time
  • You want to build a searchable candidate database
  • You need to integrate resume data into an existing ATS or HRIS
  • You’re building a recruiting or job board platform from scratch

For smaller teams just getting started, the free tier is more than enough to test the workflow end-to-end before committing to anything.


Summary

Extracting resume data with AI in Python doesn’t have to be complicated. With a well-designed resume parsing API, you can go from a raw PDF to a structured candidate profile in a single API call. The approach we covered here — a clean Python wrapper around the Today’s World API — is straightforward to extend, easy to test, and scales well as your hiring volume grows.

Check out the API documentation for a full list of supported fields, file formats, and language options.


Ready to automate your workflow? Try it free at todaysworld.com/try or get API access on RapidAPI.