{
  "openapi": "3.0.1",
  "info": {
    "title": "Search Term statistics",
    "description": "Provide access to search term statistics",
    "version": "9.1.20.0",
    "x-introduced": "9.1.0.0"
  },
  "servers": [
    {
      "url": "https://{hostname}:{port}/rest/admin/v2",
      "variables": {
        "port": {
          "default": "443",
          "enum": [
            "443",
            "8000"
          ]
        },
        "hostname": {
          "default": "localhost",
          "enum": [
            "localhost",
            "test.hcl.com"
          ]
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Search Term statistics",
      "description": "Provide access to search term statistics"
    }
  ],
  "paths": {
    "/search-term-statistics": {
      "get": {
        "summary": "Gets the search term associations that are of type LandingPageUrl.",
        "tags": [
          "Search Term statistics"
        ],
        "parameters": [
          {
            "name": "storeId",
            "in": "query",
            "description": "The unique numeric ID for identifying the store.",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-context-data": "storeId"
            },
            "x-context-data": "storeId"
          },
          {
            "name": "dataLanguageIds",
            "in": "query",
            "description": "The data language IDs.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "datestart",
            "in": "query",
            "description": "Date range should be in the format YYYY-DD-MMT00:00:00.001.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dateend",
            "in": "query",
            "description": "Date range should be in the format YYYY-DD-MMT00:00:00.001.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "topkeywords",
            "in": "query",
            "description": "The number of search results returned for the keyword for the most recent search performed within the reporting period.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "searchTerms",
            "in": "query",
            "description": "The keyword that customers typed in the search field on the site.",
            "schema": {
              "type": "string",
              "x-context-data": "searchTerms",
              "x-entity-path": "dataArea/searchTermAssociation[1]/searchTerms"
            },
            "x-context-data": "searchTerms",
            "x-entity-path": "dataArea/searchTermAssociation[1]/searchTerms"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "The maximum number of records to return.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "x-entity-path": "dataArea/get/maxItems"
            },
            "x-entity-path": "dataArea/get/maxItems"
          },
          {
            "name": "statType",
            "in": "query",
            "description": "The type of statistic, either TopHits or TopMisses.",
            "schema": {
              "type": "string",
              "x-context-data": "statisticsType",
              "x-entity-path": "dataArea/searchTermAssociation[1]/statistics/statisticsType"
            },
            "x-context-data": "statisticsType",
            "x-entity-path": "dataArea/searchTermAssociation[1]/statistics/statisticsType"
          }
        ],
        "responses": {
          "200": {
            "description": "The operation is successful.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SearchTermStatistic"
                }
              }
            },
            "x-entity-path": "dataArea/searchTermAssociation"
          }
        },
        "x-expression-template": "{_wcf.ap='{accessProfile}';_wcf.dataLanguageIds='{dataLanguageIds}';_sch.statistics.datestart='{datestart}';_sch.statistics.dateend='{dateend}';_sch.statistics.topkeywords='{topkeywords}';_sch.statistics.statisticsType='{statType}';_sch.searchTerms='{searchTerms}'}/SearchTermAssociation[(SearchTerm='{searchTerms}') and Statistics[(StatisticsType='{statType}')]]",
        "x-facade-client-class": "com.ibm.commerce.search.facade.client.SearchFacadeClient",
        "x-facade-client-method": "getSearchTermAssociation",
        "x-parameters": {
          "accessProfile": "IBM_Admin_Summary"
        },
        "x-request-bod-class": "com.ibm.commerce.search.facade.datatypes.GetSearchTermAssociationType"
      }
    }
  },
  "components": {
    "schemas": {
      "SearchTermStatistic": {
        "type": "object",
        "properties": {
          "associatedTerms": {
            "type": "string",
            "x-entity-path": "associatedTerms"
          },
          "id": {
            "type": "integer",
            "format": "int64",
            "x-entity-path": "uniqueID"
          },
          "languageId": {
            "type": "integer",
            "format": "int32",
            "x-entity-path": "languageIdentifier"
          },
          "percentage": {
            "type": "string",
            "x-entity-path": "statistics/percentage"
          },
          "searchResults": {
            "type": "integer",
            "format": "int32",
            "x-entity-path": "statistics/searchResults"
          },
          "searchSessions": {
            "type": "integer",
            "format": "int32",
            "x-entity-path": "statistics/searchSessions"
          },
          "searchTerms": {
            "type": "string",
            "x-entity-path": "searchTerms"
          },
          "statisticType": {
            "type": "string",
            "x-entity-path": "statistics/statisticsType"
          },
          "suggestion": {
            "type": "string",
            "x-entity-path": "statistics/suggestion"
          },
          "suggestionResults": {
            "type": "integer",
            "format": "int32",
            "x-entity-path": "statistics/suggestionResults"
          },
          "synonyms": {
            "type": "string",
            "x-entity-path": "statistics/synonyms"
          },
          "type": {
            "type": "string",
            "x-entity-path": "associationType"
          }
        },
        "description": "A search term statistic.",
        "x-entity-class": "com.ibm.commerce.search.facade.datatypes.SearchTermAssociationType"
      }
    },
    "securitySchemes": {
      "basicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  },
  "security": [
    {
      "basicAuth": []
    }
  ],
  "x-components": {}
}
