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

# Explore survey questions

> Finds the survey questions and attributes that match a topic.



## OpenAPI

````yaml post /v2/spark-api/taxonomy/explore
openapi: 3.1.0
info:
  title: GWI Spark API v2
  version: 2.0.0
  description: >
    The Spark API gives programmatic access to GWI audience insights: datasets,
    location and timeframe filters, audiences, insights, survey questions, and
    workflow guidance.


    ## Authentication


    Send your API token in the `Authorization` header with every request.


    ## Typical workflow


    1. `GET /datasets` lists the datasets available to your account.

    2. `POST /global-filters` resolves the locations and timeframes in a prompt
    into `location_codes` and `wave_codes`.

    3. `POST /audiences/search` or `POST /audiences/generate` returns audience
    IDs. Use `POST /audiences/join` when you need an intersection or union of
    two or more existing audiences.

    4. `POST /insights/generate` generates insights, with the audience IDs as
    `enforced_audiences` and the codes from step 2.

    5. `GET /insights/{id}` returns the details and statistics of an insight.


    ## Requests


    Request bodies are JSON objects. Required fields must be present, values
    must have the documented type, and fields that are not documented are
    rejected. The maximum request body size is 4 MiB.


    ## Errors


    Errors are returned as problem details as defined in [RFC
    9457](https://www.rfc-editor.org/rfc/rfc9457), with `Content-Type:
    application/problem+json`. Use `type` to identify the error:


    | type | status | meaning |

    |---|---|---|

    | `https://api.globalwebindex.com/docs/spark-api/problems/invalid-request` |
    400 | The request body is not valid JSON. |

    | `https://api.globalwebindex.com/docs/spark-api/problems/invalid-params` |
    422 | The request does not match the request schema (a required field is
    missing, a value has the wrong type, or an unknown field is present), or a
    value is not accepted. |

    | `https://api.globalwebindex.com/docs/spark-api/problems/not-found` | 404 |
    The requested insight, audience, dataset or skill does not exist. |

    | `https://api.globalwebindex.com/docs/spark-api/problems/access-denied` |
    403 | Your account does not have access to the requested dataset or
    audience. |

    | `https://api.globalwebindex.com/docs/spark-api/problems/unprocessable` |
    422 | The request is valid but cannot be processed, for example because the
    datasets, audiences, locations or waves are not compatible. |

    | `https://api.globalwebindex.com/docs/spark-api/problems/timeout` | 504 |
    The request took too long to complete. Retry later. |

    | `https://api.globalwebindex.com/docs/spark-api/problems/cancelled` | 499 |
    The client cancelled the request. |

    | `https://api.globalwebindex.com/docs/spark-api/problems/internal` | 500 |
    An unexpected error occurred. `detail` contains a generic message. |


    A missing or invalid token (401), an unknown path (404) and a request body
    over 4 MiB (413) return a JSON object with a `message` field instead.


    Some endpoints report partial failures within a successful response, for
    example `results[].error` in `POST /insights/generate` and
    `failed_audiences` in `POST /audiences/generate`. These are not returned as
    HTTP errors.


    ## Workflow skills


    `GET /skills` and `GET /skills/{key}` return workflow guides intended for AI
    assistants that use this API. The guides refer to operations by name, and
    use the same field names as the requests and responses documented here. The
    endpoint for each name:


    | Name used in skills | Endpoint |

    |---|---|

    | `list_datasets` | `GET /v2/spark-api/datasets` |

    | `explore_datasets` | `POST /v2/spark-api/datasets/explore` |

    | `global_filters` | `POST /v2/spark-api/global-filters` |

    | `search_audiences` | `POST /v2/spark-api/audiences/search` |

    | `audience_generation` | `POST /v2/spark-api/audiences/generate` |

    | `join_audiences` | `POST /v2/spark-api/audiences/join` |

    | `generate_insights` | `POST /v2/spark-api/insights/generate` |

    | `explore_insight` | `GET /v2/spark-api/insights/{id}` |

    | `explore_taxonomy` | `POST /v2/spark-api/taxonomy/explore` |

    | `list_skills` | `GET /v2/spark-api/skills` |

    | `get_skills` | `GET /v2/spark-api/skills/{key}` |
servers:
  - url: https://api.globalwebindex.com
security: []
tags:
  - name: Datasets
    description: Datasets available to your account.
  - name: Filters
    description: Location and timeframe filters.
  - name: Audiences
    description: Searching and generating audiences.
  - name: Insights
    description: Generating insights and retrieving their details.
  - name: Taxonomy
    description: Survey questions and attributes.
  - name: Skills
    description: Workflow guidance for AI assistants.
paths:
  /v2/spark-api/taxonomy/explore:
    post:
      tags:
        - Taxonomy
      summary: Explore survey questions
      description: Finds the survey questions and attributes that match a topic.
      operationId: v2ExploreTaxonomy
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ExploreTaxonomyRequest'
            example:
              prompt: social media usage
              location_codes:
                - s2_44
              wave_codes:
                - q1_2025
      responses:
        '200':
          description: Successful response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExploreTaxonomyResponse'
              example:
                dataset:
                  code: ds-core
                  name: GWI Core
                  is_simulated: false
                audiences: []
                questions:
                  - label: Named Social Media Services Used
                    description: How often do you visit or use these services?
                    is_simulated: false
                  - label: Short video consumption in last month
                    description: Short video consumption in last month
                    is_simulated: false
                  - label: Number of Social Media Services Used
                    description: >-
                      This data is auto-generated based on responses to the
                      Social Media Services Used question
                    is_simulated: false
                attributes:
                  - text: I am using social media less.
                    is_simulated: false
                  - text: I use social media when watching TV online.
                    is_simulated: false
                  - text: I use social media to find content.
                    is_simulated: false
                  - text: >-
                      I use social media to see what's trending and being talked
                      about.
                    is_simulated: false
                message: ''
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '422':
          $ref: '#/components/responses/Unprocessable'
        '500':
          $ref: '#/components/responses/Internal'
        '504':
          $ref: '#/components/responses/Timeout'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    ExploreTaxonomyRequest:
      type: object
      properties:
        prompt:
          type: string
          description: Required. Topic to search for in survey questions and attributes.
        dataset_codes:
          type:
            - 'null'
            - array
          items:
            type: string
          description: Optional. Dataset codes from one tree in GET /datasets.
        enforced_audiences:
          type:
            - 'null'
            - array
          items:
            type: string
          description: Optional. Up to 10 audience UUIDs to scope the search.
        location_codes:
          type:
            - 'null'
            - array
          items:
            type: string
          description: Optional. global_filters.location_codes from POST /global-filters.
        wave_codes:
          type:
            - 'null'
            - array
          items:
            type: string
          description: Optional. global_filters.wave_codes from POST /global-filters.
        questions_k:
          type:
            - 'null'
            - integer
          description: Optional. Number of questions to return (default 5).
        attributes_k:
          type:
            - 'null'
            - integer
          description: Optional. Number of attributes to return (default 10).
      required:
        - prompt
      additionalProperties: false
    ExploreTaxonomyResponse:
      type: object
      properties:
        dataset:
          type: object
          properties:
            code:
              type: string
              description: Dataset code
            name:
              type: string
              description: Dataset name
            is_simulated:
              type: boolean
              description: True when this dataset is based on simulated data
          description: Root dataset used for the search
          required:
            - code
            - name
            - is_simulated
          additionalProperties: false
        audiences:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Audience UUID
              name:
                type: string
                description: Audience name
              description:
                type: string
                description: Audience description
              is_simulated:
                type: boolean
                description: True when this audience is based on simulated data
            required:
              - id
              - name
              - is_simulated
            additionalProperties: false
          description: Audiences applied to scope the search
        questions:
          type: array
          items:
            type: object
            properties:
              label:
                type: string
                description: Question label
              description:
                type: string
                description: Question description
              is_simulated:
                type: boolean
                description: True when this question is based on simulated data
            required:
              - label
              - description
              - is_simulated
            additionalProperties: false
          description: Matching survey questions
        attributes:
          type: array
          items:
            type: object
            properties:
              text:
                type: string
                description: Attribute text
              is_simulated:
                type: boolean
                description: True when this attribute is based on simulated data
            required:
              - text
              - is_simulated
            additionalProperties: false
          description: Matching attributes
        message:
          type: string
          description: Explanation when no questions or attributes matched
        error:
          type: string
          description: Set when no questions or attributes matched
      required:
        - dataset
        - audiences
        - questions
        - attributes
        - message
      additionalProperties: false
    Problem:
      type: object
      description: >-
        Problem details as defined in RFC 9457. Use `type` to identify the
        error; `title` summarises it and `detail` describes this occurrence.
      required:
        - type
        - title
        - status
      properties:
        type:
          type: string
          format: uri
          description: Identifier of the problem type.
        title:
          type: string
          description: Short summary of the problem type.
        status:
          type: integer
          description: HTTP status code.
        detail:
          type: string
          description: Description of this occurrence of the problem.
        instance:
          type: string
          description: Path of the request that produced the problem.
  responses:
    InvalidRequest:
      description: The request body is not valid JSON (`invalid-request`).
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: >-
              https://api.globalwebindex.com/docs/spark-api/problems/invalid-request
            title: Invalid request
            status: 400
            detail: 'invalid JSON body: unexpected end of JSON input'
            instance: /v2/spark-api/audiences/search
    Unauthorized:
      description: The API token is missing or invalid.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Unauthorized
    AccessDenied:
      description: >-
        Your account does not have access to the requested resource
        (`access-denied`).
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: >-
              https://api.globalwebindex.com/docs/spark-api/problems/access-denied
            title: Access denied
            status: 403
            detail: dataset access denied
            instance: /v2/spark-api/global-filters
    PayloadTooLarge:
      description: The request body exceeds 4 MiB.
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: Request Entity Too Large
    Unprocessable:
      description: >-
        The request is invalid (`invalid-params`) or cannot be processed
        (`unprocessable`).
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: >-
              https://api.globalwebindex.com/docs/spark-api/problems/invalid-params
            title: Invalid parameters
            status: 422
            detail: 'could not validate input: prompt should be a non empty string'
            instance: /v2/spark-api/global-filters
    Internal:
      description: An unexpected error occurred (`internal`).
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://api.globalwebindex.com/docs/spark-api/problems/internal
            title: Internal server error
            status: 500
            detail: >-
              There was an error processing your request. Please try again
              later.
            instance: /v2/spark-api/insights/generate
    Timeout:
      description: The request took too long to complete (`timeout`).
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://api.globalwebindex.com/docs/spark-api/problems/timeout
            title: Request timeout
            status: 504
            detail: >-
              service is taking longer than usual to respond: please try again
              in a few moments
            instance: /v2/spark-api/insights/generate
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization

````