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

Create, delete, and list your Engines.

Engines created using the API are created as API-based Engines:

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.

Language List

For more information on languages see language optimization.

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

List the Engines that you have created.

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.

A HTTP 400 error 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": "french-book-store",
    "slug": "french-book-store",
    "language": "fr",
    "key": "JHpTKzqozsps3fq9dcRs",
    "id": "52843c9a2ed96076f600000b",
    "_id": "52843c9a2ed96076f600000b",
    "updated_at": "2013-11-14T02:59:38Z",
    "document_count": 0
}

Destroy an Engine

Be careful! Destruction is permanent.

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. Find the slug within your dashboard or query 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 or check out the Site Search community forum!