Integrate Using APIs

Site Search has the following RESTful APIs:

Endpoint Verb API key Use

path/api/v1/push

POST

Push API key

Post documents to a Push Endpoint data source.

path/api/v1/push/id

DELETE

Push API key

Remove index entries from a Push Endpoint data source for previously indexed documents.

path/api/v1/search

GET

Search API key

Search.

path/api/v1/suggest

GET

Search API key

Suggest query completions.

Any app that can make HTTP requests can use the APIs, if it has a valid API key.

In the API examples, we use curl to send the HTTP requests. The default verb for curl is GET. It is omitted from the examples that use GET.

HTTP responses from Site Search can be so long that they exceed the command-length limits of shells (in which case the shells truncate the output). During app development and testing, you might want to write HTTP responses to files.

Note
Integration with websites and web apps is also possible using Site Search modules. For more information, see Integrate Using Modules.

Manage API keys

An app must include a valid Search API key or Push API key (depending on the nature of the request) in an X-API-Key header in the HTTP request.

Manage API keys in the Site Search app:

  • Push API keys – In the Admin UI menu, select a Push Endpoint data source to manage Push API keys for that data source. Push API keys are specific to data sources (each data source can have one or more Push API keys).

    Use Push API keys for the push endpoint (path/api/v1/push).

  • Search API keys – In the Admin UI menu, click Search APIss.

    Use Search API keys for the search endpoint (path/api/v1/search and the suggest endpoint (path/api/v1/suggest).

    Tip
    For a specific Site Search app, you can use a single Search API key for all search apps that use Search API calls, or use multiple keys, for example, one per search app. Using multiple keys lets you turn off searches for a specific specific app by revoking that app’s Search API key. The same is true of the other API keys.

API development workflow

If you use Site Search APIs to develop a search app, the basic workflow is similar to the workflow when using embedded modules to develop an app, but instead of embedding modules you will write code that calls Site Search APIs.

Some tuning of search results in the Admin UI affects the results that users obtain through the Site Search APIs; specifically topics, synonyms, blocked documents, and promoted documents.