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

Analytics

The Analytics end-point returns essential and valuable performance data about your search activity. You can learn about which search queries are being made against your engines, how often, whether those queries have generated clicks, the documents to which those clicks belong and much more. By applying filters, you have vast control over the type of responses your analytical queries will receive.

There are three different analytics end-points that you can make requests against: analytics/queries, analytics/clicks and analytics/counts.

  • queries are search attempts performed against your engine. View
  • clicks occur when someone clicks on the result of a query. View
  • counts indicate the total number of queries and clicks within a time-frame. View

Which one you choose will reveal how search queries in general perform (queries) or how well documents perform, relative to queries and other documents (clicks). If you want to see a cumulative total of your queries and clicks, you want to see your counts.

At this time pagination is not fully supported.

Queries

The analytics/queries end-point responds to GET and POST requests. The payload you receive will include meta-data and results. A result from the analytics/queries end-point will include: the query, the number of times it was performed and the amount of clicks it received. The results will be ranked by numbers of queries, then number of clicks, in descending order.

GET /api/as/v1/engines/{ENGINE_NAME}/analytics/queries
POST /api/as/v1/engines/{ENGINE_NAME}/analytics/queries
// An example JSON payload from the analytics/queries end-point.
{
  "meta": {
    "page": {
      "size": number,
      "current": number
    }
  },
  "results": [
    {
      "term": string,
      "clicks": number,
      "queries": number
    }
  ]
}

Top Queries

page/size
optional
Provide an integer to retrieve a specific number of top results.
View example.

By default, a GET or POST request against the analytics/queries end-point will return the top 10 queries over the past 7 days.

Example - A GET request with no addition parameters.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 9
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    },
    {
      "term": "grumpy cat",
      "clicks": 0,
      "queries": 2
    },
    {
      "term": "toyota toyota",
      "clicks": 9,
      "queries": 1
    },
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    },
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
    {
      "term": "toyota asdfasdf",
      "clicks": 2,
      "queries": 0
    }
  ],
  "meta": {
    "page": {
      "size": 8,
      "current": 1
    }
  }
}

Example - A GET request with no addition parameters.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 9
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    },
    {
      "term": "grumpy cat",
      "clicks": 0,
      "queries": 2
    },
    {
      "term": "toyota toyota",
      "clicks": 9,
      "queries": 1
    },
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    },
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
    {
      "term": "toyota asdfasdf",
      "clicks": 2,
      "queries": 0
    }
  ],
  "meta": {
    "page": {
      "size": 8,
      "current": 1
    }
  }
}

Example - A GET request with no addition parameters.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 9
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    },
    {
      "term": "grumpy cat",
      "clicks": 0,
      "queries": 2
    },
    {
      "term": "toyota toyota",
      "clicks": 9,
      "queries": 1
    },
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    },
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
    {
      "term": "toyota asdfasdf",
      "clicks": 2,
      "queries": 0
    }
  ],
  "meta": {
    "page": {
      "size": 8,
      "current": 1
    }
  }
}

Example - A GET request with no addition parameters.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 9
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    },
    {
      "term": "grumpy cat",
      "clicks": 0,
      "queries": 2
    },
    {
      "term": "toyota toyota",
      "clicks": 9,
      "queries": 1
    },
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    },
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
    {
      "term": "toyota asdfasdf",
      "clicks": 2,
      "queries": 0
    }
  ],
  "meta": {
    "page": {
      "size": 8,
      "current": 1
    }
  }
}

Example - A GET request with no addition parameters.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 9
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    },
    {
      "term": "grumpy cat",
      "clicks": 0,
      "queries": 2
    },
    {
      "term": "toyota toyota",
      "clicks": 9,
      "queries": 1
    },
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    },
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
    {
      "term": "toyota asdfasdf",
      "clicks": 2,
      "queries": 0
    }
  ],
  "meta": {
    "page": {
      "size": 8,
      "current": 1
    }
  }
}

Example - A GET request with no addition parameters.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 9
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    },
    {
      "term": "grumpy cat",
      "clicks": 0,
      "queries": 2
    },
    {
      "term": "toyota toyota",
      "clicks": 9,
      "queries": 1
    },
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    },
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
    {
      "term": "toyota asdfasdf",
      "clicks": 2,
      "queries": 0
    }
  ],
  "meta": {
    "page": {
      "size": 8,
      "current": 1
    }
  }
}

More Queries

If you would like to produce more top queries, you can add the page key with the size parameter.

Example - A GET request asking for 20 results using the page argument with the size option.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20
  }
}'
Example Response
{
  "results": [
    {
      ...
    }
  ],
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  }
}

Example - A GET request asking for 20 results using the page argument with the size option.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20
  }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      ...
    }
  ],
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  }
}

Example - A GET request asking for 20 results using the page argument with the size option.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20
  }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      ...
    }
  ],
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  }
}

Example - A GET request asking for 20 results using the page argument with the size option.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20
  }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      ...
    }
  ],
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  }
}

Example - A GET request asking for 20 results using the page argument with the size option.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20
  }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      ...
    }
  ],
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  }
}

Example - A GET request asking for 20 results using the page argument with the size option.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20
  }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      ...
    }
  ],
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  }
}

Queries Filtering

filters
optional
The filters key is the parent key. If no options are provided underneath it, the top 10 queries over the past 7 days are returned.
clicks
optional
A boolean, returns queries that have - or have not - received clicks. If true, returns queries with clicks. If false, returns queries without clicks.
View example.
results
optional
A boolean, returns queries that have - or have not - received results. If true, returns queries with results. If false, returns queries without results.
View example.
tag
optional
The Search end-point can be used to attach tags to your documents. One or more tags can be applied to filter results via the API or within your analytics dashboard.
View example.
date
optional
Specify a range of time. The from and to fields are optional and the expected format is RFC3339.
View example.
all
optional
Include multiple filters by nesting them under the all option.
View example.

Clicks

Example - A POST request with the clicks filter option. We want to see only queries that have been clicked.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "clicks": true }
}'
Example Response
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "toyota toyota",
      "clicks": 9,
      "queries": 1
    },
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
    {
      "term": "toyota asdfasdf",
      "clicks": 2,
      "queries": 0
    }
  ],
  "meta": {
    "page": {
      "size": 4,
      "current": 1
    }
  }
}

Example - A POST request with the clicks filter option. We want to see only queries that have been clicked.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "clicks": true }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "toyota toyota",
      "clicks": 9,
      "queries": 1
    },
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
    {
      "term": "toyota asdfasdf",
      "clicks": 2,
      "queries": 0
    }
  ],
  "meta": {
    "page": {
      "size": 4,
      "current": 1
    }
  }
}

Example - A POST request with the clicks filter option. We want to see only queries that have been clicked.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "clicks": true }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "toyota toyota",
      "clicks": 9,
      "queries": 1
    },
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
    {
      "term": "toyota asdfasdf",
      "clicks": 2,
      "queries": 0
    }
  ],
  "meta": {
    "page": {
      "size": 4,
      "current": 1
    }
  }
}

Example - A POST request with the clicks filter option. We want to see only queries that have been clicked.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "clicks": true }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "toyota toyota",
      "clicks": 9,
      "queries": 1
    },
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
    {
      "term": "toyota asdfasdf",
      "clicks": 2,
      "queries": 0
    }
  ],
  "meta": {
    "page": {
      "size": 4,
      "current": 1
    }
  }
}

Example - A POST request with the clicks filter option. We want to see only queries that have been clicked.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "clicks": true }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "toyota toyota",
      "clicks": 9,
      "queries": 1
    },
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
    {
      "term": "toyota asdfasdf",
      "clicks": 2,
      "queries": 0
    }
  ],
  "meta": {
    "page": {
      "size": 4,
      "current": 1
    }
  }
}

Example - A POST request with the clicks filter option. We want to see only queries that have been clicked.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "clicks": true }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "toyota toyota",
      "clicks": 9,
      "queries": 1
    },
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
    {
      "term": "toyota asdfasdf",
      "clicks": 2,
      "queries": 0
    }
  ],
  "meta": {
    "page": {
      "size": 4,
      "current": 1
    }
  }
}

Results

Example - A GET request with the results filter option. We want to see only queries that have not returned results.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "results": false }
}'
Example Response
{
  "results": [
    {
      "term": "toyota",
      "clicks": 0,
      "queries": 8
    },
    {
      "term": "grumpy cat",
      "clicks": 0,
      "queries": 2
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 1
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}

Example - A GET request with the results filter option. We want to see only queries that have not returned results.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "results": false }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 0,
      "queries": 8
    },
    {
      "term": "grumpy cat",
      "clicks": 0,
      "queries": 2
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 1
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}

Example - A GET request with the results filter option. We want to see only queries that have not returned results.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "results": false }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 0,
      "queries": 8
    },
    {
      "term": "grumpy cat",
      "clicks": 0,
      "queries": 2
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 1
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}

Example - A GET request with the results filter option. We want to see only queries that have not returned results.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "results": false }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 0,
      "queries": 8
    },
    {
      "term": "grumpy cat",
      "clicks": 0,
      "queries": 2
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 1
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}

Example - A GET request with the results filter option. We want to see only queries that have not returned results.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "results": false }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 0,
      "queries": 8
    },
    {
      "term": "grumpy cat",
      "clicks": 0,
      "queries": 2
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 1
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}

Example - A GET request with the results filter option. We want to see only queries that have not returned results.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "results": false }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 0,
      "queries": 8
    },
    {
      "term": "grumpy cat",
      "clicks": 0,
      "queries": 2
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 1
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}

Tag(s)

Single Tag
Example - A GET request with the tag filter option. We want to see how many queries documents with the web tag received. Tags can be added via the search end-point.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
{
  "results": [
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option. We want to see how many queries documents with the web tag received. Tags can be added via the search end-point.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option. We want to see how many queries documents with the web tag received. Tags can be added via the search end-point.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option. We want to see how many queries documents with the web tag received. Tags can be added via the search end-point.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option. We want to see how many queries documents with the web tag received. Tags can be added via the search end-point.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option. We want to see how many queries documents with the web tag received. Tags can be added via the search end-point.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Multiple Tags
Example - A GET request with the tag filter option and one tag. Tags can be added via the search end-point.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
{
  "results": [
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option and one tag. Tags can be added via the search end-point.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option and one tag. Tags can be added via the search end-point.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option and one tag. Tags can be added via the search end-point.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option and one tag. Tags can be added via the search end-point.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option and one tag. Tags can be added via the search end-point.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "term": "taco",
      "clicks": 2,
      "queries": 0
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Date

Example - A POST request with the date filters option. Expects results from the earlier date, to the later date.
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T12:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 9
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}

Example - A POST request with the date filters option. Expects results from the earlier date, to the later date.
No Java example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T12:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 9
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}

Example - A POST request with the date filters option. Expects results from the earlier date, to the later date.
No Node example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T12:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 9
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}

Example - A POST request with the date filters option. Expects results from the earlier date, to the later date.
No Ruby example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T12:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 9
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}

Example - A POST request with the date filters option. Expects results from the earlier date, to the later date.
No Python example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T12:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 9
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}

Example - A POST request with the date filters option. Expects results from the earlier date, to the later date.
No Javascript example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T12:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "term": "toyota",
      "clicks": 14,
      "queries": 49
    },
    {
      "term": "",
      "clicks": 0,
      "queries": 9
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}

Multiple Filters

Example - A GET request with the clicks and results filter options. We want to see queries that have results and that did not generate any clicks.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "clicks": false
      }, {
        "results": true
      }
    ]
  }
}'
Example Response
{
  "results": [
    {
      "term": "",
      "clicks": 0,
      "queries": 8
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    },
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}
➜

Example - A GET request with the clicks and results filter options. We want to see queries that have results and that did not generate any clicks.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "clicks": false
      }, {
        "results": true
      }
    ]
  }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "term": "",
      "clicks": 0,
      "queries": 8
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    },
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}
➜

Example - A GET request with the clicks and results filter options. We want to see queries that have results and that did not generate any clicks.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "clicks": false
      }, {
        "results": true
      }
    ]
  }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "term": "",
      "clicks": 0,
      "queries": 8
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    },
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}
➜

Example - A GET request with the clicks and results filter options. We want to see queries that have results and that did not generate any clicks.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "clicks": false
      }, {
        "results": true
      }
    ]
  }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "term": "",
      "clicks": 0,
      "queries": 8
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    },
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}
➜

Example - A GET request with the clicks and results filter options. We want to see queries that have results and that did not generate any clicks.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "clicks": false
      }, {
        "results": true
      }
    ]
  }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "term": "",
      "clicks": 0,
      "queries": 8
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    },
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}
➜

Example - A GET request with the clicks and results filter options. We want to see queries that have results and that did not generate any clicks.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "clicks": false
      }, {
        "results": true
      }
    ]
  }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "term": "",
      "clicks": 0,
      "queries": 8
    },
    {
      "term": "child safe",
      "clicks": 0,
      "queries": 3
    },
    {
      "term": "red",
      "clicks": 0,
      "queries": 1
    }
  ],
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  }
}
➜

Everything!

You can combine all of the different parameters to generate very specific, large or small, analytic result sets.

Example - A GET request that includes the page and filters arguments. All filters options are included.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "clicks": false
      }, {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "results": false
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  },
  "page": {
    "size": 20
  }
}'
Example Response
{
  "results": [
    {
      ...
    }
  ],
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  }
}

Example - A GET request that includes the page and filters arguments. All filters options are included.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "clicks": false
      }, {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "results": false
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  },
  "page": {
    "size": 20
  }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      ...
    }
  ],
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  }
}

Example - A GET request that includes the page and filters arguments. All filters options are included.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "clicks": false
      }, {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "results": false
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  },
  "page": {
    "size": 20
  }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      ...
    }
  ],
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  }
}

Example - A GET request that includes the page and filters arguments. All filters options are included.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "clicks": false
      }, {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "results": false
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  },
  "page": {
    "size": 20
  }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      ...
    }
  ],
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  }
}

Example - A GET request that includes the page and filters arguments. All filters options are included.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "clicks": false
      }, {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "results": false
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  },
  "page": {
    "size": 20
  }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      ...
    }
  ],
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  }
}

Example - A GET request that includes the page and filters arguments. All filters options are included.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/queries' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer private-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "clicks": false
      }, {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "results": false
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  },
  "page": {
    "size": 20
  }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      ...
    }
  ],
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  }
}

Clicks

The analytics/clicks end-point responds to GET and POST requests. The payload you receive will include meta-data and results. A result of the analytics/clicks end-point will include: the document, represented by its document_id and the amount of clicks it has received. The results, shown as document_id, will be ranked by number of clicks in descending order.

GET /api/as/v1/engines/{ENGINE_NAME}/analytics/clicks
POST /api/as/v1/engines/{ENGINE_NAME}/analytics/clicks
// An example JSON payload from the analytics/queries end-point.
{
  "results": [
    {
      "document_id": string,
      "clicks": number
    }
  ],
  "meta": {
    "page": {
      "size": number,
      "current": number
    }
  }
}

Top Clicks

page/size
optional
Provide an integer to retrieve a specific number of results.
View example.

By default, a GET or POST request against the analytics/clicks end-point will return the 10 most clicked results over the past 7 days.

Example - A GET request with no addition parameters.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
{
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "163",
      "clicks": 2
    },
    {
      "document_id": "6879",
      "clicks": 2
    }
  ]
}

Example - A GET request with no addition parameters.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Java example available, showing cURL
{
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "163",
      "clicks": 2
    },
    {
      "document_id": "6879",
      "clicks": 2
    }
  ]
}

Example - A GET request with no addition parameters.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Node example available, showing cURL
{
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "163",
      "clicks": 2
    },
    {
      "document_id": "6879",
      "clicks": 2
    }
  ]
}

Example - A GET request with no addition parameters.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Ruby example available, showing cURL
{
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "163",
      "clicks": 2
    },
    {
      "document_id": "6879",
      "clicks": 2
    }
  ]
}

Example - A GET request with no addition parameters.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Python example available, showing cURL
{
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "163",
      "clicks": 2
    },
    {
      "document_id": "6879",
      "clicks": 2
    }
  ]
}

Example - A GET request with no addition parameters.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Javascript example available, showing cURL
{
  "meta": {
    "page": {
      "size": 3,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "163",
      "clicks": 2
    },
    {
      "document_id": "6879",
      "clicks": 2
    }
  ]
}

More clicks

If you would like to produce more top queries, you can add the page key with the size parameter.

Example - A GET request asking for 20 results using the page argument with the size option.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20
  }
}'
Example Response
{
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "163",
      "clicks": 2
    },
    {
      "document_id": "6879",
      "clicks": 2
    },
    {
      "document_id": "9797",
      "clicks": 2
    },
    {
      "document_id": "567",
      "clicks": 1
    },
    ...
  ]
}

Example - A GET request asking for 20 results using the page argument with the size option.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20
  }
}'
Example Response
No Java example available, showing cURL
{
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "163",
      "clicks": 2
    },
    {
      "document_id": "6879",
      "clicks": 2
    },
    {
      "document_id": "9797",
      "clicks": 2
    },
    {
      "document_id": "567",
      "clicks": 1
    },
    ...
  ]
}

Example - A GET request asking for 20 results using the page argument with the size option.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20
  }
}'
Example Response
No Node example available, showing cURL
{
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "163",
      "clicks": 2
    },
    {
      "document_id": "6879",
      "clicks": 2
    },
    {
      "document_id": "9797",
      "clicks": 2
    },
    {
      "document_id": "567",
      "clicks": 1
    },
    ...
  ]
}

Example - A GET request asking for 20 results using the page argument with the size option.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20
  }
}'
Example Response
No Ruby example available, showing cURL
{
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "163",
      "clicks": 2
    },
    {
      "document_id": "6879",
      "clicks": 2
    },
    {
      "document_id": "9797",
      "clicks": 2
    },
    {
      "document_id": "567",
      "clicks": 1
    },
    ...
  ]
}

Example - A GET request asking for 20 results using the page argument with the size option.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20
  }
}'
Example Response
No Python example available, showing cURL
{
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "163",
      "clicks": 2
    },
    {
      "document_id": "6879",
      "clicks": 2
    },
    {
      "document_id": "9797",
      "clicks": 2
    },
    {
      "document_id": "567",
      "clicks": 1
    },
    ...
  ]
}

Example - A GET request asking for 20 results using the page argument with the size option.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "page": {
    "size": 20
  }
}'
Example Response
No Javascript example available, showing cURL
{
  "meta": {
    "page": {
      "size": 20,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "163",
      "clicks": 2
    },
    {
      "document_id": "6879",
      "clicks": 2
    },
    {
      "document_id": "9797",
      "clicks": 2
    },
    {
      "document_id": "567",
      "clicks": 1
    },
    ...
  ]
}

Clicks Filtering

filters
optional
The filters key is the parent key. If no options are provided underneath it, the top 10 queries over the past 7 days are returned.
query
optional
You can supply a particular query to see the relevant documents that have received clicks.
View example.
tag
optional
The Search end-point can be used to attach tags to your documents. One or more tags can be applied to filter results via the API or within your analytics dashboard.
View example.
date
optional
Specify a range of time. The from and to fields are optional and the expected format is RFC3339.
View example.
all
optional
Include multiple filters by nesting them under the all option.
View example.

Query

Example - A GET request with the query filter option. We want to see how many clicks the toyota query received, and for which documents.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "query": "toyota" }
}'
Example Response
{
  "meta": {
    "page": {
      "size": 2,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "6879",
      "clicks": 2
    }
  ]
}

Example - A GET request with the query filter option. We want to see how many clicks the toyota query received, and for which documents.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "query": "toyota" }
}'
Example Response
No Java example available, showing cURL
{
  "meta": {
    "page": {
      "size": 2,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "6879",
      "clicks": 2
    }
  ]
}

Example - A GET request with the query filter option. We want to see how many clicks the toyota query received, and for which documents.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "query": "toyota" }
}'
Example Response
No Node example available, showing cURL
{
  "meta": {
    "page": {
      "size": 2,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "6879",
      "clicks": 2
    }
  ]
}

Example - A GET request with the query filter option. We want to see how many clicks the toyota query received, and for which documents.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "query": "toyota" }
}'
Example Response
No Ruby example available, showing cURL
{
  "meta": {
    "page": {
      "size": 2,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "6879",
      "clicks": 2
    }
  ]
}

Example - A GET request with the query filter option. We want to see how many clicks the toyota query received, and for which documents.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "query": "toyota" }
}'
Example Response
No Python example available, showing cURL
{
  "meta": {
    "page": {
      "size": 2,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "6879",
      "clicks": 2
    }
  ]
}

Example - A GET request with the query filter option. We want to see how many clicks the toyota query received, and for which documents.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "query": "toyota" }
}'
Example Response
No Javascript example available, showing cURL
{
  "meta": {
    "page": {
      "size": 2,
      "current": 1
    }
  },
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    },
    {
      "document_id": "6879",
      "clicks": 2
    }
  ]
}

Tag(s)

Single Tag
Example - A GET request with the tag filter option. We want to see how many clicks that documents with the web tag received.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
{
  "results": [
    {
      "document_id": "6879",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option. We want to see how many clicks that documents with the web tag received.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "document_id": "6879",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option. We want to see how many clicks that documents with the web tag received.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "document_id": "6879",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option. We want to see how many clicks that documents with the web tag received.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "document_id": "6879",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option. We want to see how many clicks that documents with the web tag received.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "document_id": "6879",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option. We want to see how many clicks that documents with the web tag received.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "document_id": "6879",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Multiple Tags
Example - A GET request with the tag filter option containing multiple tags. We want to see how many clicks that documents with the web and mobile tags received.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
{
  "results": [
    {
      "document_id": "163",
      "clicks": 2
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option containing multiple tags. We want to see how many clicks that documents with the web and mobile tags received.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "document_id": "163",
      "clicks": 2
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option containing multiple tags. We want to see how many clicks that documents with the web and mobile tags received.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "document_id": "163",
      "clicks": 2
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option containing multiple tags. We want to see how many clicks that documents with the web and mobile tags received.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "document_id": "163",
      "clicks": 2
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option containing multiple tags. We want to see how many clicks that documents with the web and mobile tags received.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "document_id": "163",
      "clicks": 2
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the tag filter option containing multiple tags. We want to see how many clicks that documents with the web and mobile tags received.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "document_id": "163",
      "clicks": 2
    },
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Date

Example - A POST request with the date filters option. Expects results from the earlier date, to the later date.
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T12:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
{
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A POST request with the date filters option. Expects results from the earlier date, to the later date.
No Java example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T12:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A POST request with the date filters option. Expects results from the earlier date, to the later date.
No Node example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T12:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A POST request with the date filters option. Expects results from the earlier date, to the later date.
No Ruby example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T12:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A POST request with the date filters option. Expects results from the earlier date, to the later date.
No Python example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T12:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A POST request with the date filters option. Expects results from the earlier date, to the later date.
No Javascript example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T12:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "document_id": "5209",
      "clicks": 3
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Multiple Filters

Example - A GET request with the date and tag filter options. We want to see which documents have been clicked and how many times, between a time-range, for documents containing two different tags.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  }'
Example Response
{
  "results": [
    {
      "document_id": "9797",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the date and tag filter options. We want to see which documents have been clicked and how many times, between a time-range, for documents containing two different tags.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  }'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "document_id": "9797",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the date and tag filter options. We want to see which documents have been clicked and how many times, between a time-range, for documents containing two different tags.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  }'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "document_id": "9797",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the date and tag filter options. We want to see which documents have been clicked and how many times, between a time-range, for documents containing two different tags.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  }'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "document_id": "9797",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the date and tag filter options. We want to see which documents have been clicked and how many times, between a time-range, for documents containing two different tags.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  }'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "document_id": "9797",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request with the date and tag filter options. We want to see which documents have been clicked and how many times, between a time-range, for documents containing two different tags.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  }'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "document_id": "9797",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Everything!

You can combine all of the different parameters to generate very specific, large or small, analytic result sets.

Example - A GET request that includes the page and filters arguments. All filters options are included.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "query": "toyota"
      }, {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  },
  "page": {
    "size": 20
  }
}'
Example Response
{
  "results": [
    {
      "document_id": "9797",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request that includes the page and filters arguments. All filters options are included.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "query": "toyota"
      }, {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  },
  "page": {
    "size": 20
  }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "document_id": "9797",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request that includes the page and filters arguments. All filters options are included.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "query": "toyota"
      }, {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  },
  "page": {
    "size": 20
  }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "document_id": "9797",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request that includes the page and filters arguments. All filters options are included.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "query": "toyota"
      }, {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  },
  "page": {
    "size": 20
  }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "document_id": "9797",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request that includes the page and filters arguments. All filters options are included.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "query": "toyota"
      }, {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  },
  "page": {
    "size": 20
  }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "document_id": "9797",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Example - A GET request that includes the page and filters arguments. All filters options are included.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "query": "toyota"
      }, {
        "date": {
          "from": "2018-06-15T12:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  },
  "page": {
    "size": 20
  }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "document_id": "9797",
      "clicks": 2
    }
  ],
  "meta": {
    "page": {
      "size": 1,
      "current": 1
    }
  }
}

Counts

The analytics/counts end-point responds to GET and POST requests. The payload you receive will include results without meta-data. A result of the analytics/counts end-point will include: your total number of clicks, total number of queries and the time-frame.

The results will be displayed in ascending order, from oldest to newest. One day is the default block of time and the default time/date format is RFC3339. You may return up to 100 results at a time.

GET /api/as/v1/engines/{ENGINE_NAME}/analytics/clicks
POST /api/as/v1/engines/{ENGINE_NAME}/analytics/clicks
// An example JSON payload from the analytics/counts end-point.
{
  "results": [
    {
      "clicks": number,
      "queries": number,
      "from": date,
      "to": date
    }
  ]
}

Weekly Counts

A GET or POST request to analytics/counts will display 7 days worth of results by default. Each object represents a single day.

Example - A GET request with no addition parameters.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
{
  "results": [
    {
      "clicks": 123,
      "queries": 2322,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 214,
      "queries": 5122,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 321,
      "queries": 4544,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 10,
      "queries": 500,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 434,
      "queries": 1100,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 312,
      "queries": 4343,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 87,
      "queries": 434,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 23,
      "queries": 439,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with no addition parameters.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "clicks": 123,
      "queries": 2322,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 214,
      "queries": 5122,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 321,
      "queries": 4544,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 10,
      "queries": 500,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 434,
      "queries": 1100,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 312,
      "queries": 4343,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 87,
      "queries": 434,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 23,
      "queries": 439,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with no addition parameters.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "clicks": 123,
      "queries": 2322,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 214,
      "queries": 5122,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 321,
      "queries": 4544,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 10,
      "queries": 500,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 434,
      "queries": 1100,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 312,
      "queries": 4343,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 87,
      "queries": 434,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 23,
      "queries": 439,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with no addition parameters.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "clicks": 123,
      "queries": 2322,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 214,
      "queries": 5122,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 321,
      "queries": 4544,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 10,
      "queries": 500,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 434,
      "queries": 1100,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 312,
      "queries": 4343,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 87,
      "queries": 434,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 23,
      "queries": 439,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with no addition parameters.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "clicks": 123,
      "queries": 2322,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 214,
      "queries": 5122,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 321,
      "queries": 4544,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 10,
      "queries": 500,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 434,
      "queries": 1100,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 312,
      "queries": 4343,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 87,
      "queries": 434,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 23,
      "queries": 439,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with no addition parameters.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "clicks": 123,
      "queries": 2322,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 214,
      "queries": 5122,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 321,
      "queries": 4544,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 10,
      "queries": 500,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 434,
      "queries": 1100,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 312,
      "queries": 4343,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 87,
      "queries": 434,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 23,
      "queries": 439,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Counts Filtering

filters
optional
The filters key is the parent key. If no options are provided underneath it, the last 7 days are returned.
query
optional
You can supply a particular query to see the relevant documents that have received clicks and/or queries within your time-frame. You may only include one query parameter.
View example.
tag
optional
The Search end-point can be used to attach tags to your documents. One or more tags can be applied to filter results via the API or within your analytics dashboard.
View example.
document_id
optional
Providing a document_id will narrow results down to that specific document. You may only provide one document_id at a time. The number of queries indicates how often the document appeared as a result and clicks the number of time it received a click.
View example.
date
optional
Specify a range of time. The from and to fields are optional and the expected format is RFC3339.
View example.
interval
optional
You can define an interval along with your date range. Can be either hour or day, with day as the default. You are limited to a maximum of 100 results within your interval. Therefore, when expecting hours, a date range can not exceed 100 hours or 4 days.
all
optional
Include multiple filters by nesting them under the all option.
View example.

Query

Example - A GET request with the query filter option. We want to see how many clicks and queries the toyota query received over the default 7 day time period.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "query": "toyota" }
}'
Example Response
{
  "results": [
    {
      "clicks": 23,
      "queries": 322,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 14,
      "queries": 122,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 21,
      "queries": 544,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 50,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 34,
      "queries": 100,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 12,
      "queries": 343,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 7,
      "queries": 34,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 39,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the query filter option. We want to see how many clicks and queries the toyota query received over the default 7 day time period.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "query": "toyota" }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "clicks": 23,
      "queries": 322,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 14,
      "queries": 122,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 21,
      "queries": 544,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 50,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 34,
      "queries": 100,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 12,
      "queries": 343,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 7,
      "queries": 34,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 39,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the query filter option. We want to see how many clicks and queries the toyota query received over the default 7 day time period.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "query": "toyota" }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "clicks": 23,
      "queries": 322,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 14,
      "queries": 122,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 21,
      "queries": 544,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 50,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 34,
      "queries": 100,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 12,
      "queries": 343,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 7,
      "queries": 34,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 39,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the query filter option. We want to see how many clicks and queries the toyota query received over the default 7 day time period.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "query": "toyota" }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "clicks": 23,
      "queries": 322,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 14,
      "queries": 122,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 21,
      "queries": 544,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 50,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 34,
      "queries": 100,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 12,
      "queries": 343,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 7,
      "queries": 34,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 39,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the query filter option. We want to see how many clicks and queries the toyota query received over the default 7 day time period.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "query": "toyota" }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "clicks": 23,
      "queries": 322,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 14,
      "queries": 122,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 21,
      "queries": 544,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 50,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 34,
      "queries": 100,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 12,
      "queries": 343,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 7,
      "queries": 34,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 39,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the query filter option. We want to see how many clicks and queries the toyota query received over the default 7 day time period.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "query": "toyota" }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "clicks": 23,
      "queries": 322,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 14,
      "queries": 122,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 21,
      "queries": 544,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 50,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 34,
      "queries": 100,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 12,
      "queries": 343,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 7,
      "queries": 34,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 39,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Tag(s)

Single Tag
Example - A GET request with the tag filter option. We want to see how many clicks and queries that documents with the web tag received over the default 7 day time period.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
{
  "results": [
    {
      "clicks": 1,
      "queries": 12,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 44,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 133,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 5,
      "queries": 234,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 4,
      "queries": 211,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 146,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 245,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 210,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the tag filter option. We want to see how many clicks and queries that documents with the web tag received over the default 7 day time period.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "clicks": 1,
      "queries": 12,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 44,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 133,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 5,
      "queries": 234,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 4,
      "queries": 211,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 146,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 245,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 210,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the tag filter option. We want to see how many clicks and queries that documents with the web tag received over the default 7 day time period.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "clicks": 1,
      "queries": 12,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 44,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 133,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 5,
      "queries": 234,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 4,
      "queries": 211,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 146,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 245,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 210,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the tag filter option. We want to see how many clicks and queries that documents with the web tag received over the default 7 day time period.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "clicks": 1,
      "queries": 12,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 44,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 133,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 5,
      "queries": 234,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 4,
      "queries": 211,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 146,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 245,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 210,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the tag filter option. We want to see how many clicks and queries that documents with the web tag received over the default 7 day time period.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "clicks": 1,
      "queries": 12,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 44,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 133,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 5,
      "queries": 234,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 4,
      "queries": 211,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 146,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 245,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 210,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the tag filter option. We want to see how many clicks and queries that documents with the web tag received over the default 7 day time period.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": "web" }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "clicks": 1,
      "queries": 12,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 44,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 133,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 5,
      "queries": 234,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 4,
      "queries": 211,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 146,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 245,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 210,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Multiple Tags
Example - A GET request with the tag filter option containing multiple tags. We want to see how many clicks and queries that documents with the web and mobile tags received over the default 7 day time period.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
{
  "results": [
    {
      "clicks": 2,
      "queries": 22,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 4,
      "queries": 34,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 233,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 450,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 11,
      "queries": 1403,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 5,
      "queries": 546,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 375,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 240,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the tag filter option containing multiple tags. We want to see how many clicks and queries that documents with the web and mobile tags received over the default 7 day time period.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "clicks": 2,
      "queries": 22,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 4,
      "queries": 34,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 233,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 450,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 11,
      "queries": 1403,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 5,
      "queries": 546,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 375,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 240,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the tag filter option containing multiple tags. We want to see how many clicks and queries that documents with the web and mobile tags received over the default 7 day time period.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "clicks": 2,
      "queries": 22,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 4,
      "queries": 34,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 233,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 450,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 11,
      "queries": 1403,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 5,
      "queries": 546,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 375,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 240,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the tag filter option containing multiple tags. We want to see how many clicks and queries that documents with the web and mobile tags received over the default 7 day time period.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "clicks": 2,
      "queries": 22,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 4,
      "queries": 34,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 233,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 450,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 11,
      "queries": 1403,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 5,
      "queries": 546,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 375,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 240,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the tag filter option containing multiple tags. We want to see how many clicks and queries that documents with the web and mobile tags received over the default 7 day time period.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "clicks": 2,
      "queries": 22,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 4,
      "queries": 34,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 233,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 450,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 11,
      "queries": 1403,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 5,
      "queries": 546,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 375,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 240,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the tag filter option containing multiple tags. We want to see how many clicks and queries that documents with the web and mobile tags received over the default 7 day time period.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "tag": ["web", "mobile"] }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "clicks": 2,
      "queries": 22,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 4,
      "queries": 34,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 233,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 450,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 11,
      "queries": 1403,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 5,
      "queries": 546,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 375,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 240,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Document ID

Example - A GET request with the document_id filter option. We want to see how many clicks and queries that the document with id 321 received over the default 7 day time period.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "document_id": 321 }
}'
Example Response
{
  "results": [
    {
      "clicks": 4,
      "queries": 239,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 131,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 356,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 150,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 6,
      "queries": 190,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 411,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 34,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 6,
      "queries": 339,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the document_id filter option. We want to see how many clicks and queries that the document with id 321 received over the default 7 day time period.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "document_id": 321 }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "clicks": 4,
      "queries": 239,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 131,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 356,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 150,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 6,
      "queries": 190,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 411,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 34,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 6,
      "queries": 339,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the document_id filter option. We want to see how many clicks and queries that the document with id 321 received over the default 7 day time period.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "document_id": 321 }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "clicks": 4,
      "queries": 239,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 131,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 356,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 150,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 6,
      "queries": 190,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 411,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 34,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 6,
      "queries": 339,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the document_id filter option. We want to see how many clicks and queries that the document with id 321 received over the default 7 day time period.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "document_id": 321 }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "clicks": 4,
      "queries": 239,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 131,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 356,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 150,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 6,
      "queries": 190,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 411,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 34,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 6,
      "queries": 339,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the document_id filter option. We want to see how many clicks and queries that the document with id 321 received over the default 7 day time period.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "document_id": 321 }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "clicks": 4,
      "queries": 239,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 131,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 356,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 150,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 6,
      "queries": 190,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 411,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 34,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 6,
      "queries": 339,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Example - A GET request with the document_id filter option. We want to see how many clicks and queries that the document with id 321 received over the default 7 day time period.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": { "document_id": 321 }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "clicks": 4,
      "queries": 239,
      "from": "2018-07-02T10:24:46Z",
      "to": "2018-07-03T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 131,
      "from": "2018-07-03T00:00:00+00:00",
      "to": "2018-07-04T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 356,
      "from": "2018-07-04T00:00:00+00:00",
      "to": "2018-07-05T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 150,
      "from": "2018-07-05T00:00:00+00:00",
      "to": "2018-07-06T00:00:00+00:00"
    },
    {
      "clicks": 6,
      "queries": 190,
      "from": "2018-07-06T00:00:00+00:00",
      "to": "2018-07-07T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 411,
      "from": "2018-07-07T00:00:00+00:00",
      "to": "2018-07-08T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 34,
      "from": "2018-07-08T00:00:00+00:00",
      "to": "2018-07-09T00:00:00+00:00"
    },
    {
      "clicks": 6,
      "queries": 339,
      "from": "2018-07-09T00:00:00+00:00",
      "to": "2018-07-09T10:24:46Z"
    }
  ]
}

Date

Example - A POST request with the date filters option. We want a shorter time frame than the default 7 days. We only want 4 days. Expects results from the earlier date, to the later date.
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
{
  "results": [
    {
      "clicks": 1,
      "queries": 139,
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-07-16T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 349,
      "from": "2018-07-16T00:00:00+00:00",
      "to": "2018-07-17T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 297,
      "from": "2018-07-17T00:00:00+00:00",
      "to": "2018-07-18T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 111,
      "from": "2018-07-18T00:00:00+00:00",
      "to": "2018-07-19T00:00:00+00:00"
    }
  ]
}

Example - A POST request with the date filters option. We want a shorter time frame than the default 7 days. We only want 4 days. Expects results from the earlier date, to the later date.
No Java example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "clicks": 1,
      "queries": 139,
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-07-16T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 349,
      "from": "2018-07-16T00:00:00+00:00",
      "to": "2018-07-17T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 297,
      "from": "2018-07-17T00:00:00+00:00",
      "to": "2018-07-18T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 111,
      "from": "2018-07-18T00:00:00+00:00",
      "to": "2018-07-19T00:00:00+00:00"
    }
  ]
}

Example - A POST request with the date filters option. We want a shorter time frame than the default 7 days. We only want 4 days. Expects results from the earlier date, to the later date.
No Node example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "clicks": 1,
      "queries": 139,
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-07-16T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 349,
      "from": "2018-07-16T00:00:00+00:00",
      "to": "2018-07-17T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 297,
      "from": "2018-07-17T00:00:00+00:00",
      "to": "2018-07-18T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 111,
      "from": "2018-07-18T00:00:00+00:00",
      "to": "2018-07-19T00:00:00+00:00"
    }
  ]
}

Example - A POST request with the date filters option. We want a shorter time frame than the default 7 days. We only want 4 days. Expects results from the earlier date, to the later date.
No Ruby example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "clicks": 1,
      "queries": 139,
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-07-16T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 349,
      "from": "2018-07-16T00:00:00+00:00",
      "to": "2018-07-17T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 297,
      "from": "2018-07-17T00:00:00+00:00",
      "to": "2018-07-18T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 111,
      "from": "2018-07-18T00:00:00+00:00",
      "to": "2018-07-19T00:00:00+00:00"
    }
  ]
}

Example - A POST request with the date filters option. We want a shorter time frame than the default 7 days. We only want 4 days. Expects results from the earlier date, to the later date.
No Python example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "clicks": 1,
      "queries": 139,
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-07-16T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 349,
      "from": "2018-07-16T00:00:00+00:00",
      "to": "2018-07-17T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 297,
      "from": "2018-07-17T00:00:00+00:00",
      "to": "2018-07-18T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 111,
      "from": "2018-07-18T00:00:00+00:00",
      "to": "2018-07-19T00:00:00+00:00"
    }
  ]
}

Example - A POST request with the date filters option. We want a shorter time frame than the default 7 days. We only want 4 days. Expects results from the earlier date, to the later date.
No Javascript example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  }
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "clicks": 1,
      "queries": 139,
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-07-16T00:00:00+00:00"
    },
    {
      "clicks": 3,
      "queries": 349,
      "from": "2018-07-16T00:00:00+00:00",
      "to": "2018-07-17T00:00:00+00:00"
    },
    {
      "clicks": 2,
      "queries": 297,
      "from": "2018-07-17T00:00:00+00:00",
      "to": "2018-07-18T00:00:00+00:00"
    },
    {
      "clicks": 1,
      "queries": 111,
      "from": "2018-07-18T00:00:00+00:00",
      "to": "2018-07-19T00:00:00+00:00"
    }
  ]
}

Interval

Only 100 results may be returned at one time. Changing the interval will require a date range set to no greater than 100 hours or 4 days.
Example - A POST request with the date filters option. We are asking for a 6 hour window. Interval is set to hour.
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-18T18:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  },
  "interval": "hour"
}'
Example Response
{
  "results": [
    {
      "clicks": 0,
      "queries": 31,
      "from": "2018-06-18T18:00:00+00:00",
      "to": "2018-06-18T19:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 58,
      "from": "2018-06-18T19:00:00+00:00",
      "to": "2018-06-18T20:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 24,
      "from": "2018-06-18T20:00:00+00:00",
      "to": "2018-06-18T21:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 34,
      "from": "2018-06-18T21:00:00+00:00",
      "to": "2018-06-18T22:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 15,
      "from": "2018-06-18T22:00:00+00:00",
      "to": "2018-06-18T23:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 9,
      "from": "2018-06-18T23:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  ]
}

Example - A POST request with the date filters option. We are asking for a 6 hour window. Interval is set to hour.
No Java example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-18T18:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  },
  "interval": "hour"
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "clicks": 0,
      "queries": 31,
      "from": "2018-06-18T18:00:00+00:00",
      "to": "2018-06-18T19:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 58,
      "from": "2018-06-18T19:00:00+00:00",
      "to": "2018-06-18T20:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 24,
      "from": "2018-06-18T20:00:00+00:00",
      "to": "2018-06-18T21:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 34,
      "from": "2018-06-18T21:00:00+00:00",
      "to": "2018-06-18T22:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 15,
      "from": "2018-06-18T22:00:00+00:00",
      "to": "2018-06-18T23:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 9,
      "from": "2018-06-18T23:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  ]
}

Example - A POST request with the date filters option. We are asking for a 6 hour window. Interval is set to hour.
No Node example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-18T18:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  },
  "interval": "hour"
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "clicks": 0,
      "queries": 31,
      "from": "2018-06-18T18:00:00+00:00",
      "to": "2018-06-18T19:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 58,
      "from": "2018-06-18T19:00:00+00:00",
      "to": "2018-06-18T20:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 24,
      "from": "2018-06-18T20:00:00+00:00",
      "to": "2018-06-18T21:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 34,
      "from": "2018-06-18T21:00:00+00:00",
      "to": "2018-06-18T22:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 15,
      "from": "2018-06-18T22:00:00+00:00",
      "to": "2018-06-18T23:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 9,
      "from": "2018-06-18T23:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  ]
}

Example - A POST request with the date filters option. We are asking for a 6 hour window. Interval is set to hour.
No Ruby example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-18T18:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  },
  "interval": "hour"
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "clicks": 0,
      "queries": 31,
      "from": "2018-06-18T18:00:00+00:00",
      "to": "2018-06-18T19:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 58,
      "from": "2018-06-18T19:00:00+00:00",
      "to": "2018-06-18T20:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 24,
      "from": "2018-06-18T20:00:00+00:00",
      "to": "2018-06-18T21:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 34,
      "from": "2018-06-18T21:00:00+00:00",
      "to": "2018-06-18T22:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 15,
      "from": "2018-06-18T22:00:00+00:00",
      "to": "2018-06-18T23:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 9,
      "from": "2018-06-18T23:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  ]
}

Example - A POST request with the date filters option. We are asking for a 6 hour window. Interval is set to hour.
No Python example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-18T18:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  },
  "interval": "hour"
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "clicks": 0,
      "queries": 31,
      "from": "2018-06-18T18:00:00+00:00",
      "to": "2018-06-18T19:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 58,
      "from": "2018-06-18T19:00:00+00:00",
      "to": "2018-06-18T20:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 24,
      "from": "2018-06-18T20:00:00+00:00",
      "to": "2018-06-18T21:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 34,
      "from": "2018-06-18T21:00:00+00:00",
      "to": "2018-06-18T22:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 15,
      "from": "2018-06-18T22:00:00+00:00",
      "to": "2018-06-18T23:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 9,
      "from": "2018-06-18T23:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  ]
}

Example - A POST request with the date filters option. We are asking for a 6 hour window. Interval is set to hour.
No Javascript example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "date": {
      "from": "2018-06-18T18:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  },
  "interval": "hour"
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "clicks": 0,
      "queries": 31,
      "from": "2018-06-18T18:00:00+00:00",
      "to": "2018-06-18T19:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 58,
      "from": "2018-06-18T19:00:00+00:00",
      "to": "2018-06-18T20:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 24,
      "from": "2018-06-18T20:00:00+00:00",
      "to": "2018-06-18T21:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 34,
      "from": "2018-06-18T21:00:00+00:00",
      "to": "2018-06-18T22:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 15,
      "from": "2018-06-18T22:00:00+00:00",
      "to": "2018-06-18T23:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 9,
      "from": "2018-06-18T23:00:00+00:00",
      "to": "2018-06-19T00:00:00+00:00"
    }
  ]
}

Multiple Filters

Example - A GET request with the date and tag filter options. We want to see how many clicks and queries documents with the web and mobile tag received within a 2 day window.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "date": {
          "from": "2018-06-17T00:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  }'
Example Response
{
  "results": [
    {
      "clicks": 4,
      "queries": 639,
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-07-16T00:00:00+00:00"
    },
    {
      "clicks": 13,
      "queries": 949,
      "from": "2018-07-16T00:00:00+00:00",
      "to": "2018-07-17T00:00:00+00:00"
    }
  ]
}

Example - A GET request with the date and tag filter options. We want to see how many clicks and queries documents with the web and mobile tag received within a 2 day window.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "date": {
          "from": "2018-06-17T00:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  }'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "clicks": 4,
      "queries": 639,
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-07-16T00:00:00+00:00"
    },
    {
      "clicks": 13,
      "queries": 949,
      "from": "2018-07-16T00:00:00+00:00",
      "to": "2018-07-17T00:00:00+00:00"
    }
  ]
}

Example - A GET request with the date and tag filter options. We want to see how many clicks and queries documents with the web and mobile tag received within a 2 day window.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "date": {
          "from": "2018-06-17T00:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  }'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "clicks": 4,
      "queries": 639,
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-07-16T00:00:00+00:00"
    },
    {
      "clicks": 13,
      "queries": 949,
      "from": "2018-07-16T00:00:00+00:00",
      "to": "2018-07-17T00:00:00+00:00"
    }
  ]
}

Example - A GET request with the date and tag filter options. We want to see how many clicks and queries documents with the web and mobile tag received within a 2 day window.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "date": {
          "from": "2018-06-17T00:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  }'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "clicks": 4,
      "queries": 639,
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-07-16T00:00:00+00:00"
    },
    {
      "clicks": 13,
      "queries": 949,
      "from": "2018-07-16T00:00:00+00:00",
      "to": "2018-07-17T00:00:00+00:00"
    }
  ]
}

Example - A GET request with the date and tag filter options. We want to see how many clicks and queries documents with the web and mobile tag received within a 2 day window.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "date": {
          "from": "2018-06-17T00:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  }'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "clicks": 4,
      "queries": 639,
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-07-16T00:00:00+00:00"
    },
    {
      "clicks": 13,
      "queries": 949,
      "from": "2018-07-16T00:00:00+00:00",
      "to": "2018-07-17T00:00:00+00:00"
    }
  ]
}

Example - A GET request with the date and tag filter options. We want to see how many clicks and queries documents with the web and mobile tag received within a 2 day window.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/counts' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "date": {
          "from": "2018-06-17T00:00:00+00:00",
          "to": "2018-06-19T00:00:00+00:00"
        }
      }, {
        "tag": ["web", "mobile"]
      }
    ]
  }'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "clicks": 4,
      "queries": 639,
      "from": "2018-06-15T00:00:00+00:00",
      "to": "2018-07-16T00:00:00+00:00"
    },
    {
      "clicks": 13,
      "queries": 949,
      "from": "2018-07-16T00:00:00+00:00",
      "to": "2018-07-17T00:00:00+00:00"
    }
  ]
}

Everything!

You can combine all of the different parameters to generate very specific, large or small, analytic result sets.

Including both tags and document_id is strange, but it helps to see everything within one example.
Example - A GET request that includes the interval and filters arguments. All filters options are included. The interval is set to hour, with the date range set to 2 hours.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "tag": ["mobile", "web"]
      },{
        "query": "rails"
      }, {
        "document_id": "163"
      }, {
        "date": {
          "from": "2018-07-05T12:00:00+00:00",
          "to": "2018-07-05T14:00:00+00:00"
        }
      }
    ]
  },
  "interval": "hour"
}'
Example Response
{
  "results": [
    {
      "clicks": 1,
      "queries": 139,
      "from": "2018-07-05T12:00:00+00:00",
      "to": "2018-07-05T13:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 59,
      "from": "2018-07-05T13:00:00+00:00",
      "to": "2018-07-05T14:00:00+00:00"
    }
  ]
}

Example - A GET request that includes the interval and filters arguments. All filters options are included. The interval is set to hour, with the date range set to 2 hours.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "tag": ["mobile", "web"]
      },{
        "query": "rails"
      }, {
        "document_id": "163"
      }, {
        "date": {
          "from": "2018-07-05T12:00:00+00:00",
          "to": "2018-07-05T14:00:00+00:00"
        }
      }
    ]
  },
  "interval": "hour"
}'
Example Response
No Java example available, showing cURL
{
  "results": [
    {
      "clicks": 1,
      "queries": 139,
      "from": "2018-07-05T12:00:00+00:00",
      "to": "2018-07-05T13:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 59,
      "from": "2018-07-05T13:00:00+00:00",
      "to": "2018-07-05T14:00:00+00:00"
    }
  ]
}

Example - A GET request that includes the interval and filters arguments. All filters options are included. The interval is set to hour, with the date range set to 2 hours.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "tag": ["mobile", "web"]
      },{
        "query": "rails"
      }, {
        "document_id": "163"
      }, {
        "date": {
          "from": "2018-07-05T12:00:00+00:00",
          "to": "2018-07-05T14:00:00+00:00"
        }
      }
    ]
  },
  "interval": "hour"
}'
Example Response
No Node example available, showing cURL
{
  "results": [
    {
      "clicks": 1,
      "queries": 139,
      "from": "2018-07-05T12:00:00+00:00",
      "to": "2018-07-05T13:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 59,
      "from": "2018-07-05T13:00:00+00:00",
      "to": "2018-07-05T14:00:00+00:00"
    }
  ]
}

Example - A GET request that includes the interval and filters arguments. All filters options are included. The interval is set to hour, with the date range set to 2 hours.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "tag": ["mobile", "web"]
      },{
        "query": "rails"
      }, {
        "document_id": "163"
      }, {
        "date": {
          "from": "2018-07-05T12:00:00+00:00",
          "to": "2018-07-05T14:00:00+00:00"
        }
      }
    ]
  },
  "interval": "hour"
}'
Example Response
No Ruby example available, showing cURL
{
  "results": [
    {
      "clicks": 1,
      "queries": 139,
      "from": "2018-07-05T12:00:00+00:00",
      "to": "2018-07-05T13:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 59,
      "from": "2018-07-05T13:00:00+00:00",
      "to": "2018-07-05T14:00:00+00:00"
    }
  ]
}

Example - A GET request that includes the interval and filters arguments. All filters options are included. The interval is set to hour, with the date range set to 2 hours.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "tag": ["mobile", "web"]
      },{
        "query": "rails"
      }, {
        "document_id": "163"
      }, {
        "date": {
          "from": "2018-07-05T12:00:00+00:00",
          "to": "2018-07-05T14:00:00+00:00"
        }
      }
    ]
  },
  "interval": "hour"
}'
Example Response
No Python example available, showing cURL
{
  "results": [
    {
      "clicks": 1,
      "queries": 139,
      "from": "2018-07-05T12:00:00+00:00",
      "to": "2018-07-05T13:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 59,
      "from": "2018-07-05T13:00:00+00:00",
      "to": "2018-07-05T14:00:00+00:00"
    }
  ]
}

Example - A GET request that includes the interval and filters arguments. All filters options are included. The interval is set to hour, with the date range set to 2 hours.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/engines/rent-a-car/analytics/clicks' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer api-xxxxxxxxxxxxxxxxxxxxxxxx' \
-d '{
  "filters": {
    "all": [
      {
        "tag": ["mobile", "web"]
      },{
        "query": "rails"
      }, {
        "document_id": "163"
      }, {
        "date": {
          "from": "2018-07-05T12:00:00+00:00",
          "to": "2018-07-05T14:00:00+00:00"
        }
      }
    ]
  },
  "interval": "hour"
}'
Example Response
No Javascript example available, showing cURL
{
  "results": [
    {
      "clicks": 1,
      "queries": 139,
      "from": "2018-07-05T12:00:00+00:00",
      "to": "2018-07-05T13:00:00+00:00"
    },
    {
      "clicks": 0,
      "queries": 59,
      "from": "2018-07-05T13:00:00+00:00",
      "to": "2018-07-05T14:00:00+00:00"
    }
  ]
}

What's Next?

The Analytics end-point is a great way to inform yourself about user search activity. You might be wondering what you can do to improve the results that you are seeing. How can you generate more clicks, more queries? Wise places to start include Synonyms and Curations. If you want to gain even deeper insight into search behaviour, reading about Clickthrough is a wise choice.


Stuck? Looking for help? Contact Support!