prhfi-bis
a small wrapper of Finnish Patent and Registration Office BIS v1 api
original document for the API => avoindata.prh.fi
Table of Contents
install
install from npm:
$> npm i profi-bis
git & build:
$> git clone https://github.com/kkuzar/prhfi-bis.git$> cd prhfi-bis $> npm run build
test build:
$> npm test
init
construct the new class:
// or using require// input options here, if null then use default.let bisapi =
default options:
;// this class can take any config in this format
API Functions
Full Wrapper for Bis v1 API.
getCompanyDetailWithBusinessId(intput: string)
fetch by Business Id fetch Company Full Detail with Finnish Business Id
;;
this function will return a detail JSON as BIS website shows.
getCompanyDetailWithQueryParam(inputObj: object)
fetch using query param let bis = ;const res = await bis;
this function will return a detail JSON as BIS website shows. This if the query is detail enough this function will return one full detail other wise it will return a list of potential company, more detail on BIS document in above link.
e.g.
Custom JSON return
// Custom return body formatprotected initStructedCompanyInfomation: StructedCompanyInfomation
the return value will be StructedCompanyInfomation
or array of it StructedCompanyInfomation[]
getCompanyWithBID(inputObj: object)
fetch Company Brief Structed Information with Business ID ; ;
getCompanyWithParam(inputObj: object)
fetch Company Brief Structed Information with Params ;;
example return for Structed Information:
[ { name: 'Suomen Ajoneuvotekniikka Oy', businessId: '3099016-4', companyForm: 'OY', website: '0400643313', latestAddr: 'Marjahaankierto 2-4', latestPost: 'IISALMI', latestCity: null, latestBusinessCode: '45112', latestBusinessLine: 'Retail sale of cars and light motor vehicles', latestAuxiliaryNames: 'Keski-Suomen Rengas' }, { name: 'Kestävä Kollektiivi Oy', businessId: '3093045-2', companyForm: 'OY', website: 'www.kestava.net', latestAddr: 'Husares 1853, depto 302 1428 CABA ARGENTINA', latestPost: null, latestCity: null, latestBusinessCode: '71121', latestBusinessLine: 'Town and city planning', latestAuxiliaryNames: '' }, ...]
Helper Functions
typeQueryBody(inputObj: object)
Assemble a company Request Query With Object that has same key example code snippet
let bis = ; let res = bis;
This helper will return a query object type has strutrue as following:
protected initBisCompanyDetailQueryObject
For now it will only validate the companyForm
, companyRegistrationFrom
, companyRegistrationTo
.