search mobile facets autocomplete spellcheck crawler rankings weights synonyms analytics engage api customize documentation install setup technology content domains user history info home business cart chart contact email activate analyticsalt analytics autocomplete cart contact content crawling custom documentation domains email engage faceted history info install mobile person querybuilder search setup spellcheck synonyms weights engage_search_term engage_related_content engage_next_results engage_personalized_results engage_recent_results success add arrow-down arrow-left arrow-right arrow-up caret-down caret-left caret-right caret-up check close content conversions-small conversions details edit grid help small-info error live magento minus move photo pin plus preview refresh search settings small-home stat subtract text trash unpin wordpress x alert case_deflection advanced-permissions keyword-detection predictive-ai sso

Engines

Engines are the top-level container for the objects that you wish to search. This account level endpoint can create, delete, and list your Engines.

Engines created using the API are created as API based Engines. You will not be able to run Crawler Operations upon them and you must use the Document Indexing endpoint in order to index documents.

Read more about Crawler based Engines and API based Engines within the API Overview.

The following instructions available within this reference:

Engine Type Supported?
Crawler based Engine YES
API based Engine YES

Read more about Crawler based Engines and API based Engines within the API Overview.

Multi-Language Support

Each Engine can be given a language. The default value is Universal. It is well optimized for general or multi-language use cases. The Universal language type will return null. The other languages will return their respective Language Code. The codes adhere to a subset of the IETF RFC 5646, which coincide with ISO 639-1 and ISO 3166-1.

LanguageLanguage Code, ISO 639-1 and ISO 3166-1.
"Brazilian Portuguese"pt-br
“Chinese"zh
"Danish""da
“Dutch"nl
“English"en
"French"fr
“German"de
"Italian"it
"Japanese"ja
"Koreanko
“Portuguese"pt
“Russian"ru
“Spanish"es
“Thai"th
"Universal"null

List Engines

You can list the Engines that you have created. You can list one Engine or list all Engines.

per_page
optional
The number of results per page. Defaults to 50.
page
optional
The page to fetch. Defaults to 1.

List an Engine

GET /api/v1/engines/bookstore.json
Example - Get an Engine called bookstore.
curl -X GET 'https://api.swiftype.com/api/v1/engines/bookstore.json?auth_token=YOUR_API_KEY'
[
    {
        "name": "bookstore",
        "slug": "bookstore",
        "key": "7DHxRvRLzWYWvsmzsGus",
        "id": "253b7f582ed960a803000001",
        "_id": "253b7f582ed960a803000001",
        "updated_at": "2015-09-19T22:51:53Z",
        "document_count": 56
    }
]

List all Engines

GET /api/v1/engines.json
Example - List every Engine in your account.
curl -X GET 'https://api.swiftype.com/api/v1/engines.json?auth_token=YOUR_API_KEY'
[
    {
        "name": "Example Engine 1",
        "slug": "example-engine-1",
        "key": "7HDxRvRLzWYWvsmzsGus",
        "id": "523b7f582ed960a803000001",
        "_id": "523b7f582ed960a803000001",
        "updated_at": "2013-09-19T22:51:53Z",
        "document_count": 56
    },
    {
        "name": "Example Engine 2",
        "slug": "example-engine-2",
        "key": "gq2QknfBiv9bd11TZAdq",
        "id": "52420fbd2ed960178b000004",
        "_id": "52420fbd2ed960178b000004",
        "updated_at": "2013-09-25T02:18:43Z",
        "document_count": 130
    },
    {
        "name": "Example Engine 3",
        "slug": "example-engine-3",
        "key": "vABWdVfHeFZSxgEJwgVF",
        "id": "15c1fcbd2ed960d45200000c",
        "_id": "15c1fcbd2ed960d45200000c",
        "updated_at": "2015-09-19T23:03:26Z",
        "document_count": 2
    }
]

Create Engines

Create an API based Engine. Defaults to Universal language if no language parameter is included. In the event of an error, a HTTP 400 will appear if the Engine is not valid: missing a name, has a non-unique name.

name
required
Provide a name for your Engine.
language
optional
Defaults to null, or Universal. Specify a code from the language list to optimize for the associated language.

Create Engine, Default Language

POST /api/v1/engines.json
Example - Create an Engine with the default Universal language setting called bookstore.
curl -X POST 'https://api.swiftype.com/api/v1/engines.json' \
-H 'Content-Type: application/json' \
-d '{
      "auth_token": "YOUR_API_KEY",
      "engine": {"name": "bookstore"}
    }'
{
    "name": "bookstore",
    "slug": "bookstore",
    "language": null,
    "key": "JHpTKzqozsps3fq9dcRs",
    "id": "52843c9a2ed96076f600000b",
    "_id": "52843c9a2ed96076f600000b",
    "updated_at": "2013-11-14T02:59:38Z",
    "document_count": 0
}

Create Engine, Language Optimized

Create a language optimized Engine. See the language list for supported languages.

POST /api/v1/engines.json
Example - Create an Engine with the default French language setting called french-book-store.
curl -X POST 'https://api.swiftype.com/api/v1/engines.json' \
-H 'Content-Type: application/json' \
-d '{
      "auth_token": "YOUR_API_KEY",
      "engine": {"name": "french-book-store", "language": "fr"}
    }'
{
    "name": "bookstore",
    "slug": "bookstore",
    "language": null,
    "key": "JHpTKzqozsps3fq9dcRs",
    "id": "52843c9a2ed96076f600000b",
    "_id": "52843c9a2ed96076f600000b",
    "updated_at": "2013-11-14T02:59:38Z",
    "document_count": 0
}

Destroy an Engine

Be careful! Destroying Engines is for good. Note that the :engine_id is the Site Search Engine ID or the Engine slug. The response will be HTTP 204 No Content if the request succeeds.

name
required
Your Engine Slug. You can find this within your dashboard or by querying the Engines endpoint.
DELETE /api/v1/engines/:engine_id.json
Example - Delete an Engine with the slug bookstore.
curl -X DELETE 'https://api.swiftype.com/api/v1/engines/bookstore?auth_token=YOUR_API_KEY'

Stuck? Looking for help? Contact Support!