Skip to main content

Advanced Search

Overview

The advanced search endpoint (/search/advanced) provides filtering and field projection capabilities for sophisticated company queries. This allows you to create precise searches that return exactly the data you need.

Filter Operations

The advanced search supports a comprehensive set of filter operations:

Comparison Operators

OperatorDescriptionExample
=Equal tosector = "private_sector"
!=Not equal tosector != "public_sector"
>=Greater than or equal toestablishmentDate >= "2020-01-01"
>Greater thanestablishmentDate > "2020-01-01"
<=Less than or equal toestablishmentDate <= "2023-12-31"
<Less thanestablishmentDate < "2023-12-31"

Text Operations

OperatorDescriptionExample
CONTAINSText contains substringbusinessName CONTAINS "Kontakto"
NOT CONTAINSText does not contain substringbusinessName NOT CONTAINS "Test"
STARTS WITHText starts with substringbusinessName STARTS WITH "Oy"
NOT STARTS WITHText does not start with substringbusinessName NOT STARTS WITH "Test"

List Operations

OperatorDescriptionExample
INValue is in listsector IN ["private_sector", "limited_liability_business"]
NOT INValue is not in listsector NOT IN ["public_sector", "other"]

Range Operations

OperatorDescriptionExample
TORange between valuesestablishmentDate TO "2020-01-01" "2023-12-31"

Existence Checks

OperatorDescriptionExample
EXISTSField exists and has valuevatId EXISTS
NOT EXISTSField does not exist or is nullvatId NOT EXISTS
IS NULLField is explicitly nullvatId IS NULL
IS NOT NULLField is not nullvatId IS NOT NULL
IS EMPTYField is empty string or empty arrayauxiliaryNames IS EMPTY
IS NOT EMPTYField is not emptyauxiliaryNames IS NOT EMPTY

Logical Operators

Combine multiple filters using logical operators:

  • AND: All conditions must be true
  • OR: At least one condition must be true

Examples

# Active companies in Helsinki with green rating
operationalStatus = true AND domicileCity = "Helsinki" AND kontaktoRating.color = "green"

# Companies in specific sectors or cities
sector IN ["private_sector", "limited_liability_business"] OR domicileCity IN ["Helsinki", "Espoo"]

# Complex combination
operationalStatus = true AND (sector = "private_sector" OR sector = "limited_liability_business") AND establishmentDate >= "2020-01-01"

Field Projection

Control exactly which fields are returned using the fields parameter. This significantly improves performance by reducing response size.

Available Fields

Basic Company Information

  • businessId - Finnish business ID (Y-tunnus)
  • businessName - Primary business name
  • vatId - VAT identification number
  • auxiliaryNames - Alternative business names
  • parallelNames - Parallel business names

Status and Classification

  • operationalStatus - Whether company is active
  • statusAsOf - Status timestamp
  • statusDescription - Status description
  • countryCode - Country code
  • languageCode - Language code
  • sector - Kontakto sector classification

Location and Industry

  • domicileCity - Company's city
  • domicileCode - City code
  • industryDescription - Industry description
  • tol2008Code - TOL industry classification code
  • legalForm - Legal form description
  • legalFormCode - Legal form code
  • establishmentDate - Company establishment date
  • createdAt - Record creation timestamp

Nested Fields

  • kontaktoRating.color - Rating color (green/yellow/red)
  • kontaktoRating.reason - Rating reason
  • kontaktoRating.asOf - Rating timestamp

Array Fields

  • address.city - Address city
  • address.street - Address street
  • website.name - Website name
  • website.url - Website URL
  • domain.name - Domain name
  • phoneNumber.number - Phone number