Blog
Guide5 min read

What Is a UEI? The Developer's Guide to Federal Contractor Identification

UEI replaced DUNS numbers in 2022 as the federal contractor identifier. Learn what it is, how to look up entities by UEI, and how to use it in your applications.

If you're building anything in the federal contracting space, you need to understand UEIs. The Unique Entity Identifier replaced DUNS numbers in April 2022 as the primary way to identify entities doing business with the federal government.

What Is a UEI?

A UEI (Unique Entity Identifier) is a 12-character alphanumeric code assigned to every entity registered in SAM.gov. It's generated by SAM.gov itself — no third-party provider (unlike the old DUNS system, which was owned by Dun & Bradstreet).

**Format:** 12 characters, letters and numbers. Example: `CDXDKNGE19Z8`

**Who has one:** Every company, organization, or individual registered to do business with the federal government. As of 2026, that's 845,000+ entities.

UEI vs DUNS: What Changed

DUNS NumberUEI
ProviderDun & Bradstreet (private)SAM.gov (government)
Format9 digits12 alphanumeric
CostSometimes paidFree
Required sinceBefore 2022April 4, 2022
Where to get oneD&B websiteSAM.gov registration

The transition was significant for developers: every database, API, and integration that used DUNS numbers needed to migrate to UEIs. Many legacy systems still reference DUNS — if you're seeing 9-digit identifiers in government data, that's the old format.

How to Look Up a Contractor by UEI

**Option 1: SAM.gov website**

Go to sam.gov, search by entity name, find the UEI in the profile. Manual, slow, no API.

**Option 2: SAM.gov bulk download**

Download the monthly XML extract, parse it, search locally. Works but requires infrastructure.

**Option 3: API lookup**

Use a commercial API that indexes SAM.gov data:

# Look up an entity by UEI
curl "https://api.govdatalabs.com/api/v2/data/entities/CDXDKNGE19Z8" \
  -H "X-API-Key: your_key"

Returns the full entity profile:

{
  "unique_entity_id": "CDXDKNGE19Z8",
  "legal_business_name": "0DAYCYBER LLC",
  "primary_naics": "541990",
  "state": "VA",
  "address": { "city": "PURCELLVILLE", "state": "VA", "zip": "20132" },
  "certifications": { "small_business": false, "8a": false },
  "award_summary": { "total_count": 5, "total_value": 123456.78 }
}

Using UEIs in Your Application

If you're building a GovCon product, UEI should be your primary key for contractor entities. Here's why:

1. **It's the government's canonical identifier** — every federal system uses it

2. **It's stable** — unlike company names, which change through mergers and rebranding

3. **It's linkable** — you can join SAM.gov data, USAspending awards, FPDS records, and SBIR awards on UEI

4. **It's unique** — one entity, one UEI (unlike NAICS codes, which are shared by thousands of companies)

When you store contractor data in your database, store the UEI as a indexed column. When you call our API, use UEI for entity detail, awards, contacts, capabilities, and teaming lookups — they all take UEI as the path parameter.

Finding UEIs Programmatically

Don't have the UEI? Search by name:

curl "https://api.govdatalabs.com/api/v2/data/entities/search?q=booz+allen&limit=5" \
  -H "X-API-Key: your_key"

Each result includes the `unique_entity_id` field. Use that for subsequent lookups.

Ready to try it?

Get a free Sandbox API key — 100 requests/month, no credit card.

Get Your API Key