OpenTV ENTera & OpenTV Platform Documentation
26.26_Q2 25.52_Q4 25.26_Q2 25.12_Q1 24.50_Q4 24.38_Q3 24.26_Q2 23.50_Q4 23.24_Q2 23.12_Q1 22.50_Q4 22.38_Q3 22.24_Q2
26.26_Q2 25.52_Q4 25.26_Q2 25.12_Q1 24.50_Q4 24.38_Q3 24.26_Q2 23.50_Q4 23.24_Q2 23.12_Q1 22.50_Q4 22.38_Q3 22.24_Q2

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