Popular Searches API

The Popular Searches API returns the popular searches for for a particular time period.

There are two ways to get popular searches. One is to specify 'day', 'month', 'year', 'hour' or 'minute' parameters to get popular searches in the last number of days, months, years, hours or minutes.

The other is to specify a timestamp for 'start' and 'end' to search within a specific date range.

Minimum Tag

{{ _api.search.getPopularSearches.templateId('3') }}

Example Tags

Get the popular searches in the last 4 days.

{{ _api.search.getPopularSearches.templateId('3').days('4') }}

Gets the popular searches between the dates that the starting and ending timestamps represent.

{{ _api.search.getPopularSearches.templateId('3').start('1249684194').end('1331563683') }}

API Tag Parameters

Parameter Description
days

The number of recent days to get results for. Defaults to 0.

Type: Integer

Example:

days('3')

end

The timestamp for the ending value of the date range to return results for.

Type: Integer

Example:

end('1331563683')

hours

The number of recent hours to get results for. Defaults to 0.

Type: Integer

Example:

hours('12')

limit
l

The number of results to return. Defaults to return all matching results (no limit).

You can alternately use the short form "l" instead of "limit"

Type: Integer

Examples:

limit(5)
l(5)

minutes

The number of recent minutes to get results for. Defaults to 0.

Type: Integer

Example:

minutes('30')

months

The number of recent months to get results for. Defaults to 0.

Type: Integer

Example:

months('2')

responseFormat

Sets how the API response will be returned.

Type: String

Accepted Values:

  • template - The default value. This tells the system to use a Content Template to build the API response.
  • ui - This is used if the data from the API call will used in the administration as a UI form component. A Content Template will be used to structure the data correctly to build the form component HTML.

Example:

responseFormat('ui')

start

The timestamp for the starting value of the date range to return results for.

Type: Integer

Example:

start('1249684194')

template
t

Required if responseFormat is not 'data'. The template key of the template to use.

If this is not passed when it's required then nothing will be returned. In some cases, by not passing this parameter you will get just the raw data back.

You an alternately use the short form "t" instead of "template"

Type: String

Examples:

template('template-key')
t('template-key')

years

The number of recent years to get results for. Defaults to 0.

Type: Integer

Example:

years('1')

This documentation is only for Aptuitiv CMS. Learn more.
Get Started With Aptuitiv