Skip to content

Latest commit

 

History

History
52 lines (38 loc) · 1.55 KB

README.md

File metadata and controls

52 lines (38 loc) · 1.55 KB

OpenCorporates

GoDoc Build Status Code Coverage Go Report Card

Golang interface for the OpenCorporates service.

Installation

$ go get -u github.com/rvflash/opencorporates

Usage

Package still in development, all the methods are not implemented yet.

The import of the package and errors check are voluntary ignored for the demo.

See the test files for more example.

Search a company by its name or jurisdication .

api := opencorporates.API()
it := api.Companies("nautic motors evasion", "fr")
for {
    company, err := it.Next()
    if err != nil {
        if err != opencorporates.EOF {
            fmt.Println(err)
        }
        break
    }
    fmt.Printf("%s (%s)\n", company.Name, company.Number)
}
// Output: SARL NAUTIC MOTOR'S EVASION (529591737)
// NAUTIC MOTOR'S EVASION 35 (810622795)

Search a company by its number (identifier).

api := opencorporates.API()
company, _ := api.CompanyByID("529591737", "fr")
println(company.Name+" #"+ company.Number)
// Output: SARL NAUTIC MOTOR'S EVASION (529591737)