Лицата на властта API

Content:

API authentication

Authentication - username and password

Request

POST https://web-api.apis.bg/api/auth/token

Request headers

Content-Type: application/json
Accept: application/json

Request body

                                
                                
Parameters Description
username Client username
password Client password

Response

Response body

HTTP Status code: 200 (OK)

                                        
                                    
Parameters Description
accessToken Access token are used in token-based authentication to allow an application to access an API.
refreshToken It is unique token than is used to obtain additional access token. This allows you yo have short-lived access tokens without having collect credentials every time. The refresh token is valid 30 days.
expireSeconds Remaining access token validity time.
username Client username

HTTP Status code: 400 (Bad request)

                                    
                                    

Authentication - refresh token

Request

POST https://web-api.apis.bg/api/auth/token

Request headers

Content-Type: application/json
Accept: application/json

Request body

                                
                                
Parameters Description
refreshToken Refresh token from the last authentication.

Response

Response body

HTTP Status code: 200 (OK)

                                        
                                    
Parameters Description
accessToken Access token are used in token-based authentication to allow an application to access an API.
refreshToken It is unique token than is used to obtain additional access token. This allows you yo have short-lived access tokens without having collect credentials every time. The refresh token is valid 30 days.
expireSeconds Remaining access token validity time.
username Client username

HTTP Status code: 400 (Bad request)

                                    
                                    

Search classifiers

Request

GET https://web-api.apis.bg/api/PEPS/AllClassifiers

Request headers

Content-Type: application/json
Accept: application/json

Response

Response body

HTTP Status code: 200 (OK)

                                
                            
Parameters Description
categoryKPKONPI KPKONPI categories
categoryZMIP ZMIP categories
organization Organization categories
position Position categories
docCount Total found people in the category
id Category id
name Category name
order Category order

HTTP Status code: 400 (Bad request)

                                
                            

Search request

Request

POST https://web-api.apis.bg/api/PEPS/Search

Request body

                                
                            
Parameters Description
searchText Search by name, EGN or EIK/Bulstat
ident Search identifier (EGN, LNCH, Assumed EGN)
identType Identifier type (1 - EGN, 2 - LNCH and 3 - Assumed EGN).
rootClassifier.type Classifiers (1 - ZPKONPI, 2 - ZMIP, 3 - Position and 4 - Organization).
rootClassifier.id Sub-classifier
yearTo Search year
classifiers.1 ZPKONPI classifier
classifiers.2 ZMIP classifier
classifiers.3 Position classifier
classifiers.4 Organization classifier
pageSize Number of results per page (default - 20)
page Page number (default - 1)
withAggs Return results with filters. The value can be true or false (default - true)
searchAfter If count of results are more than 1000, then to go to the next page you have to put value

Search by name

When you search by EGN, you have to send field "ident" with searching EGN.

Optional parameters are: "identType" (1 - EGN, 2 - LNCH or 3 - Assumed EGN), "yearTo", "classifiers" (1 - ZPKONPI, 2 - ZMIP, 3 - Position and 4 - Organization), "pageSize", "page" and "withAggs".

Example 1.1:

In the example below, we search "6510243709".

                                
                            

Example 1.2:

In the example below, we search assumed EGN (identType = 3) to year 2020.

                                
                            

Example 1.3:

In the example below, we search EGN (identType = 1) to year 2020. Page size is 20 per page and result return classifiers (withAggs = true). We search only in ZPKONPI category (classifiers.1) and sub-category (1 and 2).

                                
                            

Search by name or EIK/Bulstat

When you search by EGN, you have to send field "searchText" with searching name or EIK/Bulstat.

Optional parameters are: "yearTo", "classifiers" (1 - ZPKONPI, 2 - ZMIP, 3 - Position and 4 - Organization), "pageSize", "page" and "withAggs".

Example 2.1:

In the example below, we search "Иван".

                                
                            

Example 2.2:

In the example below, we search "Иван" to year 2020.

                                
                            

Example 2.3:

In the example below, we search "Иван" to year 2020. Page size is 20 per page and result return classifiers (withAggs = true).We search only in ZPKONPI category (classifiers.1) and sub-category (1 and 2).

                                
                            

Search by classifiers

When you search by classifiers, you have to send field "rootClassifier" and "yearTo".

Optional parameters are: "classifiers" "classifiers" (1 - ZPKONPI, 2 - ZMIP, 3 - Position and 4 - Organization), "pageSize", "page" and "withAggs".

Example 3.1:

In the example below, we search by classifier "ЗПКОНПИ" (type = 1) and sub-category "Президент и вицепрезидент" to year 2020.

                                
                            

Example 3.2:

In the example below, we search by classifier "ЗПКОНПИ" (type = 1) and sub-category "Народни представители" to year 2021.г. Page size is 20 per page and result return classifiers (withAggs = true).We search only in Organization category (classifiers.4) and sub-category (1 and 2).

                                
                            


WARNING! If you set fields "ident", "searchText" and "rootClassifier", the result will take into account only the "ident" field.

Example 4.1:

                                
                            

WARNING! If you set fields "searchText" and "rootClassifier", the result will take into account only the "searchText" field.

Example 4.2:

                                
                            

WARNING! If you want to go to next page, you have to send request with different page.

Example 4.3:

                                
                            

WARNING! If the result returns more than 1000 documents, if you want to go to next page, you have to add field "searchAfter". "searchAfter" is array from 2 elements. First one element is the "name" and the second one element is the field "identifier" of the last document.

Example 4.4:

                                
                            

Request headers

Content-Type: application/json
Accept: application/json

Response

Response body

HTTP Status code: 200 (OK)

                                
                            
Parameters Description
totalDocsCount Total found documents.
pageSize Dccuments per page.
highlights.linkedPersons.kpkonpi Linked people (ZPKONPI declarations).
highlights.linkedPersons.bulstat Linked people (TR and BULSTATS).
highlights.name Linked people.
lastRecord.classifZpkonpiCategory.id ZPKONPNI category identifier.
lastRecord.classifZpkonpiCategory.name ZPKONPNI category name.
lastRecord.classifZpkonpiCategory.order ZPKONPNI category order.
lastRecord.classifZmipCategory.id ZMIP category identifier.
lastRecord.classifZmipCategory.name ZMIP category name.
lastRecord.classifZmipCategory.order ZMIP category order.
lastRecord.classifOrganizations.id Organization category identifier.
lastRecord.classifOrganizations.name Organization category name.
lastRecord.classifOrganizations.order Organization category order.
lastRecord.classifPosition.id Position category identifier.
lastRecord.classifPosition.name Position category name.
lastRecord.classifPosition.order Position category order.
lastRecord.crawlerId Crawler ids: 2 - Declaration under the Counter-Corruption and Unlawfully Acquired Assets Forfeiture Act (CCUAAF Act), 3 – State Gazette, 4 - Presidential decree, 5 - Declaration by the member of the Supreme Judicial Council (SJC), 7 - Commercial register/BULSTAT register, 9 - Register of political parties.
lastRecord.recordYear Record year
lastRecord.recordDate Record date
lastRecord.classifZpkonpiCategoryId ZPKONPI category id.
lastRecord.classifZmipCategoryId ZMIP category id.
lastRecord.classifOrganizationIds Organization category id.
lastRecord.classifPositionId Position category id.
lastRecord.placeOfBirth Place of birth.
lastRecord.xmlWork Place of work.
lastRecord.xmlPosition Position.
lastRecord.biographyUrl Biography url.
lastRecord.xmlWorkCode Law number of ZKPONKI.
lastRecord.declarationUrl Declaration url.
lastRecord.identifier Identifier.
lastRecord.dvDocsMeta.title Title (State Gazette source).
lastRecord.dvDocsMeta.action >Action (State Gazette source).
lastRecord.dvDocsMeta.politicalParty Political party (State Gazette source).
lastRecord.dvDocsMeta.actDate Document act date (State Gazette source).
lastRecord.dvDocsMeta.docCaption Document caption (State Gazette source).
lastRecord.dvDocsMeta.docCode APIS metadata for link web.apis.bg - https://web.apis.bg//p.php?base={docBase}&doccode={docCode}
lastRecord.dvDocsMeta.docBase APIS metadata for link web.apis.bg - https://web.apis.bg//p.php?base={docBase}&doccode={docCode}
lastRecord.dvDocsMeta.dvBr State Gazette number.
lastRecord.kpDeclMeta.kpDeclClassifs.mainCategory Declaration main category.
lastRecord.kpDeclMeta.kpDeclClassifs.category ZPKONPI official classifier.
lastRecord.kpDeclMeta.kpDeclClassifs.institution Institution category from declaration.
lastRecord.kpDeclMeta.kpDeclClassifs.position Position category from declaration..
lastRecord.kpDeclMeta.declarationKind Type of declaration (for appointment, for dismissal and annual declaration).
lastRecord.kpDeclMeta.entryNumber Declaration entry number.
lastRecord.kpDeclMeta.entryDate Declaration date.
lastRecord.kpDeclMeta.declarationType Вид на декларацията по ЗПКОНПИ (годишна, за освобождаване, за назначаване).
lastRecord.kpDeclMeta.actNumber Declaration act number.
lastRecord.kpDeclMeta.actData Declaration date.
lastRecord.kpDeclMeta.year Declaration year.
lastRecord.kpDeclMeta.declarationDate Declaration date.
lastRecord.companyMeta.func 0 - Inactive, 1 - Development, 3 - Archive.
lastRecord.companyMeta.docUniqueId APIS metadata - unique id.
lastRecord.companyMeta.eik Company EIK/Bulstat.
lastRecord.linkedPersons.ident Linked person EGN or LNCH or Assumed EGN.
lastRecord.linkedPersons.identType Identifier type (1 - EGN, 2 - LNCH, 3 - Assumed EGN, 4 - Not found)
lastRecord.linkedPersons.firstName Linked person first name.
lastRecord.linkedPersons.secondName Linked person middle name.
lastRecord.linkedPersons.thirdName Linked person last name.
lastRecord.linkedPersons.birthDate Linked person date of birth.
lastRecord.linkedPersons.recordYears Linked person record years.
id Id.
uniqueId Unique id.
name Name.
ident EGN or LNCH or Assumed EGN.
identType Ident type (1 - EGN, 2 - LNCH, 3 - Assumed EGN, 4 - Not found).
birthDate Date of birth.
personType Linked type (0 - None, 1 - ZPKONPI and 2 - ZMIP).
sorts First element is relevance, the second is person identifier.
rootClassifier.name Classifier name.
rootClassifier.years Classifier years.
rootClassifier.id Classifier id.
rootClassifier.type Classifier type.
classifiers.categoryKPKONPI KPKONPI classifier.
classifiers.categoryZMIP ZMIP classifier.
classifiers.organization Organization classifier.
classifiers.position Position classifier.
classifiers.docCount Total found people in the classifier.
classifiers.id classifier id.
classifiers.name Classifier name.
classifiers.order Classifier order.
pageNumber Page number.
totalPages Total pages.

HTTP Status code: 400 (Bad request)

                                
                            

Person dossier

Request

GET https://web-api.apis.bg/api/PEPS/PersonDossier/{id}

Request GET parameters

id Person identifier.

Request headers

Content-Type: application/json
Accept: application/json

Response

Response body

HTTP Status code: 200 (OK)

                                
                            
Parameters Description
biography.content Biography.
biography.contactInfo Person contact info.
biography.biographyUrl Biography url.
biography.image Person image.
records Here.
recordsLinkedPersonsDistinct Distinct linked people.
linkedPersonsMeta Meta linked people
ofacData.id OFAC - id.
ofacData.tableTypeId OFAC - table type id.
ofacData.name OFAC - name.
ofacData.num OFAC - number.
ofacData.country OFAC - country.
ofacData.ident OFAC - EIK/Bulstat
ofacData.linkedPerson OFAC - Linked person.
ofacData.tableType OFAC - description.
id Id.
uniqueId Unique id.
name Name.
ident EGN or LNCH or Assumed EGN.
identType Ident type (1 - EGN, 2 - LNCH, 3 - Assumed EGN, 4 - Not found).
birthDate Date of birth.
personType Linked type (0 - None, 1 - ZPKONPI and 2 - ZMIP).
sorts First element is relevance, the second is person identifier.

HTTP Status code: 400 (Bad request)

                                
                            

Company dossier

Request

GET https://web-api.apis.bg/api/PEPS/CompanyDossier/{id}

Request GET parameters

id Company EIK/Bulstat.

Request headers

Content-Type: application/json
Accept: application/json

Response

Response body

HTTP Status code: 200 (OK)

                                
                            
Parameters Description
eik EIK/Bulstat
caption Comapny name
uniqueId Company unique id.
type Company type (1 - Bulstat, 2 - EIK).
linkedData.linkedPersons.name Linked person name.
linkedData.linkedPersons.egn Linked person EGN.
linkedData.linkedPersons.linkedIndirectOwnershipChain Linked person ownership chain
linkedData.linkedPersons.positions 0 - None data, 1 - Owner, 2 - Shareholder, 3 - Owner and Shareholder, 4 - Beneficial owner, 5 - Owner and Beneficial owner, 6 - Shareholder and Beneficial owner, 7 - Owner, Shareholder and Beneficial owner, 8 - Representative, 9 - Owner and Representative, 10 - Shareholder and Representative, 11 - Owner, Shareholder and Representative, 12 - Beneficial owner and Representative, 13 - Owner, Beneficial owner and Representative, 14 - Shareholder, Beneficial owner and Representative, 15 - Owner, Shareholder, Beneficial owner and Representative
linkedData.linkedPersons.peps Here.
linkedData.allSubjects Here.
linkedData.pepsPersons Here.
linkedData.pepsKPKONPI.identifier Identifier of linked person from declaration.
linkedData.pepsKPKONPI.name Name of linked person from declaration.
linkedData.pepsKPKONPI.ident Ident of linked person from declaration.
linkedData.pepsKPKONPI.posititions Positions of linked person from declaration.
linkedData.pepsKPKONPI.kPKONPIPersons Linked person from ZPKNOPI.
linkedData.registeredBeneficialOwners.identifier Beneficial owner identifier.
linkedData.registeredBeneficialOwners.name Beneficial owner name.
linkedData.registeredBeneficialOwners.ident Beneficial owner ident.
linkedData.registeredBeneficialOwners.role Beneficial owner role.
linkedData.registeredBeneficialOwners.personType 1 - senior public office holders (SPOHs), 2 - politically exposed persons (PEPs) and 3 - PEPs/SPOHs.
linkedData.beneficialOwners.id Identifier of beneficial owners with at least 25% equity or equity interest.
linkedData.beneficialOwners.identifier EGN of beneficial owners with at least 25% equity or equity interest.
linkedData.beneficialOwners.identifierType EGN, LNCH or Assumed EGN of beneficial owners with at least 25% equity or equity interest.
linkedData.beneficialOwners.name Name of beneficial owners with at least 25% equity or equity interest.
linkedData.beneficialOwners.isPublic Beneficial owner is public
linkedData.beneficialOwners.isMunicipal Beneficial owner is minicipal
linkedData.beneficialOwners.percent Beneficial owner percent
linkedData.beneficialOwners.isCoop Beneficial owner is coop
linkedData.beneficialOwners.isNonProfit Beneficial owner is non profir
linkedData.beneficialOwners.isManagerOwner Beneficial owner is manager owner
linkedData.beneficialOwners.selfDeclared Beneficial owner self declared
ofacData Here.

HTTP Status code: 400 (Bad request)

                                
                            

Person declarations

Request

GET https://web-api.apis.bg/api/PEPS/GetPersonalDeclaration/{id}

Request GET parameters

id Person identifier.

Request headers

Content-Type: application/json
Accept: application/json

Response

Response body

HTTP Status code: 200 (OK)

                                
                            
Parameters Description
tableTypeId Table id.
description Decsription.
tableYears.year Declaration year.
cell.num Cell number.
cell.description Cell description.
cell.text Cell text.
cell.parent Cell parent.
recordDate Declaration date.
declarationUrl Declaration url.

HTTP Status code: 400 (Bad request)

                                
                            

Check for person declarations

Request

GET https://web-api.apis.bg/api/PEPS/IsDeclarationExist/{id}

Request GET parameters

id Person identifier.

Request headers

Content-Type: application/json
Accept: application/json

Response

Response body

HTTP Status code: 200 (OK)

true/false

HTTP Status code: 400 (Bad request)

                                
                            

Вижте още: