> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tic.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Search

> Typesense-backed search in LENS — search companies, persons, workplaces, vehicles, properties, bankruptcies, and financial reports with sub-100ms latency.

The TIC LENS search API is built on [Typesense](https://typesense.org), a lightning-fast search engine that stores its index in RAM. This makes it ideal for search-as-you-type, autocomplete, geo-search, and other latency-sensitive applications.

All features described in the [Typesense API (v29)](https://typesense.org/docs/29.0/api/) are available through our proxy endpoints.

## Collections

| Collection        | Endpoint                      | Minimum plan    |
| ----------------- | ----------------------------- | --------------- |
| Companies         | `/search-public/companies`    | **Pro+**        |
| Persons           | `/search-public/persons`      | **Enterprise+** |
| Workplaces        | `/search-public/workplaces`   | **Max+**        |
| Vehicles          | `/search-public/vehicles`     | **Pro+**        |
| Properties        | `/search-public/properties`   | **Max+**        |
| Bankruptcies      | `/search-public/bankruptcies` | **Max+**        |
| Financial reports | `/search-public/reports`      | **Enterprise+** |

## Parameters

| Parameter   | Type   | Description                                                                                                         |
| ----------- | ------ | ------------------------------------------------------------------------------------------------------------------- |
| `q`         | string | The search query. Use `*` to match all documents.                                                                   |
| `query_by`  | string | Comma-separated list of fields to search in.                                                                        |
| `filter_by` | string | Filter expression (see [Typesense filter docs](https://typesense.org/docs/29.0/api/search.html#filter-parameters)). |
| `sort_by`   | string | Comma-separated list of fields to sort by.                                                                          |
| `per_page`  | int    | Number of results per page (max 50; persons max 5).                                                                 |
| `page`      | int    | Page number (1-based).                                                                                              |

POST is recommended for complex queries. GET is convenient for quick lookups and search-as-you-type.

## Search by name

<Tabs>
  <Tab title="GET">
    ```bash theme={null}
    curl -H "x-api-key: YOUR_API_KEY" \
      "https://lens-api.tic.io/search-public/companies?q=Volvo&query_by=names.nameOrIdentifier"
    ```
  </Tab>

  <Tab title="POST">
    ```bash theme={null}
    curl -X POST "https://lens-api.tic.io/search-public/companies" \
      -H "x-api-key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "q": "Volvo",
        "query_by": "names.nameOrIdentifier",
        "per_page": 10,
        "page": 1
      }'
    ```
  </Tab>
</Tabs>

## Search by registration number

<Tabs>
  <Tab title="GET">
    ```bash theme={null}
    curl -H "x-api-key: YOUR_API_KEY" \
      "https://lens-api.tic.io/search-public/companies?q=5565199493&query_by=registrationNumber"
    ```
  </Tab>

  <Tab title="POST">
    ```bash theme={null}
    curl -X POST "https://lens-api.tic.io/search-public/companies" \
      -H "x-api-key: YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "q": "5565199493",
        "query_by": "registrationNumber",
        "per_page": 5,
        "page": 1
      }'
    ```
  </Tab>
</Tabs>

## Search by phone number (E.164)

```bash theme={null}
curl -H "x-api-key: YOUR_API_KEY" \
  "https://lens-api.tic.io/search-public/companies?q=+46850565800&query_by=phoneNumbers.e164PhoneNumber"
```

## Geo-search within a radius

```bash theme={null}
curl -H "x-api-key: YOUR_API_KEY" \
  "https://lens-api.tic.io/search-public/companies?q=*&query_by=mostRecentRegisteredAddress.streetAddress&filter_by=mostRecentRegisteredAddress.location:(57.6799,12.09162,0.300 km)&sort_by=mostRecentRegisteredAddress.location(57.6799,12.09162):asc"
```

Read more in the [Typesense geo-search docs](https://typesense.org/docs/29.0/api/geosearch.html).

## Filter by companyId

```bash theme={null}
curl -H "x-api-key: YOUR_API_KEY" \
  "https://lens-api.tic.io/search-public/companies?q=*&query_by=registrationNumber&filter_by=companyId:[3508351]"
```

## Search by SNI industry code

```bash theme={null}
curl -H "x-api-key: YOUR_API_KEY" \
  "https://lens-api.tic.io/search-public/companies?q=45111&query_by=sniCodes.sni_2007Code"
```

## Stock-listed companies

```bash theme={null}
curl -H "x-api-key: YOUR_API_KEY" \
  "https://lens-api.tic.io/search-public/companies?q=OMX+Stockholm&query_by=stock.marketExchangeName"
```

## Intelligence records

```bash theme={null}
curl -H "x-api-key: YOUR_API_KEY" \
  "https://lens-api.tic.io/search-public/companies?q=*&query_by=registrationNumber&filter_by=intelligence.companyIntelligenceSubType:['MISSING_AUDITOR']%26%26intelligence.score:>254"
```

## POST with complex filters

POST lets you send structured search requests in JSON with complex filter expressions:

```bash theme={null}
curl -X POST "https://lens-api.tic.io/search-public/companies" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "q": "*",
    "query_by": "registrationNumber",
    "filter_by": "mostRecentFinancialSummary.fn_NumberOfEmployees:>100 && mostRecentRegisteredAddress.city:Stockholm",
    "sort_by": "mostRecentFinancialSummary.rs_NetSalesK:desc",
    "per_page": 20,
    "page": 1
  }'
```

## Pro tier filtering

On the **Pro** plan, company search automatically excludes certain legal entity types and ceased companies. **Max** and **Enterprise** plans have unfiltered access to all records.

## Redacted properties

Depending on your plan, certain properties may be excluded from search results. The response includes a `redacted` array listing the omitted fields:

```json theme={null}
{
  "redacted": ["mostRecentDebtorSummary", "currentBeneficialOwners"]
}
```

## Date handling

All date fields are in **Unix epoch seconds** (seconds since 1970-01-01 00:00:00 UTC). Companies registered before 1970 will have negative values. Typesense only supports Unix timestamps.

## SNI codes — 2007 and 2025

Since December 2024, Statistics Sweden (SCB) has been migrating from SNI 2007 to SNI 2025. We recommend searching on both `sniCodes.sni_2007Code` and `sniCodes.sni_2025Code` during the transition. Search results include both code systems.

## Intelligence types

Intelligence records flag discrepancies found in company data. Each record has a `score` between `0` (informational) and `255` (severe).

When filtering by `intelligence.companyIntelligenceType`, use the numeric value:

| Value | Type                           | Description                               |
| ----- | ------------------------------ | ----------------------------------------- |
| 0     | `CreatedAsShelfCompany`        | Company was created as a shelf company    |
| 1     | `SuspectedForQuickLiquidation` | Suspected quick liquidation               |
| 3     | `AffiliatedWithArticle`        | Affiliated with one or more articles      |
| 5     | `SuspectedAddress`             | Address has been flagged                  |
| 7     | `PresentOnWarningList`         | Present on certain warning lists          |
| 8     | `AnnualReportDiscrepancies`    | Annual report contains discrepancies      |
| 9     | `AuditorResignation`           | Auditor has resigned                      |
| 10    | `Registration`                 | Issues with registration                  |
| 11    | `RegisterChanges`              | Registry change triggered a policy        |
| 12    | `PenaltyFees`                  | Penalized by a fee                        |
| 13    | `BeneficialOwner`              | Issues with beneficial owner registration |
| 14    | `Claims`                       | Claims from government agencies           |

## Intelligence subtypes

Filter by `intelligence.companyIntelligenceSubType` using the string value:

| Subtype                     | Description                                  |
| --------------------------- | -------------------------------------------- |
| `BS_MISMATCH`               | Balance sheet doesn't balance                |
| `AGM_TO_LATE`               | Annual general meeting held too late         |
| `AR_TO_LATE`                | Annual report submitted too late             |
| `MISSING_AUDITOR`           | Missing required auditor                     |
| `LIQUIDATION_REQUIRED`      | Subject to liquidation requirements          |
| `F_TAX_REVOKED`             | F-tax registration revoked                   |
| `AUDITOR_DISCOURGES`        | Auditor discourages the balance/result sheet |
| `AUDITOR_ACCOUNTING_ISSUES` | Auditor mentions accounting issues           |
| `AUDITOR_EARLY_RESIGNATION` | Auditor made an early resignation            |
| `NEGATIVE_SHARECAPITAL`     | Negative share capital in balance sheet      |
| `FORBIDDEN_LOAN`            | Management report mentions a forbidden loan  |

See the full list of subtypes in the API reference.

## Category fields

Fields starting with `c` (e.g. `cTurnoverInterval`, `cNbrEmployeesInterval`) are statistical category fields compiled weekly by Statistics Sweden across all legal entity types. Each contains:

* `categoryCode` — numeric code
* `categoryCodeDescription` — human-readable description

These are useful for filtering across company types that don't submit annual reports.
