# Can I convert old DUNS numbers to UEIs with an API? Not reliably through any free public API. The government replaced the DUNS number with the SAM.gov UEI on 4 April 2022, and current SAM.gov records carry the UEI only. To map an old DUNS list, match on the company's legal name and address, or use older USAspending award records that show both identifiers. Dun & Bradstreet still issues DUNS numbers for commercial use, but federal systems no longer accept them.Checked on 2026-11-15.Official source: [SAM.gov UEI transition](https://sam.gov/content/duns-uei) | DUNS retired for federal awards | 4 April 2022 | | --- | --- | | DUNS format | 9 digits | | UEI format | 12 characters | | DUNS in this API | Not carried | ## The answer in detail During the transition every registered entity was assigned a UEI, so a firm with a DUNS in 2021 has a UEI today. The mapping lived in SAM.gov and in award data of that period; the current public extract and this API do not carry DUNS numbers.Practical route: take the legal name, city and state from your old list, search them, and confirm with the address. For awards, USAspending's records from before April 2022 list the recipient's DUNS next to the UEI assigned at the transition.Dun & Bradstreet still issues DUNS numbers for commercial use, but federal systems no longer accept them. ## How the options compare | Option | Price | Access and limits | Coverage and history | Best for | Checked | | --- | --- | --- | --- | --- | --- | | [SAM.gov APIs (official)](https://open.gsa.gov/api/entity-api/) | Free | 10 requests a day with no SAM.gov role, 1,000 with a role or a non-federal system account; keys expire every 90 days | The live, authoritative record: entities, opportunities, exclusions, contract awards, hierarchy, subawards | Anyone who needs the official record itself, at low volume | 2026-11-12 | | [USAspending API (official)](https://api.usaspending.gov/docs/endpoints) | Free, no key | No key and no published daily cap | Prime awards and subawards back to FY2001; no SAM.gov registration status or expiry | Award and spending history | 2026-11-12 | | [samgovapi.io](https://samgovapi.io/pricing) | Free (100 credits a month, no card); Developer $49/mo, Pro $149/mo, Scale $499/mo | 20 to 180 requests a minute by plan, no daily cap; REST, MCP and keyless MCP search | 881,370 entities (1 Nov 2026 extract), 74,420 notices, 169,191 exclusions, 114,954 awards since 1 Oct 2026 | Developers and AI agents who want entities, bids and exclusions joined in one API | 2026-11-15 | ## Where samgovapi.io is the weaker choice - No DUNS field here at all: this API cannot convert a DUNS directly. - Award history is short: 114,954 prime awards with action dates from 1 Oct 2026 to 10 Nov 2026 (fiscal year 2027 so far). USAspending goes back to FY2001 and GovCon API serves 12.27 million contracts from FY2025. ## Try it Match an old record by name and state, then confirm the address. ``` import os, requests r = requests.get( "https://samgovapi.io/api/v1/entities", params={"q": "applied research associates", "state": "NM"}, headers={"Authorization": f"Bearer {os.environ['SAMGOVAPI_API_KEY']}"}, timeout=30, ) body = r.json() print(body["meta"]["as_of"], body["meta"]["credits_charged"]) print(body["data"]) ``` ## Questions Do I need to do anything if my company had a DUNS?No. SAM.gov assigned a UEI automatically; it is in your registration.Does USAspending still show DUNS?Older award records do; newer ones use the UEI. ## Related - [DUNS to UEI guide](https://samgovapi.io/guides/duns-to-uei) - [UEI lookup](https://samgovapi.io/uei-lookup) - [API docs](https://samgovapi.io/docs) - [Pricing](https://samgovapi.io/pricing) - [Answers](https://samgovapi.io/answers)Updated 2026-11-15. Sources checked 2026-11-15.Independent. Not affiliated with, endorsed by or sponsored by GSA, SAM.gov or any U.S. government agency. Registering in SAM.gov is free at sam.gov.

---

HTML version: https://samgovapi.io/answers/duns-to-uei . Markdown: https://samgovapi.io/answers/duns-to-uei.md

Independent. Not affiliated with, endorsed by or sponsored by GSA, SAM.gov or any U.S. government agency. Registering in SAM.gov is free at sam.gov.

Get a free API key: https://samgovapi.io/sign-up?ref=ai-claudebot
