RegonAPI:¶
Client for Polish GUS Regon Database (BIR)¶
- Highlights:
- Supports BIR v1 and BIR v1.1
- Searching for information about business entities by: KRS, REGON and NIP
- Fetching business entities reports
- API messages available in English and Polish language
Usage example:
from RegonAPI import RegonAPI
from pprint import pprint
API_KEY = "abcde12345abcde12345"
CD_PROJEKT_REGON9 = "492707333"
api = RegonAPI(bir_version="bir1") # BIR version 1
api.authenticate(key=API_KEY)
res = api.dataDownloadFullReport(
CD_PROJEKT_REGON9,
"PublDaneRaportPrawna"
)
pprint(res)
User guide¶
Using RegonAPI¶
The RegonAPI Object¶
The RegonAPI
is the main interface object between client and REGON SOAP server.
It provides a searchData
and dataDownloadFullReport
methods allowing
searching for business entities and fetching reports.
Configuring the client¶
To configure RegonAPI
interface, attribute bir_version
needs to be set to
desired BIR version.
You can initialize the object using the following code:
from RegonAPI import RegonAPI
# bir1 bir1.1 ...
api = RegonAPI(bir_version="bir1")
To see all available BIR versions click here BIR Versions
Authentication¶
To authenticate client with your API Key use authenticate
method.
# This is an official key for testing
API_KEY = "abcde12345abcde12345"
api = RegonAPI(bir_version="bir1")
api.authenticate(key=API_KEY)
Want to get key for production? Check out Obtaining API Key
BIR Versions¶
To this date there are two version of BIR service.
- BIR v1.0 (2015)
- BIR v1.1 (2019)
Main differences¶
WSDL and Service URL are different between versions
- BIR v1
Test - Service URL: https://wyszukiwarkaregontest.stat.gov.pl/wsBIR/UslugaBIRzewnPubl.svc
Test - WSDL: https://wyszukiwarkaregontest.stat.gov.pl/wsBIR/wsdl/UslugaBIRzewnPubl.xsd
Production - Service URL: https://wyszukiwarkaregon.stat.gov.pl/wsBIR/UslugaBIRzewnPubl.svc
Production - WSDL: https://wyszukiwarkaregontest.stat.gov.pl/wsBIR/wsdl/UslugaBIRzewnPubl.xsd
- BIR v1.1
Test - Service URL: https://wyszukiwarkaregontest.stat.gov.pl/wsBIR/UslugaBIRzewnPubl.svc
Test - WSDL: https://wyszukiwarkaregontest.stat.gov.pl/wsBIR/wsdl/UslugaBIRzewnPubl-ver11-test.wsdl
Production - Service URL: https://wyszukiwarkaregon.stat.gov.pl/wsBIR/UslugaBIRzewnPubl.svc
Production - WSDL: https://wyszukiwarkaregon.stat.gov.pl/wsBIR/wsdl/UslugaBIRzewnPubl-ver11-prod.wsdl
Names of available reports are different
BIR 1.0 | BIR 1.1 |
---|---|
PublDaneRaportFizycznaOsoba | BIR11OsFizycznaDaneOgolne |
PublDaneRaportDzialalnoscFizycznejCeidg | BIR11OsFizycznaDzialalnoscCeidg |
PublDaneRaportDzialalnoscFizycznejRolnicza | BIR11OsFizycznaDzialalnoscRolnicza |
PublDaneRaportDzialalnoscFizycznejPozostala | BIR11OsFizycznaDzialalnoscPozostala |
PublDaneRaportDzialalnoscFizycznejWKrupgn | BIR11OsFizycznaDzialalnoscSkreslonaDo2014 |
PublDaneRaportDzialalnosciFizycznej | BIR11OsFizycznaPkd |
PublDaneRaportLokalneFizycznej | BIR11OsFizycznaListaJednLokaln |
PublDaneRaportLokalnaFizycznej | BIR11JednLokalnaOsFizycznej |
PublDaneRaportDzialalnosciLokalnejFizycznej | BIR11JednLokalnaOsFizycznejPkd |
PublDaneRaportPrawna | BIR11OsPrawna |
PublDaneRaportDzialalnosciPrawnej | BIR11OsPrawnaPkd |
PublDaneRaportLokalnePrawnej | BIR11OsPrawnaListaJednLokaln |
PublDaneRaportLokalnaPrawnej | BIR11JednLokalnaOsPrawnej |
PublDaneRaportDzialalnosciLokalnejPrawnej | BIR11JednLokalnaOsPrawnejPkd |
PublDaneRaportWspolnicyPrawnej | BIR11OsPrawnaSpCywilnaWspolnic |
PublDaneRaportTypJednostki | BIR11TypPodmiotu |
Other differences are listed in official documentation of BIR 1.1
Obtaining API Key¶
Settings¶
License¶
MIT License
Copyright (c) 2019 Bartosz Nowakowski
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.