How to Determine if a Job Post Requires Security Clearance

Identify security-clearance mentions in job titles and Markdown descriptions, then distinguish requirements from optional or negated references.

2 min read · Oct. 18, 2026 · Markdown version
Table of contents

When working with government, defense or cybersecurity job listings, you may want to identify roles that mention security clearance. This tutorial uses the jobdata API's title and description_md fields to build a shortlist for review.

Keyword matches are evidence of a mention, not proof that clearance is required. A description may say that clearance is optional, must be obtainable after hiring, or is not required at all.

Fetch Job Listings with Markdown Descriptions

Use an API key with an active access subscription. Request description_md=true to include Markdown, and description_off=true to omit the default HTML description when you do not need both formats.

Install the libraries used below:

pip install requests Markdown beautifulsoup4

Set JOBDATA_API_KEY in your environment, then fetch a page of recent listings:

import os
import requests

response = requests.get(
    'https://jobdataapi.com/api/jobs/',
    headers={'Authorization': f'Api-Key {os.environ["JOBDATA_API_KEY"]}'},
    params={
        'description_md': 'true',
        'description_off': 'true',
        'language': 'en',
        'max_age': 30,
        'page_size': 500,
    },
    timeout=60,
)
response.raise_for_status()
data = response.json()
job_listings = data['results']

This example searches one page of English-language listings from the last 30 days. Follow the response's next URL to process additional pages, without reapplying the first request's parameters. See our pagination guide for larger retrievals.

Prepare Text for Phrase Matching

Markdown is readable, but formatting can interrupt phrases such as **security** clearance. For keyword matching, render Markdown locally and extract its visible text. This also avoids matching keywords that appear only in a link destination.

import markdown
from bs4 import BeautifulSoup

def markdown_to_text(value):
    rendered = markdown.markdown(value or '', extensions=['extra'])
    soup = BeautifulSoup(rendered, 'html.parser')
    for element in soup(['script', 'style']):
        element.decompose()
    return ' '.join(soup.get_text(' ', strip=True).split())

This helper leaves meaningful punctuation intact rather than deleting every #, + or underscore. Keep the original Markdown as well if you need headings, lists or tables for display or contextual review.

Find Clearance Mentions

Use case-insensitive expressions with word boundaries instead of unrestricted substring matching:

import re

clearance_patterns = [
    r'\bsecurity\s+clearance\b',
    r'\b(?:top\s+secret|secret)\s+clearance\b',
    r'\bclearance\s*:\s*(?:top\s+secret|secret)\b',
    r'\bdod\s+secret\b',
    r'\bts\s*/\s*sci\b',
    r'\bsecurity\s+vetting\b',
]
clearance_pattern = re.compile('|'.join(clearance_patterns), re.IGNORECASE)

candidate_jobs = []
for job in job_listings:
    title = job.get('title') or ''
    description = markdown_to_text(job.get('description_md'))
    # Search separately so a phrase cannot span title and description.
    if clearance_pattern.search(title) or clearance_pattern.search(description):
        candidate_jobs.append(job)

for job in candidate_jobs:
    print(job['id'], job['title'], job.get('location') or '')

These patterns are an English-language starting point, primarily for US terminology. Expand them for your target countries, including local clearance names where relevant.

Distinguish Mentions from Requirements

Review the surrounding paragraph before assigning a requirement label:

  • Existing clearance required: “Must hold an active TS/SCI clearance.”
  • Eligibility required: “Must be able to obtain a security clearance.” This is not the same as already holding one.
  • Preferred or optional: “Secret clearance preferred.”
  • Explicitly not required: “No security clearance required.” This still matches the keyword search.

Public Trust suitability determinations, ordinary background checks and polygraph requirements are not interchangeable with security clearance levels. Track these separately if they matter to your application. A government employer or defense-related title alone is not sufficient evidence of a clearance requirement.

For a production classifier, retain the source wording, distinguish required, preferred, obtainable and not-required cases, and evaluate against manually reviewed examples. Markdown descriptions give you both searchable text and the surrounding structure needed for that review.

Ready to integrate?

Test with public requests, then subscribe to a flat monthly plan - no credits, no usage caps, no overage surprises.

Related Docs

Integrating the jobdata API with Zapier
Integrating the jobdata API with n8n
Practical Parquet Analytics: Hiring Signals and Labor-Market Intelligence
Integrating the jobdata API with Excel
Fetching and Maintaining Fresh Job Listings
Automated B2B Lead Generation Using Hiring Signals (Intent Data)
Converting Annual FTE Salary to Monthly, Weekly, Daily, and Hourly Rates
A Two-Step Approach to Precision Job Filtering
Optimizing API Requests: A Guide to Efficient jobdata API Usage
Retrieving and Working with Industry Data for Imported Jobs
Using the jobdata API for Machine Learning with Cleaned Job Descriptions
Introduction to Using Vector Search and Embeddings through the jobdata API
Merging Job Listings from Multiple Company Entries
Integrating the jobdata API with Make
Jobs API Ingestion Guide: Reliable Historical Backfills and Incremental Syncs

Explore jobdata API with AI tools

Ask an AI assistant how to search and build with live job data.