SFOLN

Demos / LEI Lookup – GLEIF Legal Entity Search

Fill a counterparty onboarding record from an LEI

A trade finance firm onboards a few dozen corporate counterparties a month. For each one an analyst looks up the LEI by hand, copies the legal name, addresses and register number into the onboarding system and clicks through to the parent companies. Lapsed LEIs and mistyped codes are noticed late, if at all. Here the analyst enters the code or the name and the record fills itself: identity, status, addresses and the ownership chain arrive together, and anything that should stop the file is flagged in the queue.

Workflow

Where the API sits

  1. Trigger

    Counterparty submitted

    Sales enters an LEI, or only a company name and country, in the onboarding system.

  2. API call

    Look up the LEI record

    One call with leis and companyNames. Codes with wrong check digits and names without a close match cost nothing.

    sfoln/lei-lookup

  3. Your logic

    Fill and check

    Map the fields to the record, add the parents to the group structure, hold the file if registrationStatus is not ISSUED.

  4. Result

    Record and queue

    A complete onboarding record with an ownership tree, and a queue that shows what is ready, held or needs a person.

Wired as a webhook from the onboarding system: each new counterparty is posted to a small function that calls the API synchronously with includeParents on and writes the record back. A monthly schedule sends every stored LEI through the same call to catch LEIs that have lapsed since onboarding.

Result

The onboarding record fills itself

After the lookup

OnboardingCounterparty CP-0862 · newfilled in 2 s
LEI5299007KQ3MERD4SH141Check digits valid
Legal nameMeridale Shipping GmbH
Legal formGesellschaft mit beschränkter Haftung
JurisdictionDE
Entity statusACTIVE
LEI statusISSUED
Next renewal2027-04-22
RegisterHandelsregister
Company numberHRB 148213
Legal addressKehrwiederstieg 12, 20457 Hamburg, DE
HeadquartersKehrwiederstieg 12, 20457 Hamburg, DE
Former nameMeridale Reederei GmbHAlso sent to sanctions screening

Ownershipaccounting consolidation

  • Castellan Maritime Group S.A. ultimate parent · 222100X2CSTLN8MG0H84 · LU · ISSUED
    • Meridale Holding B.V. direct parent · 724500MRDLH5HLD9NV17 · NL · ISSUED
      • Meridale Shipping GmbH applicant · DE · ISSUED

Checks

LEI issued and renewed
Pass
Entity active
Pass
Parents identified
Pass2 added to group exposure
Record corroborated
FULLY_CORROBORATED

Source: GLEIF data published 2026-11-12T08:00:00Z. The analyst types one code; every other field on this screen comes from the record.

Send for approvalOpen GLEIF record

Lapsed LEI

OnboardingCounterparty CP-0864 · newon hold

LEI status

LAPSED

Not renewed on time

Renewal was due

2026-06-18

Overdue

Record last updated

2025-06-20

Data may be out of date

LEI815600TSSR0LGS3C2A23Lapsed: the entity has not renewed its LEI
Legal nameTessaro Logistica S.r.l.
JurisdictionIT
Entity statusACTIVE
RegisterRegistro Imprese
Company numberGE-502917
Legal addressVia del Molo 31, 16126 Genova, IT
Parent companiesNone reported: NON_CONSOLIDATING

The company exists and is active, but its LEI data has not been confirmed since the last renewal. The record is kept as a draft and the counterparty is asked to renew before approval.

Hold: LEI lapsedSend renewal request

Before

OnboardingCounterparty CP-0862 · newmanual entry
LEI5299007KQ3MERD4SH141From the counterparty's application form
Legal name 
Legal form 
Jurisdiction 
Entity status 
LEI status 
Next renewal 
Register 
Company number 
Legal address 
Headquarters 
Parent companies 

The analyst looks the code up on the GLEIF website, copies eleven fields by hand and follows two more links to find the parents.

OnboardingQueue5 open
New counterparties · Thu 12 Nov · 5 in queue
Entered by salesLegal entityCountryLEI statusUltimate parentOnboarding
5299007KQ3MERD4SH141Meridale Shipping GmbHDEISSUEDCastellan Maritime Group S.A.Ready for approval
"Oakhaven Commodities", GBOakhaven Commodities Limited name match 0.957GBISSUEDNone: NATURAL_PERSONSRequest owner declaration
815600TSSR0LGS3C2A23Tessaro Logistica S.r.l.ITLAPSEDNone: NON_CONSOLIDATINGHold: LEI lapsed
213800BRNK7AGT5XD343Not looked up: check digits do not matchnonenonenoneAsk for the LEI again
"Quillon Freight Partners"No close match. Nearest: Quillon Freight Partnership LLP (0.742)nonenonenoneAnalyst to pick or reject
Three records found and charged. The mistyped LEI was rejected without a lookup and the name without a close match returned candidates, both at no cost.

Highlighted values are read from the API response. The data is a sample in the API's real output shape; names and figures are illustrative.

Call

The call behind it

One request with this input produces the 5 records the screen above is drawn from. Prices are the ones on the API page; records that fail or come back empty are not charged.

Input · POST /v2/actors/sfoln~lei-lookup/run-sync-get-dataset-items
{
  "leis": [
    "5299007KQ3MERD4SH141",
    "815600TSSR0LGS3C2A23",
    "213800BRNK7AGT5XD343"
  ],
  "companyNames": [
    {
      "name": "Oakhaven Commodities",
      "country": "GB"
    },
    "Quillon Freight Partners"
  ],
  "includeParents": true
}
First record of 5
Response · record 1 of 5 · sample data
{
  "input": {
    "lei": "5299007KQ3MERD4SH141"
  },
  "status": "ok",
  "charged": true,
  "chargedEvent": "lei-record",
  "source": "gleif",
  "found": true,
  "goldenCopyPublishedAt": "2026-11-12T08:00:00Z",
  "fetchedAt": "2026-11-12T10:14:02.611Z",
  "query": "5299007KQ3MERD4SH141",
  "lei": "5299007KQ3MERD4SH141",
  "legalName": "Meridale Shipping GmbH",
  "legalNameLanguage": "de",
  "otherNames": [
    {
      "name": "Meridale Reederei GmbH",
      "type": "PREVIOUS_LEGAL_NAME",
      "language": "de"
    }
  ],
  "entityStatus": "ACTIVE",
  "registrationStatus": "ISSUED",
  "jurisdiction": "DE",
  "country": "DE",
  "category": "GENERAL",
  "legalForm": {
    "code": "2HBR",
    "name": "Gesellschaft mit beschränkter Haftung"
  },
  "legalAddress": {
    "lines": [
      "Kehrwiederstieg 12"
    ],
    "city": "Hamburg",
    "region": "DE-HH",
    "postalCode": "20457",
    "country": "DE",
    "formatted": "Kehrwiederstieg 12, 20457 Hamburg, DE"
  },
  "headquartersAddress": {
    "lines": [
      "Kehrwiederstieg 12"
    ],
    "city": "Hamburg",
    "region": "DE-HH",
    "postalCode": "20457",
    "country": "DE",
    "formatted": "Kehrwiederstieg 12, 20457 Hamburg, DE"
  },
  "registrationAuthority": {
    "name": "Handelsregister",
    "entityId": "HRB 148213"
  },
  "entityCreationDate": "2009-03-17T00:00:00Z",
  "initialRegistrationDate": "2014-05-06T09:12:00Z",
  "lastUpdateDate": "2026-04-20T07:45:10Z",
  "nextRenewalDate": "2027-04-22T00:00:00Z",
  "renewalOverdue": false,
  "corroborationLevel": "FULLY_CORROBORATED",
  "bic": [],
  "directParent": {
    "lei": "724500MRDLH5HLD9NV17",
    "legalName": "Meridale Holding B.V.",
    "country": "NL",
    "entityStatus": "ACTIVE",
    "registrationStatus": "ISSUED"
  },
  "directParentException": null,
  "ultimateParent": {
    "lei": "222100X2CSTLN8MG0H84",
    "legalName": "Castellan Maritime Group S.A.",
    "country": "LU",
    "entityStatus": "ACTIVE",
    "registrationStatus": "ISSUED"
  },
  "ultimateParentException": null,
  "gleifUrl": "https://search.gleif.org/#/record/5299007KQ3MERD4SH141"
}
Charged eventCountPriceTotal
LEI record
lei-record
3$0.002$0.006
This run$0.006

Fields

Which output fields do the work

Output fieldUsed for
lei legalName otherNames legalForm jurisdictionIdentity block of the onboarding record; former names are passed on to sanctions screening.
entityStatus registrationStatus nextRenewalDate renewalOverdueThe file is held unless the entity is ACTIVE and the LEI is ISSUED; a renewal date in the past explains a LAPSED status.
legalAddress headquartersAddressAddress fields, and the country used for the risk rating.
registrationAuthorityRegister name and company number, to cross-check against the commercial register extract.
directParent ultimateParentDrawn as the ownership tree and added to the group exposure of the ultimate parent.
directParentException ultimateParentExceptionWhy no parent is reported; NATURAL_PERSONS triggers a request for a beneficial owner declaration.
match candidatesFor a name search: the score of the chosen record, and the nearest records when none is close enough.
status error goldenCopyPublishedAtInvalid codes and missing records are routed to a person; the publication time of the data is kept in the audit trail.

All output fields are listed on the API page.

Build

Build it

Look the counterparty up by code or by name, then write the record and decide whether the file can proceed.

Node.js · webhook handler
const body = cp.lei ? { leis: [cp.lei] } : { companyNames: [{ name: cp.name, country: cp.country }] };
const res = await fetch('https://api.apify.com/v2/actors/sfoln~lei-lookup/run-sync-get-dataset-items', {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.APIFY_TOKEN}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ ...body, includeParents: true }),
});
const [rec] = await res.json();

if (rec.status !== 'ok') {
  await onboarding.needsAnalyst(cp.id, rec.error.message, rec.candidates ?? []);
} else {
  await onboarding.fill(cp.id, {
    lei: rec.lei, legalName: rec.legalName, legalForm: rec.legalForm?.name, jurisdiction: rec.jurisdiction,
    legalAddress: rec.legalAddress?.formatted, hqAddress: rec.headquartersAddress?.formatted,
    register: rec.registrationAuthority?.name, companyNumber: rec.registrationAuthority?.entityId,
    parents: [rec.directParent, rec.ultimateParent].filter(Boolean),
    ownerDeclarationNeeded: rec.ultimateParentException?.reason === 'NATURAL_PERSONS',
  });
  if (rec.entityStatus !== 'ACTIVE' || rec.registrationStatus !== 'ISSUED') await onboarding.hold(cp.id, `LEI ${rec.registrationStatus}`);
}
  • Parents are the accounting-consolidation parents reported to GLEIF. They are not a beneficial ownership register; natural-person owners are not listed.
  • Only entities that applied for an LEI are in the database. Many small businesses have none, so not_found is a normal answer for them.

Authentication, the MCP endpoint and the asynchronous variant are on the API page.

More

Other things teams build with it

  • A monthly sweep that flags counterparties whose LEI has lapsed
  • Vendor master data cleaned up by matching company names to LEIs
  • Group exposure reports that roll counterparties up to the ultimate parent
  • Transaction reporting that needs a valid LEI before a trade is booked

Related demos

All demos · LEI Lookup – GLEIF Legal Entity Search: prices, input and output · /actors/lei-lookup.json carries this demo as demo