Skip to content

w3stling/lei

Repository files navigation

Legal Entity Identifier (LEI)

Build Download Javadoc License
CodeQL Quality Gate Coverage Bugs Vulnerabilities Code Smells

Note - from version 2.0.0:

  • New Java package name
  • New group ID in Maven / Gradle dependency declaration
  • Moved repository from JCenter to Maven Central Repository

The Legal Entity Identifier (LEI) is unique global identifier of legal entities participating in financial transactions. These can be individuals, companies or government entities that participate in financial transaction. The identifier is used in reporting to financial regulators and all financial companies and funds are required to have an LEI.

The identifier is formatted as a 20-character, alpha-numeric code based on the ISO 17442 standard developed by the International Organization for Standardization (ISO). It connects to key reference information that enables clear and unique identification of legal entities participating in financial transactions. Each LEI contains information about an entity’s ownership structure and thus answers the questions of 'who is who’ and ‘who owns whom’. Simply put, the publicly available LEI data pool can be regarded as a global directory of participants in the financial market.

This Java library makes it easy to lookup LEI information.

Lookup examples

Search LEI by legal name

LeiLookup lookup = LeiLookup.getInstance();
List<Lei> lei = lookup.getLeiByLegalName("Apple");

Search LEI by LEI code

LeiLookup lookup = LeiLookup.getInstance();
Optional<Lei> lei = lookup.getLeiByLeiCode("W22LROWP2IHZNBB6K528");

Search LEI by ISIN code

LeiLookup lookup = LeiLookup.getInstance();
Optional<Lei> lei = lookup.getLeiByIsinCode("US0378331005");

Search LEI by BIC code

LeiLookup lookup = LeiLookup.getInstance();
Optional<Lei> lei = lookup.getLeiByBicCode("BUKBGB22XXX");

Search LEI by CUSIP

LeiLookup lookup = LeiLookup.getInstance();
Optional<Lei> lei = lookup.getLeiByCusip("931142103");

Search LEI by SEDOL

LeiLookup lookup = LeiLookup.getInstance();
Optional<Lei> lei = lookup.getLeiBySedol("0884709");

Validation examples

Check if LEI code format is valid

boolean valid = LeiCodeValidator.isValid("W22LROWP2IHZNBB6K528");

Check if ISIN code format is valid

boolean valid = IsinCodeValidator.isValid("US0378331005");

Check if BIC code format is valid

boolean valid = BicCodeValidator.isValid("DEUTDEFFXXX");

Check if CUSIP format is valid

boolean valid = CusipValidator.isValid("931142103");

Check if SEDOL format is valid

boolean valid = SedolValidator.isValid("0884709");

Download

Download the latest JAR or grab via Maven or Gradle.

Maven setup

Add dependency declaration:

<project>
    ...
    <dependencies>
        <dependency>
            <groupId>com.apptasticsoftware</groupId>
            <artifactId>lei</artifactId>
            <version>3.3.6</version>
        </dependency>
    </dependencies>
    ...
</project>

Gradle setup

Add dependency declaration:

dependencies {
    implementation 'com.apptasticsoftware:lei:3.3.6'
}

Lei library requires at minimum Java 11.

License

MIT License

Copyright (c) 2024, Apptastic Software

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.