> ## 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.

# List available datasets

> Returns the datasets available for chat and insights.
The route returns a hierarchical tree of folder and dataset nodes so clients can discover valid root/child dataset relationships.
When the caller has no dataset access, the response is HTTP 200 with an empty array.




## OpenAPI

````yaml get /v1/spark-api/datasets
openapi: 3.0.0
info:
  title: SPARK API
  description: Spark REST API.
  version: 1.0.0
servers:
  - url: https://api.globalwebindex.com
security: []
paths:
  /v1/spark-api/datasets:
    get:
      tags:
        - Datasets
      summary: List available datasets
      description: >
        Returns the datasets available for chat and insights.

        The route returns a hierarchical tree of folder and dataset nodes so
        clients can discover valid root/child dataset relationships.

        When the caller has no dataset access, the response is HTTP 200 with an
        empty array.
      operationId: listDatasets
      responses:
        '200':
          description: >
            Successful response.


            The response is an array of hierarchical tree nodes. Returns an
            empty array when the caller has no dataset access.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DatasetTreeNode'
              example:
                - code: ds-example
                  name: GWI Example
                  type: dataset
                  description: An example dataset.
                  url: https://help.globalwebindex.com/example/dataset/ref
                  children:
                    - id: 1
                      name: GWI Folder
                      type: folder
                      children:
                        - code: ds-example-child
                          name: GWI Example Child
                          description: An example child dataset.
                          url: >-
                            https://help.globalwebindex.com/example/dataset/child/ref
                          type: dataset
                          children: []
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    DatasetTreeNode:
      description: >
        A folder or dataset node returned by `/v1/spark-api/datasets`. Use the
        `type` field to determine which variant a node is.
      oneOf:
        - $ref: '#/components/schemas/FolderNode'
        - $ref: '#/components/schemas/DatasetNode'
      discriminator:
        propertyName: type
        mapping:
          folder: '#/components/schemas/FolderNode'
          dataset: '#/components/schemas/DatasetNode'
    Unauthorized:
      type: object
      description: Response payload for unauthorized.
      properties:
        message:
          type: string
      example:
        message: Unauthorized
    InternalServerError:
      type: object
      description: Response payload for internal server error.
      properties:
        code:
          type: integer
          description: The HTTP status code.
        message:
          type: string
          description: Generic error reason.
      example:
        code: 500
        message: There was an error processing your request. Please try again later.
    FolderNode:
      type: object
      title: Folder
      required:
        - type
        - name
      properties:
        id:
          type: integer
          description: Folder identifier.
        name:
          type: string
          description: Folder display name.
        type:
          type: string
          enum:
            - folder
          description: Node type discriminator.
        children:
          type: array
          description: Child folder or dataset nodes.
          items:
            $ref: '#/components/schemas/DatasetTreeNode'
      example:
        id: 1
        name: GWI Folder
        type: folder
        children: []
    DatasetNode:
      type: object
      title: Dataset
      required:
        - type
        - code
        - name
      properties:
        code:
          type: string
          description: Dataset code.
        name:
          type: string
          description: Dataset display name.
        description:
          type: string
          description: Dataset description.
        url:
          type: string
          description: Dataset URL.
        type:
          type: string
          enum:
            - dataset
          description: Node type discriminator.
        children:
          type: array
          description: Child folder or dataset nodes.
          items:
            $ref: '#/components/schemas/DatasetTreeNode'
      example:
        code: ds-example-child
        name: GWI Example Child
        description: An example child dataset.
        url: https://help.globalwebindex.com/example/dataset/child/ref
        type: dataset
        children: []
  securitySchemes:
    ApiKeyAuth:
      in: header
      name: Authorization
      type: apiKey

````