> ## Documentation Index
> Fetch the complete documentation index at: https://sdk.grid.is/llms.txt
> Use this file to discover all available pages before exploring further.

# Get labels

> Retrieves text that labels cells and ranges in a workbook.

Labels are textual identifiers that convey the semantic meaning of cells and ranges within a workbook. They are extracted from the structure, layout, and content in a workbook's sheets.

<Note>This endpoint is in beta and is subject to change.</Note>


## OpenAPI

````yaml get /v1/workbooks/{id}/labels
openapi: 3.1.0
info:
  title: GRID API
  summary: Spreadsheets run the world. Now you can run spreadsheets.
  description: >-
    GRID's API transforms spreadsheets into powerful, programmable APIs. Our
    platform supports seamless integration of spreadsheet data into your
    applications, supporting dynamic interactions with spreadsheets, including
    real-time data querying with ephemeral updates.
  version: 1.0.0
servers:
  - url: https://api.grid.is
security: []
tags:
  - name: workbooks
    description: Interact with workbooks and their data
paths:
  /v1/workbooks/{id}/labels:
    get:
      tags:
        - workbooks
      summary: Retrieves text that labels cells and ranges in a workbook
      description: >-
        Retrieve labels automatically detected for cells and ranges in the
        workbook.
      operationId: get_workbook_labels
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
            title: Unique workbook id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkbookLabelsResponse'
        '400':
          description: Error returned when you make a bad request
          content:
            application/json:
              example:
                error_code: invalid_json
                error_message: Bad request
                error_details: RequestJsonParsingFailed
        '403':
          description: Error returned when you don't have permission to query a workbook
          content:
            application/json:
              example:
                error_message: Forbidden
                error_details: Only API keys can access the workbook engine API
        '429':
          description: Error returned when you exceed your API rate limit
          content:
            application/json:
              example:
                error_code: rate_limit_exceeded
                error_message: Rate limit exceeded
                error_details: 'Retry after: 60'
      security:
        - apiKey: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Grid from '@grid-is/api';

            const client = new Grid({
              apiKey: 'My API Key',
            });

            const response = await client.beta.getWorkbookLabels('id');

            console.log(response.workbook_id);
        - lang: Python
          source: |-
            from grid_api import Grid

            client = Grid(
                api_key="My API Key",
            )
            response = client.beta.get_workbook_labels(
                "id",
            )
            print(response.workbook_id)
        - lang: Java
          source: |-
            package is.grid.api.example;

            import is.grid.api.client.GridClient;
            import is.grid.api.client.okhttp.GridOkHttpClient;
            import is.grid.api.models.beta.BetaGetWorkbookLabelsParams;
            import is.grid.api.models.beta.BetaGetWorkbookLabelsResponse;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    GridClient client = GridOkHttpClient.fromEnv();

                    BetaGetWorkbookLabelsResponse response = client.beta().getWorkbookLabels("id");
                }
            }
components:
  schemas:
    WorkbookLabelsResponse:
      properties:
        created:
          type: string
          format: date-time
          title: Created
          description: The date/time the labels were detected and stored
        workbook_id:
          type: string
          title: Workbook Id
          description: The id of the workbook the labels belong to
        workbook_version:
          type: integer
          title: Workbook Version
          description: The version of the workbook the labels belong to
        labels:
          items:
            $ref: '#/components/schemas/CellLabel'
          type: array
          title: Labels
          description: The labels associated with the workbook
      type: object
      required:
        - created
        - workbook_id
        - workbook_version
        - labels
      title: WorkbookLabelsResponse
    CellLabel:
      properties:
        at:
          type: string
          title: At
          description: The cell address/reference which the label applies to
        text:
          type: string
          title: Text
          description: The label string
        for:
          type: string
          title: For
          description: The cell address/reference which the label applies to
        type:
          anyOf:
            - type: string
            - type: 'null'
          title: Type
          description: >-
            The type of the label, almost always text, not to be confused with
            cell type
      type: object
      required:
        - at
        - text
        - for
      title: CellLabel
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: JWT

````