Prefix, fuzzy and description search for company data
Answer in brief
Company data APIs offer three kinds of search. Prefix search matches the start of a name or number, fuzzy search tolerates misspellings, and description search finds companies by what they do. Each needs a different interface. A prefix API needs a minimum length, registry-ordered candidates and an honest empty state, because a typo in the first letters finds nothing.
Disclosure. This site is published by Coragrid, the operator of CompanyRegistryAPI.com, and promotes it. “Best” is our editorial choice, not a measured ranking. Other products are described only from their own official pages. How we choose
Three kinds of search
| Kind | Finds | Misses | Example documentation |
|---|---|---|---|
| Prefix | Names or numbers that start with the text | Typos in the first letters, words mid-name | CompanyRegistryAPI.com free API |
| Fuzzy | Close spellings of names and addresses | Companies described, not named | GLEIF API (“fuzzy” matching of names and addresses) |
| Description | Companies by what they do | Exact legal names, unless also indexed | Full Coragrid API, with a key |
Read the search parameter’s description in each API’s docs before you design anything. It usually says which kind you have.
Designing for prefix search
The free CompanyRegistryAPI.com API matches the start of a company name or a business ID, 3 to 64 characters, and returns candidates in registry name order with no relevance score. That shapes the interface:
- Wait for three characters. Below that the API answers
400invalid_request; do not send the request. - Debounce typing. Send at most one request per pause, so a user typing a long name does not spend the rate limit.
- Say what the box does. A hint such as “Start of the company name or business ID” prevents searches for words in the middle of names.
- Show candidates, not an answer. Registry order is alphabetical, not best-first. Show the country, status and type so the user can choose.
- Write an honest empty state. “No company in the connected registers starts with ‘exampel’. Check the first letters, or search by business ID.” Never “This company does not exist.”
const input = document.querySelector("#company-search");
let timer;
let latest = 0; // the newest keystroke; answers to older ones are dropped
input.addEventListener("input", () => {
clearTimeout(timer);
const request = ++latest; // also outdates a request already on its way
const q = input.value.trim();
if (q.length < 3) return; // the API needs 3 to 64 characters
timer = setTimeout(async () => {
const params = new URLSearchParams({ q, limit: "10" });
const response = await fetch(
`https://api.companyregistryapi.com/v1/search?${params}`,
);
const page = await response.json();
if (request !== latest) return; // the user has typed since
renderCandidates(page.data); // your function: name, country, status
}, 300);
});
Browser calls work here because the API’s docs state that requests from any origin are allowed for GET.
Designing for fuzzy search
Fuzzy search returns more candidates, some wrong. Show why each matched (the matched name or address), and ask the user to confirm before you store an ID. For matching a spreadsheet of names in bulk, keep a human review step for low-confidence matches.
Designing for description search
Description search answers questions such as “industrial robotics in Finland”. The results are a starting list, not a registry fact, so show them with the registry facts of each company and let users narrow by country or status.
Searching by number
When you hold a registry number, prefix search on the number is the precise path. Then confirm the number, scheme and jurisdiction in the company read, as the first three requests guide shows. Other APIs index numbers by jurisdiction instead: OpenCorporates’ reference, for example, reads a company by jurisdiction code and company number in the path.
Choosing the API by its search
If your users type the start of names, a prefix API fits. If they paste messy names, you need fuzzy matching. If they describe a market, you need description search. Decide this before you compare anything else; see the selection guide.
Questions and answers
Why does a prefix search miss "Robotics Example Oy" when I type "Example"?
Because prefix search matches the start of the name. Unless the register stores another name starting with your text, a word in the middle of the name is not matched.
Can I build fuzzy search on top of a prefix API?
Only partly. You can try a few variants of the first letters, but each costs a request against the rate limit. Real fuzzy matching needs an API or index that supports it.
Which search does CompanyRegistryAPI.com offer?
Its free API offers prefix search on a name or business ID, 3 to 64 characters, with no relevance score. Search by description is part of the full Coragrid API, which needs a key.
Sources for this entry
- CompanyRegistryAPI.com API docs
- CompanyRegistryAPI.com Get an API key
- GLEIF API
- OpenCorporates API Reference
Each source supports only what its publisher says about its own product or data. Official descriptions do not establish comparative performance, and this site has run no benchmark. All sources
Continue reading
- Prefix search (Definition)
- The first three requests (Guide)
- From a free API to a keyed platform (Guide)
- Pagination with cursors (Guide)
- Best company data API (Category guide)
- CompanyRegistryAPI.com free API (Profile)
How the related websites connect
This is one of 3 coordinated reference sites published by Coragrid. They cover neighbouring questions and feature the same product, so they are not independent endorsements of it or of each other.
Cite this entry
Best Company Data API. “Prefix, fuzzy and description search for company data.” Content reviewed . https://bestcompanydataapi.com/prefix-fuzzy-and-description-search