---
updatedAt: 2025-06-04T21:28:33.000Z
agentTools:
  projectIndex: https://developer.simpplr.com/llms.txt
---

# Searches

Use this API to get Searches

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "simpplr-api-gateway",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.ec.simpplr.com/api"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "oauth2",
        "flows": {}
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/analytics/searches": {
      "get": {
        "summary": "Searches",
        "description": "Use this API to get Searches",
        "operationId": "searches",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "description": "Time from which the News Letters data need to be selected",
            "required": true,
            "schema": {
              "type": "string",
              "default": "2020-12-27"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Time till which the News Letters data need to be selected",
            "required": true,
            "schema": {
              "type": "string",
              "default": "2022-01-26"
            }
          },
          {
            "name": "group-by",
            "in": "query",
            "description": "Group the Result according to group-by value",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "day",
                "week",
                "month"
              ],
              "default": "day"
            }
          },
          {
            "name": "x-user-email",
            "in": "header",
            "description": "User's email to login into Salesforce",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "filter-by",
            "in": "query",
            "description": "Filter to apply to results",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                null,
                "department",
                "location"
              ],
              "default": null
            }
          },
          {
            "name": "filter-value",
            "in": "query",
            "description": "Value by which result has to filter",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"statusCode\": 200,\n    \"status\": \"success\",\n    \"message\": \"\",\n    \"data\": {\n        \"data\": {\n            \"totalCount\": 18,\n            \"searchesOverTime\": [\n                {\n                    \"value\": 11,\n                    \"label\": \"2021-08-25\"\n                },\n                {\n                    \"value\": 1,\n                    \"label\": \"2021-09-09\"\n                },\n                {\n                    \"value\": 6,\n                    \"label\": \"2021-10-29\"\n                }\n            ]\n        },\n        \"csvUrl\": \"https://ajay-hada-dev-ed--c.visualforce.com/apex/Reports?action=getSearches&to=2022-01-26&from=2020-12-27&groupBy=day\"\n    }\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 200,
                      "default": 0
                    },
                    "status": {
                      "type": "string",
                      "example": "success"
                    },
                    "message": {
                      "type": "string",
                      "example": ""
                    },
                    "data": {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "object",
                          "properties": {
                            "totalCount": {
                              "type": "integer",
                              "example": 18,
                              "default": 0
                            },
                            "searchesOverTime": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "value": {
                                    "type": "integer",
                                    "example": 11,
                                    "default": 0
                                  },
                                  "label": {
                                    "type": "string",
                                    "example": "2021-08-25"
                                  }
                                }
                              }
                            }
                          }
                        },
                        "csvUrl": {
                          "type": "string",
                          "example": "https://ajay-hada-dev-ed--c.visualforce.com/apex/Reports?action=getSearches&to=2022-01-26&from=2020-12-27&groupBy=day"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "401",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"statusCode\": 401,\n    \"status\": \"error\",\n    \"message\": \"SESSION_TIMEOUT\",\n    \"data\": {}\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "statusCode": {
                      "type": "integer",
                      "example": 401,
                      "default": 0
                    },
                    "status": {
                      "type": "string",
                      "example": "error"
                    },
                    "message": {
                      "type": "string",
                      "example": "SESSION_TIMEOUT"
                    },
                    "data": {
                      "type": "object",
                      "properties": {}
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```