# Search & Autocomplete

Ermöglicht eine schrittweise Suche nach einzelnen Elementen (z. B. Name, Strasse) mit der Möglichkeit, die Suchergebnisse sukzessive zu verfeinern.

## Authentifizierung mit API-Key

&#x20;Für den Zugriff auf die API wird ein API-Key benötigt.

* Der API-Key wird nach erfolgreichem [Onboarding](https://www.multisource.ch/autocomplete-start) von uns bereitgestellt.
* Der API-Key muss bei jedem Request im Header übermittelt werden.

Beispiel:&#x20;

<pre class="language-http" data-overflow="wrap"><code class="lang-http"><strong>curl 'https://api.multisource.ch/v2/Search/AutoComplete?source=business&#x26;value=swisscom+directories' \
</strong>  --header 'Auth-Key: &#x3C;API-KEY>'
</code></pre>

## API-Endpoint

## GET /Search/AutoComplete

>

```json
{"openapi":"3.0.1","info":{"title":"multisource•api","version":"v2"},"tags":[{"name":"Search"}],"servers":[{"url":"https://api.multisource.ch/v2","description":"Production - v2"}],"security":[{"auth-key":[]}],"components":{"securitySchemes":{"auth-key":{"type":"apiKey","description":"API Key required for authorized endpoints.","name":"auth-key","in":"header"}},"schemas":{"SearchOutputOfListOfOutputAddress":{"type":"object","properties":{"hitCount":{"type":"integer","format":"int32"},"resultCount":{"type":"integer","format":"int32"},"data":{"type":"array","items":{"$ref":"#/components/schemas/OutputAddress"}}}},"OutputAddress":{"type":"object","properties":{"companyname":{"type":"string","nullable":true},"firstname":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"street":{"type":"string","nullable":true},"houseNumber":{"type":"string","nullable":true},"zip":{"type":"string","nullable":true},"location":{"type":"string","nullable":true}}}}},"paths":{"/Search/AutoComplete":{"get":{"tags":["Search"],"parameters":[{"name":"source","in":"query","required":true,"schema":{"type":"string"}},{"name":"value","in":"query","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","description":"Optional.","schema":{"enum":["0 = Exact","1 = Like","2 = Phonetic","3 = PhoneticLike"],"type":"string","description":"**Allowed values:**\n- `0` = `Exact`\n- `1` = `Like`\n- `2` = `Phonetic`\n- `3` = `PhoneticLike`","default":1}}],"responses":{"200":{"description":"OK","content":{"text/plain":{"schema":{"$ref":"#/components/schemas/SearchOutputOfListOfOutputAddress"}},"application/json":{"schema":{"$ref":"#/components/schemas/SearchOutputOfListOfOutputAddress"}},"text/json":{"schema":{"$ref":"#/components/schemas/SearchOutputOfListOfOutputAddress"}}}}}}}}}
```

## Parameter

<table><thead><tr><th width="129.51953125">Parameter</th><th width="110.125">Typ</th><th width="499.890625">Beschreibung</th><th>Beispiel</th></tr></thead><tbody><tr><td><code>source</code></td><td>string</td><td><p>Datenquelle:</p><ul><li><code>consumer</code> (Privatpersonen)</li><li><code>business</code> (Firmen)</li><li><code>geo</code> (Adressen)</li><li>Mehrere Quellen kommagetrennt kombinierbar:<br><code>consumer,business</code></li></ul></td><td><code>consumer,business</code></td></tr><tr><td><code>value</code></td><td>string</td><td>Suchbegriff oder Suchphrase – Kombinationen aus Name, Ort, Strasse möglich.</td><td><code>Lara Graf Zürich</code></td></tr></tbody></table>

## Response Felder

### Root-Level Felder

<table><thead><tr><th width="145">Feld</th><th width="88">Typ</th><th width="290">Beschreibung</th><th>Beispiel</th></tr></thead><tbody><tr><td><code>hitCount</code></td><td>integer</td><td>Gesamtanzahl der Treffer in der Datenbank für die angefragte Telefonnummer</td><td><code>1</code></td></tr><tr><td><code>resultCount</code></td><td>integer</td><td>Anzahl der tatsächlich zurückgegebenen Einträge im <code>data</code>-Array</td><td><code>1</code></td></tr><tr><td><code>data</code></td><td>array</td><td>Array mit den gefundenen Verzeichniseinträgen</td><td>siehe Eintragsfelder unten</td></tr></tbody></table>

### Ausgabe-Felder

<table><thead><tr><th width="145">Feld</th><th width="88">Typ</th><th width="290">Beschreibung</th><th>Beispiel</th></tr></thead><tbody><tr><td><code>companyname</code></td><td>string</td><td>Firmenname bei Unternehmenseinträgen</td><td><code>Swisscom Directories AG</code></td></tr><tr><td><code>firstname</code></td><td>string</td><td>Vorname bei Privatpersonen</td><td><code>Lara</code></td></tr><tr><td><code>name</code></td><td>string</td><td>Nachname bei Privatpersonen</td><td><code>Graf</code></td></tr><tr><td><code>street</code></td><td>string</td><td>Strassenname</td><td><code>Förrlibuckstrasse</code></td></tr><tr><td><code>houseNumber</code></td><td>string</td><td>Hausnummer</td><td><code>62</code></td></tr><tr><td><code>zip</code></td><td>string</td><td>Postleitzahl (PLZ)</td><td><code>8005</code></td></tr><tr><td><code>location</code></td><td>string</td><td>Ortsname</td><td><code>Zürich</code></td></tr><tr><td><code>category</code></td><td>string</td><td><p>Kategorie / Branche</p><p>(mehrsprachig: DE, FR, IT, EN)</p></td><td><p><code>"de": "Pizzakurier",</code></p><p><code>"en": "Pizza delivery",</code></p><p><code>"it": "Pizza consegne a domicilio",</code></p><p><code>"fr": Pizza livraison à domicile"</code></p></td></tr><tr><td><code>email</code></td><td>string</td><td>E-Mail</td><td><code>info@abc.com</code></td></tr><tr><td><code>url</code></td><td>string</td><td>Website</td><td><code>www.multisource.ch</code></td></tr><tr><td><code>phoneNumbers</code></td><td>array</td><td>Array mit einer oder mehreren Festnetznummern</td><td><p><code>[</code></p><p><code>“*0800 123 456",</code></p><p><code>"*058 123 45 67"</code></p><p><code>]</code> </p></td></tr><tr><td><code>mobileNumbers</code></td><td>array</td><td>Array mit einer oder mehreren Mobilnummern</td><td><p><code>[</code></p><p><code>“*079  123 45 67"</code></p><p><code>]</code></p></td></tr></tbody></table>

## Metrics & Usage

**Ihre Nutzung im Blick** Mit dem Endpoint `metrics/usage` können Sie jederzeit Ihre Anzahl Requests und zurückgelieferte Datensätze für dieses Modul abrufen – aufgeschlüsselt nach Zeitraum. [**Mehr erfahren**](/multisource-api/integration/metrics-and-usage.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://multisource.gitbook.io/multisource-api/integration/search-and-autocomplete.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
