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

> Search Swedish workplaces (arbetsställen) by name, SNI code, location, employee count, and more.

With our search for workplaces you can search for business workplaces by street, city, postalcode, area (municipality, county), name,
number of employees and it will deliver millions of records instantly. A workplace is a physical location were the business operate and
each business could operate one or many workplaces. Each workplace has it's own metadata and contains rich information about the
operation at the location.

We provide an easy to use search API based on [Typesense](https://typesense.org) lightning-fast search database.
That means that all features described in [Typesense API version 29](https://typesense.org/docs/29.0/api/) is available in our API.
Data is continuously reindexed as new data arrives.

We today provide six rich search collections:

* **Workplaces search (you are here)**
* [Company search](/search)
* [Financial reports search](/datasets/search-reports-se)
* [Bankruptcies](/datasets/search-bankruptcies-se)
* [Vehicles](/datasets/search-vehicles)
* [Properties](/datasets/search-properties-se)

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

The response model (schema) depends on your query and if you use faceting. If you
do plain search we have added to our OpenAPI Schema the default response
model.

<Card title="OpenAPI Schema" icon="link" href="https://api.tic.io/docs/v1/swagger.json">
  Look for the model name TypesenseCompanyWorkplaceDocument in the schema
  definition.
</Card>

## 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 local region workspace identifier, e.g in Sweden CFAR                                        |
| 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 (Swedish: arbetsställe) |
| workplaceUnits.unitIdentifier              | Int32    | The identifier for the unit (Swedish: arbetsställenummer)                                        |
| 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 (Swedish) of the workplace                                           |
| employeesRangeType                         | Int32    | The range of number of employees (interval)                                                      |
| employeesRangeTypeDescriptionSv            | String   | The description of the range (Swedish)                                                           |
| 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 (Swedish: kommunkod 4 chars)                                               |
| mostRecentVistingAddress.countyCode        | String   | The county code (Swedish: länskod 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 (Swedish: kommunkod 4 chars)                                               |
| mostRecentMailingAddress.countyCode        | String   | The county code (Swedish: länskod 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 https://api.tic.io/search/company-workplaces/?q=bahnhof&query_by=workplaceCompanies.mostRecentName&key=your_api_key
{
	"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 https://api.tic.io/search/company-workplaces/?q=*&query_by=*&filter_by=mostRecentVistingAddress.city:='Stockholm'&&mostRecentVistingAddress.street:='Tunnelgatan'&key=your_api_key
{
    "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 https://api.tic.io/search/company-workplaces/?q=*&query_by=*&filter_by=employeesRangeType:>=15&key=your_api_key
{
    "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 https://api.tic.io//search/company-workplaces/?q=*&query_by=*&filter_by=mostRecentVistingAddress.countyCode:='01'&key=your_api_key
{
    "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"
                },...
```
