> ## Documentation Index
> Fetch the complete documentation index at: https://docs.platform.statista.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Search

Semantically search in Consumer Insights survey data for questions and answers.

The results are grouped by question. If only an answer matches, the corresponding question is added to the result.

The search works best with short search terms that cover only one aspect, such as “gen z” or “headphone brands”.
Filtering by country can be done when the actual survey cross-table data is fetched, by providing a geo location.
Adding a country to the search query degrades result quality.


## OpenAPI

````yaml GET /v1/search/consumer-insights
openapi: 3.0.0
info:
  title: The Statista Data API
  contact:
    name: API Support
    email: api@statista.com
  version: 2.8.0
  description: >-
    The Statista search API provides a way to discover statistical,
    market-insights, and consumer-insights data
servers:
  - url: https://api.statista.ai/
    description: Single Server endpoint
    variables: {}
security:
  - ApiKeyAuth: []
tags: []
paths:
  /v1/search/consumer-insights:
    get:
      operationId: consumerInsights
      parameters:
        - name: q
          in: query
          required: true
          description: The query string to search for.
          schema:
            type: string
            minLength: 1
            maxLength: 1000
          explode: false
        - name: size
          in: query
          required: false
          description: The maximum number of search results returned.
          schema:
            type: integer
            format: uint32
            minimum: 1
            maximum: 25
            default: 10
          explode: false
      responses:
        '200':
          description: The request has succeeded.
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Api.Response.Search.ConsumerInsightsSearchResults
        '400':
          description: The server could not understand the request due to invalid syntax.
        '401':
          description: Access is unauthorized.
        '403':
          description: Access is forbidden.
components:
  schemas:
    Api.Response.Search.ConsumerInsightsSearchResults:
      type: object
      required:
        - results
      properties:
        results:
          type: array
          items:
            $ref: >-
              #/components/schemas/Api.Response.Search.ConsumerInsightsSearchResult
    Api.Response.Search.ConsumerInsightsSearchResult:
      type: object
      required:
        - question_id
        - indicator
        - label
        - question_type
        - metadata
        - answers_subset
        - total_answers
      properties:
        question_id:
          type: string
          description: A unique question ID.
        indicator:
          type: string
          description: Short summary of what this question is about.
        label:
          type: string
          description: Exact phrasing of the question shown to survey respondents.
        question_type:
          type: string
          description: >-
            What kind of questions / answer combination was asked, e.g.
            'multi-pick'.
        metadata:
          allOf:
            - $ref: '#/components/schemas/Api.Response.Search.MetaData'
          description: Additional data describing details of the survey.
        answers_subset:
          type: array
          items:
            $ref: '#/components/schemas/Api.Response.Search.Answer'
          description: List of answers related to the question.
        total_answers:
          type: integer
          format: uint32
          description: The number of available answer options.
    Api.Response.Search.MetaData:
      type: object
      required:
        - min_year
        - max_year
      properties:
        min_year:
          type: integer
          format: uint16
          description: Start year, when this question was first asked.
        max_year:
          type: integer
          format: uint16
          description: Last year, when this question was asked.
    Api.Response.Search.Answer:
      type: object
      required:
        - answer_id
        - label
        - order
        - code
      properties:
        answer_id:
          type: string
          description: A unique answer ID.
        label:
          type: string
          description: Description of the answer.
        order:
          type: integer
          format: uint16
          description: Sort order of the answers in the survey.
        code:
          type: integer
          format: uint16
          description: >-
            Numeric ID part of the answer ID, which consists of the question ID,
            '#', and the numeric ID, such as 'v0013g_demo_generation#42'.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key

````