OpenTV ENTera & OpenTV Platform Documentation

Getting the search history

OpenTV Platform records each search that a user makes and allows client applications to get previous searches for the current user profile.

Each search term that it saves has an expiry date (by default, one week from when the search was performed). Search history records that pass their expiry date are automatically deleted.

A search history record will also expire if all the content that the search returns has also expired.

In addition, when the client application performs a search, it can specify that the query should not be saved in the search history. See Searching with Search Facade.

Request

To get the search history for the current user profile, send a GET request to:

https://<hostname>/search/v1/history

By default, this returns the last five searches.

Optional arguments

  • limit (in query params) – the number of searches to return. The default is five.

Response

A successful request to /search/v1/history?limit=1 will have a response that looks like this:

JSON
{
  "results": [
    {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "term": "Peppa Pig",
      "created": 1731497456
    }
  ],
  "totalRecords": 1
}

See also

Search Facade API documentation