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

Content:

API authentication

Authentication - username and password

Request

POST https://web-auth.apis.bg/api/v1/authentication

Request headers

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

Request body

                                
                                
PropertyTypeDescription
usernamestringClient username.
passwordstringClient password.

Response

Response body

HTTP Status code: 200 (OK)

                                        
                                    
PropertyTypeDescription
accessTokenstringAccess token used for API authentication. Valid for 20 minutes.
refreshTokenstringToken used to obtain a new access token without resending credentials. Valid for 1 day.

HTTP Status code: 400 (Bad request)

                                    
                                    

Authentication - refresh token

Request

POST https://web-auth.apis.bg/api/v1/authentication/refresh

Request headers

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

Request body

                                
                                
PropertyTypeDescription
refreshTokenstringRefresh token from the previous authentication.

Response

Response body

HTTP Status code: 200 (OK)

                                        
                                    
PropertyTypeDescription
accessTokenstringAccess token used for API authentication. Valid for 20 minutes.
refreshTokenstringToken used to obtain a new access token without resending credentials. Valid for 1 day.

HTTP Status code: 400 (Bad request)

                                    
                                    

Search classifiers

Request

GET https://peps-api.apis.bg/api/v1/classifiers

Request headers

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

Response

Response body

HTTP Status code: 200 (OK)

                                
                            
PropertyTypeDescription
categoryKPKONPIarray<object>KPKONPI categories.
categoryZMIParray<object>ZMIP categories.
organizationarray<object>Organization categories.
positionarray<object>Position categories.
docCountintNumber of people in the category.
idintCategory identifier.
namestringCategory name.
orderintCategory display order.

Search request

Request

POST https://peps-api.apis.bg/api/v1/search

Request body

                                
                            
PropertyTypeDescription
searchTextstringSearch text: person name, EGN, or company EIK/BULSTAT.
identstringPerson identifier: EGN, LNCH, or assumed EGN.
identTypeintIdentifier type. Possible values: 1 – EGN; 2 – LNCH; 3 – assumed EGN; 4 – not found; 5 – ChFL; 6 – unknown.
rootClassifier.typeintRoot classifier type. Possible values: 1 – ZPKONPI; 2 – ZMIP; 3 – Position; 4 – Organization.
rootClassifier.idintSub-classifier identifier.
yearTointUpper year boundary for the search.
classifiers.categoryKPKONPIarray<int>ZPKONPI classifier identifiers.
classifiers.categoryZMIParray<int>ZMIP classifier identifiers.
classifiers.positionarray<int>Position classifier identifiers.
classifiers.organizationarray<int>Organization classifier identifiers.
pageSizeintNumber of results per page. Default: 20.
pageintPage number. Default: 1.
withAggsboolWhether classifier aggregations/filters are returned. Possible values: true, false. Default: true.
searchAfterarray<string>Cursor used when the result set exceeds 1000 documents. Supply two values: the last document name and identifier.

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.categoryKPKONPI) 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.categoryKPKONPI) 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.organization) and sub-category (1 and 2).

                                
                            

Example 3.3:

In the example below, we search by classifier "ЗМИП" (type = 2) in all sub-categories to year 2024. Page size is 20 per page and result return classifiers (withAggs = true).We search only in Organization category (classifiers.organization) 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)

                                
                            
PropertyTypeDescription
totalDocsCountintTotal number of matching documents.
pageSizeintDocuments per page.
highlights.linkedPersons.kpkonpiarray<string>Highlighted linked persons from ZPKONPI declarations.
highlights.linkedPersons.bulstatarray<string>Highlighted linked persons from Commercial Register/BULSTAT data.
highlights.namearray<string>Highlighted matching person name.
lastRecord.classifZpkonpiCategory.idintZPKONPNI category identifier.
lastRecord.classifZpkonpiCategory.namestringZPKONPNI category name.
lastRecord.classifZpkonpiCategory.orderintZPKONPNI category order.
lastRecord.classifZmipCategory.idintZMIP category identifier.
lastRecord.classifZmipCategory.namestringZMIP category name.
lastRecord.classifZmipCategory.orderintZMIP category order.
lastRecord.classifOrganizations.idintOrganization category identifier.
lastRecord.classifOrganizations.namestringOrganization category name.
lastRecord.classifOrganizations.orderintOrganization category order.
lastRecord.classifPosition.idstringPosition category identifier.
lastRecord.classifPosition.namestringPosition category name.
lastRecord.classifPosition.orderintPosition category order.
lastRecord.crawlerIdintSource crawler identifier. Possible documented values: 2 – CCUAAF/ZPKONPI declaration; 3 – State Gazette; 4 – Presidential decree; 5 – Supreme Judicial Council declaration; 7 – Commercial Register/BULSTAT; 9 – Register of political parties.
lastRecord.recordYearintRecord year.
lastRecord.recordDatestring (date-time)Record date and time.
lastRecord.classifZpkonpiCategoryIdintZPKONPI category id.
lastRecord.classifZmipCategoryIdintZMIP category id.
lastRecord.classifOrganizationIdsarray<int>Organization category id.
lastRecord.classifPositionIdintPosition category id.
lastRecord.placeOfBirthstringPlace of birth.
lastRecord.xmlWorkstringPlace of work.
lastRecord.xmlPositionstringPosition.
lastRecord.biographyUrlstringBiography URL.
lastRecord.xmlWorkCodestringLaw number of ZKPONKI.
lastRecord.declarationUrlstringDeclaration URL.
lastRecord.identifierstringIdentifier.
lastRecord.dvDocsMeta.titlestringTitle (State Gazette source).
lastRecord.dvDocsMeta.actionstring>Action (State Gazette source).
lastRecord.dvDocsMeta.politicalPartystringPolitical party (State Gazette source).
lastRecord.dvDocsMeta.actDatestring (date-time)Document act date (State Gazette source).
lastRecord.dvDocsMeta.docCaptionstringDocument caption (State Gazette source).
lastRecord.dvDocsMeta.docCodestringAPIS metadata for link web.apis.bg - https://web.apis.bg//p.php?base={docBase}&doccode={docCode}.
lastRecord.dvDocsMeta.docBasestringAPIS metadata for link web.apis.bg - https://web.apis.bg//p.php?base={docBase}&doccode={docCode}.
lastRecord.dvDocsMeta.dvBrintState Gazette number.
lastRecord.kpDeclMeta.kpDeclClassifs.mainCategorystring | nullDeclaration main category.
lastRecord.kpDeclMeta.kpDeclClassifs.categorystringZPKONPI official classifier.
lastRecord.kpDeclMeta.kpDeclClassifs.institutionstringInstitution category from declaration.
lastRecord.kpDeclMeta.kpDeclClassifs.positionstringPosition category from declaration..
lastRecord.kpDeclMeta.declarationKindintDeclaration kind: appointment, dismissal, or annual declaration.
lastRecord.kpDeclMeta.entryNumberstringDeclaration entry number.
lastRecord.kpDeclMeta.entryDatestring (date)Declaration date.
lastRecord.kpDeclMeta.declarationTypestringDeclaration type under ZPKONPI (annual, dismissal, or appointment).
lastRecord.kpDeclMeta.actNumberstring | nullDeclaration act number.
lastRecord.kpDeclMeta.actDatastring | nullDeclaration date.
lastRecord.kpDeclMeta.yearstringDeclaration year.
lastRecord.kpDeclMeta.declarationDatestring (date)Declaration date.
lastRecord.companyMeta.funcintCompany record state. Possible values: 0 – inactive; 1 – development; 3 – archive.
lastRecord.companyMeta.docUniqueIdintAPIS metadata - unique id.
lastRecord.companyMeta.eikstringCompany EIK/Bulstat.
lastRecord.linkedPersons.identstringLinked person EGN or LNCH or Assumed EGN.
lastRecord.linkedPersons.identTypeintIdentifier type. Possible values: 1 – EGN; 2 – LNCH; 3 – assumed EGN; 4 – not found; 5 – ChFL; 6 – unknown.
lastRecord.linkedPersons.firstNamestringLinked person first name.
lastRecord.linkedPersons.secondNamestringLinked person middle name.
lastRecord.linkedPersons.thirdNamestringLinked person last name.
lastRecord.linkedPersons.birthDatestring (date-time) | nullLinked person date of birth.
lastRecord.linkedPersons.recordYearsarray<int>Linked person record years.
idstringIdentifier.
uniqueIdstringUnique identifier.
namestringName.
identstringEGN or LNCH or Assumed EGN.
identTypeintIdentifier type. Possible values: 1 – EGN; 2 – LNCH; 3 – assumed EGN; 4 – not found; 5 – ChFL; 6 – unknown.
birthDatestring (date-time) | nullDate of birth.
personTypeintPerson type. Possible values: 0 – None; 1 – ZPKONPI; 2 – ZMIP; 3 – ZPKONPI + ZMIP; 4 – Archive ZPKONPI; 5 – ZPKONPI + Archive ZPKONPI; 6 – ZMIP + Archive ZPKONPI; 7 – ZPKONPI + ZMIP + Archive ZPKONPI; 8 – Archive ZMIP; 9 – ZPKONPI + Archive ZMIP; 10 – ZMIP + Archive ZMIP; 11 – ZPKONPI + ZMIP + Archive ZMIP; 12 – Archive ZPKONPI + Archive ZMIP; 13 – ZPKONPI + Archive ZPKONPI + Archive ZMIP; 14 – ZMIP + Archive ZPKONPI + Archive ZMIP; 15 – ZPKONPI + ZMIP + Archive ZPKONPI + Archive ZMIP.
sortsarray<number|string> | nullFirst element is relevance, the second is person identifier.
rootClassifier.namestringClassifier name.
rootClassifier.yearsarray<int>Classifier years.
rootClassifier.idintClassifier identifier.
rootClassifier.typeintRoot classifier type. Possible values: 1 – ZPKONPI; 2 – ZMIP; 3 – Position; 4 – Organization.
classifiers.categoryKPKONPIarray<object>KPKONPI classifier.
classifiers.categoryZMIParray<object>ZMIP classifier.
classifiers.organizationarray<object>Organization classifier.
classifiers.positionarray<object>Position classifier.
classifiers.docCountintTotal found people in the classifier.
classifiers.idintClassifier identifier.
classifiers.namestringClassifier name.
classifiers.orderintClassifier display order.
pageNumberintPage number.
totalPagesintTotal pages.

Person dossier

Request

GET https://peps-api.apis.bg/api/v1/persons/{id}

Request GET parameters

id Person identifier.

Request headers

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

Response

Response body

HTTP Status code: 200 (OK)

                                
                            
PropertyTypeDescription
biography.contentstringBiography.
biography.contactInfostringPerson contact info.
biography.biographyUrlstringBiography URL.
biography.imagestringPerson image.
recordsarray<object>Person record history. Uses the shared person-record structure documented in the Search response.
recordsLinkedPersonsDistinctarray<object>Distinct linked people.
linkedPersonsMetaobjectMeta linked people.
ofacData.idintOFAC - id.
ofacData.tableTypeIdintOFAC - table type id.
ofacData.namestringOFAC - name.
ofacData.numintOFAC - number.
ofacData.countrystringOFAC - country.
ofacData.identstringOFAC - EIK/Bulstat.
ofacData.linkedPersonobject | nullOFAC - Linked person.
ofacData.tableTypestringOFAC - description.
idstringIdentifier.
uniqueIdstringUnique identifier.
namestringName.
identstringEGN or LNCH or Assumed EGN.
identTypeintIdentifier type. Possible values: 1 – EGN; 2 – LNCH; 3 – assumed EGN; 4 – not found; 5 – ChFL; 6 – unknown.
birthDatestring (date-time) | nullDate of birth.
personTypeintPerson type. Possible values: 0 – None; 1 – ZPKONPI; 2 – ZMIP; 3 – ZPKONPI + ZMIP; 4 – Archive ZPKONPI; 5 – ZPKONPI + Archive ZPKONPI; 6 – ZMIP + Archive ZPKONPI; 7 – ZPKONPI + ZMIP + Archive ZPKONPI; 8 – Archive ZMIP; 9 – ZPKONPI + Archive ZMIP; 10 – ZMIP + Archive ZMIP; 11 – ZPKONPI + ZMIP + Archive ZMIP; 12 – Archive ZPKONPI + Archive ZMIP; 13 – ZPKONPI + Archive ZPKONPI + Archive ZMIP; 14 – ZMIP + Archive ZPKONPI + Archive ZMIP; 15 – ZPKONPI + ZMIP + Archive ZPKONPI + Archive ZMIP.
sortsarray<number|string> | nullFirst element is relevance, the second is person identifier.

HTTP Status code: 404 (Not found)

Company dossier

Request

GET https://peps-api.apis.bg/api/v1/companies/{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)

                                
                            
PropertyTypeDescription
eikstringEIK/Bulstat.
captionstringCompany name.
uniqueIdintCompany unique identifier.
typeintCompany identifier type. Possible values: 1 – BULSTAT; 2 – EIK.
linkedData.linkedPersons.namestringLinked person name.
linkedData.linkedPersons.egnstringLinked person EGN.
linkedData.linkedPersons.linkedIndirectOwnershipChain array<object>Indirect ownership chain for the linked person.
linkedData.linkedPersons.positionsintRole bitmask. Possible values: 0 – none; 1 – owner; 2 – shareholder; 3 – owner + shareholder; 4 – beneficial owner; 5 – owner + beneficial owner; 6 – shareholder + beneficial owner; 7 – owner + shareholder + beneficial owner; 8 – representative; 9 – owner + representative; 10 – shareholder + representative; 11 – owner + shareholder + representative; 12 – beneficial owner + representative; 13 – owner + beneficial owner + representative; 14 – shareholder + beneficial owner + representative; 15 – owner + shareholder + beneficial owner + representative.
linkedData.linkedPersons.pepsobjectPEP/SPOH data for the linked person. Uses the shared person search-result structure.
linkedData.allSubjectsarray<object>All linked subjects. Uses the linked-person structure.
linkedData.pepsPersonsarray<object>Linked PEP persons. Uses the linked-person structure.
linkedData.pepsKPKONPI.identifierstringLinked person identifier from a declaration.
linkedData.pepsKPKONPI.namestringLinked person name from a declaration.
linkedData.pepsKPKONPI.identstringLinked person EGN/LNCH/assumed EGN from a declaration.
linkedData.pepsKPKONPI.posititionsarray<string>Positions of the linked person from a declaration.
linkedData.pepsKPKONPI.kPKONPIPersonsarray<object>Nested linked persons from ZPKONPI.
linkedData.registeredBeneficialOwners.identifierstringRegistered beneficial owner identifier.
linkedData.registeredBeneficialOwners.namestringRegistered beneficial owner name.
linkedData.registeredBeneficialOwners.identstringRegistered beneficial owner EGN/LNCH/assumed EGN.
linkedData.registeredBeneficialOwners.rolestringRegistered beneficial owner role.
linkedData.registeredBeneficialOwners.personTypeintPerson category. Possible values: 1 – senior public office holder (SPOH); 2 – politically exposed person (PEP); 3 – PEP/SPOH.
linkedData.beneficialOwners.idstringIdentifier of beneficial owners with at least 25% equity or equity interest.
linkedData.beneficialOwners.identifierstringEGN of beneficial owners with at least 25% equity or equity interest.
linkedData.beneficialOwners.identifierTypestringBeneficial-owner identifier type: EGN, LNCH, or assumed EGN.
linkedData.beneficialOwners.namestringName of beneficial owners with at least 25% equity or equity interest.
linkedData.beneficialOwners.isPublicboolWhether the beneficial owner is a public entity.
linkedData.beneficialOwners.isMunicipalboolWhether the beneficial owner is municipal.
linkedData.beneficialOwners.percentintOwnership percentage.
linkedData.beneficialOwners.isCoopboolWhether the beneficial owner is a cooperative.
linkedData.beneficialOwners.isNonProfitboolWhether the beneficial owner is non-profit.
linkedData.beneficialOwners.isManagerOwnerboolWhether the beneficial owner is also a manager.
linkedData.beneficialOwners.selfDeclaredboolWhether the beneficial owner is self-declared.
ofacDataarray<object>OFAC data. Uses the OFAC structure documented above.

HTTP Status code: 404 (Not found)

Check for person declarations

Request

GET https://peps-api.apis.bg/api/v1/declarations/{id}/exist

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

Create notification

Request

POST https://peps-api.apis.bg/api/v1/notifications

Request body

                                
                            
PropertyTypeDescription
emailstringEmail address.
datastringInput rows in identifier;name format. Identifier is optional; name is required. Separate rows with \r\n.

Request headers

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

Response

Response body

HTTP Status code: 200 (OK)

                                
                            
PropertyTypeDescription
idintNotification id.
emailstringEmail address.
lastModifyDatestring (date-time)Date and time of the last modification.
datastringInput rows in identifier;name format. Identifier is optional; name is required. Separate rows with \r\n.
messageTypeintMessage status. Possible values: 0 – no exceptions; 1 – user does not exist; 3 – notification was saved successfully; 4 – notification did not saved; 7 – notification was modified successfully; 8 – notification did not modified.
usernamestringUsername.

HTTP Status code: 404 (Not found)

Get notification

Request

GET https://peps-api.apis.bg/api/v1/notifications/getbyuser

Request headers

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

Response

Response body

HTTP Status code: 200 (OK)

                                
                            
PropertyTypeDescription
idintNotification id.
emailstringEmail address.
lastModifyDatestring (date-time)Date and time of the last modification.
datastringSubmitted data content.
messageTypeintMessage status. Possible values: 0 – no exceptions; 1 – user does not exist; 2 – notification does not exist.
usernamestringUsername.

HTTP Status code: 404 (Not found)

Delete notification

Request

DELETE https://peps-api.apis.bg/api/v1/notifications

Request headers

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

Response

Response body

HTTP Status code: 200 (OK)

                                
                            
PropertyTypeDescription
idintNotification id.
emailstringEmail address.
lastModifyDatestring (date-time)Date and time of the last modification.
datastring | nullSubmitted data content.
messageTypeintMessage status. Possible values: 0 – no exceptions; 1 – user does not exist; 2 – notification does not exist; 5 – notification was deleted successfully; 6 – notification did not deleted.
usernamestringUsername.

HTTP Status code: 404 (Not found)

Report

Request

POST https://peps-api.apis.bg/api/v1/reports

Request body

                                
                            
PropertyTypeDescription
typeintReport type. Possible values: 1 – quick report (fewer than 1000 rows, not saved to logs); 2 – daily report (saved to logs and delivered by email). Default: 1.
datastringInput rows in identifier;name format. Identifier is optional; name is required. Separate rows with \r\n.

Request headers

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

Response

Response body

HTTP Status code: 200 (OK)

                                
                            
PropertyTypeDescription
emailstringEmail address.
reportDatestring (date-time)Date and time when the report was generated.
datastringInput rows in identifier;name format. Identifier is optional; name is required. Separate rows with \r\n.
resultarray<object>Matched results only.
result.identifierstringPerson identifier.
result.namestringPerson name.
result.matchintMatch level. Possible values: 100 – full match by name and identifier; 75 – full match by name and assumed identifier; 50 – full match by name and birth date; 25 – match by name only.
messageTypeintMessage status. Possible values: 0 – no exceptions; 1 – user does not exist; 2 – notification does not exist; 11 – rows are more than 1000.
usernamestringUsername.

HTTP Status code: 400 (Bad request)

                                
                            

All logs

Request

GET https://peps-api.apis.bg/api/v1/logs

Request headers

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

Response

Response body

HTTP Status code: 200 (OK)

                                
                            
PropertyTypeDescription
logs.idintLog identifier.
logs.insertDatestring (date-time)Date and time when the log was created.
messageTypeintMessage status. Possible values: 0 – no exceptions; 1 – user does not exist; 9 – logs did not exist.
usernamestringUsername.

HTTP Status code: 400 (Bad request)

                                
                            

Log

Request

GET https://peps-api.apis.bg/api/v1/logs/{id}

Request GET parameters

id Log id

Request headers

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

Response

Response body

HTTP Status code: 200 (OK)

                        
                    
PropertyTypeDescription
idintLog identifier.
insertDatestring (date-time)Date and time when the log was created.
datastringSubmitted data content.
resultarray<object>Matched results only.
result.identifierstringPerson identifier.
result.namestringPerson name.
result.matchintMatch level. Possible values: 100 – full match by name and identifier; 75 – full match by name and assumed identifier; 50 – full match by name and birth date; 25 – match by name only.
messageTypeintMessage status. Possible values: 0 – no exceptions; 1 – user does not exist; 10 – log does not exist.
usernamestringUsername.

HTTP Status code: 400 (Bad request)

                        
                    

Вижте още: