> ## 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.

# Workplace search fields and examples

> Fields and examples for the workplaces search collection behind /search-public/workplaces.

<Badge color="purple" size="sm">Max+ tier</Badge>

These are the fields of the `workplaces` search collection behind `/search-public/workplaces` ([GET](/api-lens/publicsearch/search-workplaces-get), [POST](/api-lens/publicsearch/search-workplaces-post)). Use them in `query_by`, `filter_by` and `sort_by`. The parameters, plan limits, Pro tier filtering, redacted properties and date handling that apply to every collection are described in [Search](/api-lens/search), and the response schema on the endpoint pages.

Field guides for the other collections:

* [Companies](/api-lens/publicsearch/company-search-fields)
* **Workplaces (you are here)**
* [Financial reports](/api-lens/publicsearch/report-search-fields)
* [Bankruptcies](/api-lens/publicsearch/bankruptcy-search-fields)
* [Vehicles](/api-lens/publicsearch/vehicle-search-fields)
* [Properties](/api-lens/publicsearch/property-search-fields)

## Workplaces search

With our search for workplaces you can query (query\_by) based on a number fields listed in the next chapter.

Examples on what you can query on:

* Name of the workplace
* Street, postalcode, city, municipality code, county code and much more
* Companies that has ownership over the workplace
* Industry codes relating to the workplace

## Fields indexed

The following fields are currently indexed in memory. These can be used in the query\_by and filter\_by parameter.

| Field | Type | Description |
| - | - | - |
| companyWorkplaceId | Int32 | Our global internal workspace identifier |
| workplaceCode | Int32 | The workplace identifier in the local business register |
| workplaceCompanies.companyId | Int32 | Our global internal company identifier |
| workplaceCompanies.fromDate | Int64 | If the workplace has been moved to company this will contain the Unix from time (epoch) |
| workplaceCompanies.toDate | Int64 | If the workplace is longer present on the company this will contain the Unix to time (epoch) |
| workplaceCompanies.registrationNumber | String | The registrationnumber of the business |
| workplaceCompanies.mostRecentName | String | The most recent legalname for the business |
| workplaceCompanies.legalEntityType | String | The legal entity type of the business |
| workplaceCompanies.localCompanyCode | String | The local market abbreviated code |
| workplaceCompanies.elfCode | String | The ISO Entity Legal Form code (ELF) |
| workplaceCompanies.registrationDate | String | The registration date (epoch) of the business |
| workplaceCompanies.ceasedDate | Int64 | The business has ceased operation (epoch) |
| workplaceCompanies.isCeased | Bool | Flag to indicate the business have ceased operation |
| workplaceUnits.companyId | Int32 | Each workplace can contain one or multiple sub-units owned by businesses |
| workplaceUnits.unitIdentifier | Int32 | The identifier for the unit |
| workplaceUnits.firstSeenAt | Int64 | The timestamp when we located the unit (epoch) |
| workplaceUnits.lastSeenAt | Int64 | The timestamp when we located that the unit has disappeared (epoch) |
| workplaceType | Int32 | The type of the workplace |
| workplaceTypeDescriptionSv | String | The description of the type of the workplace, in the local language |
| employeesRangeType | Int32 | The range of number of employees (interval) |
| employeesRangeTypeDescriptionSv | String | The description of the range, in the local language |
| mostRecentVistingAddress.co | String | C/O of the visiting address |
| mostRecentVistingAddress.streetAddress | String | The full street address of the visting address |
| mostRecentVistingAddress.street | String | Street name of the visiting address |
| mostRecentVistingAddress.houseNumber | String | House number of the visting address |
| mostRecentVistingAddress.houseLetter | String | House letter of the visiting address |
| mostRecentVistingAddress.postalCode | String | Postal code of the visting address |
| mostRecentVistingAddress.city | String | City of the visting address |
| mostRecentVistingAddress.countryCodeAlpha3 | String | Country code (alpha 3) of the visting address |
| mostRecentVistingAddress.municipalityCode | String | The municipality code (4 chars) |
| mostRecentVistingAddress.countyCode | String | The county code (2 chars) |
| mostRecentVistingAddress.nyko | String | The subdivision code of the municipality |
| mostRecentVistingAddress.nykoYear | String | The origin year of the subdivision code |
| mostRecentVistingAddress.location | GeoPoint | The latitude and longitude of the address |
| mostRecentVistingAddress.firstSeenAt | String | The timestamp when we located the visting address (epoch) |
| mostRecentMailingAddress.co | String | C/O of the mailing address |
| mostRecentMailingAddress.streetAddress | String | The full street address of the mailing address |
| mostRecentMailingAddress.street | String | Street name of the mailing address |
| mostRecentMailingAddress.houseNumber | String | House number of the mailing address |
| mostRecentMailingAddress.houseLetter | String | House letter of the mailing address |
| mostRecentMailingAddress.postalCode | String | Postal code of the mailing address |
| mostRecentMailingAddress.city | String | City of the mailing address |
| mostRecentMailingAddress.countryCodeAlpha3 | String | Country code (alpha 3) of the visting address |
| mostRecentMailingAddress.municipalityCode | String | The municipality code (4 chars) |
| mostRecentMailingAddress.countyCode | String | The county code (2 chars) |
| mostRecentMailingAddress.nyko | String | The subdivision code of the municipality |
| mostRecentMailingAddress.nykoYear | String | The origin year of the subdivision code |
| mostRecentMailingAddress.location | GeoPoint | The latitude and longitude of the address |
| mostRecentMailingAddress.firstSeenAt | String | The timestamp when we located the mailing address (epoch) |
| sniCodes.firstSeenAt | String | The timestamp when we located the industry code (epoch) |
| sniCodes.sni\_2007Name | String | The industry code of the workplace based on SNI 2007 |
| sniCodes.sni\_2007Code | String | The name/description of the industry cod |
| sniCodes.rank | String | The rank (sequence number) |
| status.statusType | String | The status of the workplace |
| status.statusDescription | String | The description of the status of the workplace |
| status.statusDate | String | The date of the status (if it exists) |

## Examples

We have put together a few example of how you can use search for workplaces to easy find data.

### Search for workplaces based on a freetext business name

Shows an example searching for workplaces controlled by the freetext business name, Bahnhof.

```bash cURL theme={null}
curl -H "x-api-key: YOUR_API_KEY" \
  "https://lens-api.tic.io/search-public/workplaces?q=bahnhof&query_by=workplaceCompanies.mostRecentName"
{
	"facet_counts": [],
	"found": 16,
	"hits": [
		{
			"document": {
				"companyWorkplaceId": 805670,
				"employeesRangeType": 4,
				"employeesRangeTypeDescriptionSv": "10-19 anställda",
				"id": "805670",
				"mostRecentMailingAddress": {
					"city": "Malmö",
					"firstSeenAt": 1726790400,
					"houseLetter": "B",
					"houseNumber": "15",
					"location": [
						55.6001,
						13.003
					],
					"postalCode": "21141",
					"street": "Storgatan",
					"streetAddress": "Storgatan 15 B"
				},
				"mostRecentVistingAddress": {
					"city": "Malmö",
					"countyCode": "12",
					"firstSeenAt": 1726790400,
					"houseLetter": "B",
					"houseNumber": "15",
					"location": [
						55.6001,
						13.003
					],
					"municipalityCode": "1280",
					"nyko": "130110",
					"nykoYear": 2023,
					"postalCode": "21141",
					"street": "Storgatan",
					"streetAddress": "Storgatan 15 B"
				},
				"sniCodes": [
					{
						"rank": 1,
						"sni_2007Code": "63110",
						"sni_2007Name": "Databehandling, hosting o.d."
					}
				],
				"status": [
					{
						"statusDate": 1415318400,
						"statusDescription": "Workplace is active",
						"statusType": "isActive"
					}
				],
				"workplaceCode": 55205868,
				"workplaceCompanies": [
					{
						"companyId": 1893055,
						"elfCode": "XJHM",
						"isCeased": false,
						"legalEntityType": "Aktiebolag",
						"localCompanyCode": "AB",
						"mostRecentName": "Bahnhof AB (publ)",
						"registrationDate": 805680000,
						"registrationNumber": "5565199493"
					}
				],
				"workplaceName": [
					{
						"firstSeenAt": 1726790400,
						"nameOrIdentifier": "SPARVEN 15"
					}
				],
				"workplaceType": 2,
				"workplaceTypeDescriptionSv": "Representerar ej JE",
				"workplaceUnits": [
					{
						"companyId": 1893055,
						"firstSeenAt": 1734364731,
						"unitIdentifier": 9
					}
				]
			},
			"highlight": {
				"workplaceCompanies": [
					{
						"mostRecentName": {
							"matched_tokens": [
								"Bahnhof"
							],
							"snippet": "<mark>Bahnhof</mark> AB (publ)"
						}
					}
				]
			},
			"highlights": [],
			"text_match": 578730123365187705,
			"text_match_info": {
				"best_field_score": "1108091338752",
				"best_field_weight": 15,
				"fields_matched": 1,
				"num_tokens_dropped": 0,
				"score": "578730123365187705",
				"tokens_matched": 1,
				"typo_prefix_score": 0
			}
		},
	],
	"out_of": 1962201,
	"page": 1,
	"request_params": {
		"collection_name": "workplaces_20241228165159",
		"first_q": "bahnhof",
		"per_page": 10,
		"q": "bahnhof"
	},
	"search_cutoff": false,
	"search_time_ms": 1
}
```

### Search for workplaces on a specific street and city

You can search virtually on anything, here is an example search for all workplaces on the specific street, Tunnelgatan, in the city Stockholm.

```bash cURL theme={null}
curl -H "x-api-key: YOUR_API_KEY" \
  "https://lens-api.tic.io/search-public/workplaces?q=*&query_by=*&filter_by=mostRecentVistingAddress.city:='Stockholm'&&mostRecentVistingAddress.street:='Tunnelgatan'"
{
    "facet_counts": [],
    "found": 12,
    "hits": [
        {
            "document": {
                "companyWorkplaceId": 1779625,
                "employeesRangeType": 1,
                "employeesRangeTypeDescriptionSv": "0 anställda",
                "id": "1779625",
                "mostRecentMailingAddress": {
                  ...
```

### Search for workplaces with 5000 or more employees

You can also search for workplaces based on number of employees.

```bash cURL theme={null}
curl -H "x-api-key: YOUR_API_KEY" \
  "https://lens-api.tic.io/search-public/workplaces?q=*&query_by=*&filter_by=employeesRangeType:>=15"
{
    "facet_counts": [],
    "found": 20,
    "hits": [
        {
            "document": {
                "companyWorkplaceId": 369656,
                "employeesRangeType": 15,
                "employeesRangeTypeDescriptionSv": "5000-9999 anställda",
                ...
```

### Search for all workplaces in a county

Search for all workplaces in a county is simple.

```bash cURL theme={null}
curl -H "x-api-key: YOUR_API_KEY" \
  "https://lens-api.tic.io/search-public/workplaces?q=*&query_by=*&filter_by=mostRecentVistingAddress.countyCode:='01'"
{
    "facet_counts": [],
    "found": 504707,
    "hits": [
        {
            "document": {
                "companyWorkplaceId": 1940000,
                "employeesRangeType": 1,
                "employeesRangeTypeDescriptionSv": "0 anställda",
                "id": "1940000",
                "mostRecentMailingAddress": {
                    "city": "Sigtuna",
                    "firstSeenAt": 1728864000,
                    "houseNumber": "8",
                    "location": [
                        59.61802,
                        17.71584
                    ],
                    "postalCode": "19332",
                    "street": "Tunvägen",
                    "streetAddress": "Tunvägen 8"
                },...
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.