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. Most sites will have a single Engine. But you can have many! This endpoint will help you 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 ingest documents. For more information on Engine types, give the API Overview a read.

The following functionality is available:

List Engines

You can list the Engines that you have created. You can list one Engine by using its name or slug, or list all of your Engines.

per_page
optional
The number of results per page. Defaults to 50.
page
optional
The page to fetch. Defaults to 1.
GET /api/v1/engines.json
GET /api/v1/engines/bookstore.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
    }
]
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
    }
]

Create Engines

Engines created in this way are created as API-based Engines and not Crawler-based Engines. To see the difference, check out the API Overview. 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
The name of your Engine. You can find this within your dashboard.
POST /api/v1/engines.json
Example - Create an Engine 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",
    "key": "JHpTKzqozsps3fq9dcRs",
    "id": "52843c9a2ed96076f600000b",
    "_id": "52843c9a2ed96076f600000b",
    "updated_at": "2013-11-14T02:59:38Z",
    "document_count": 0
}

Destroy Engines

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.

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'