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

# Analyze Google Sheets import source

> List the tabs (worksheets) of a picked Google spreadsheet before import



## OpenAPI

````yaml /swagger.json post /base/import-google-sheet/analyze
openapi: 3.0.0
info:
  version: 1.0.0
  title: Teable App
  description: Manage Data as easy as drink a cup of tea
  x-logo:
    backgroundColor: '#F0F0F0'
    altText: Teable logo
servers:
  - url: https://app.teable.ai/api
security: []
tags:
  - name: base
    x-group: project
  - name: base node
    x-group: project node
  - name: base-share
    x-group: project-share
paths:
  /base/import-google-sheet/analyze:
    post:
      tags:
        - base
      summary: analyze a Google Sheets import source
      description: List the tabs (worksheets) of a picked Google spreadsheet before import
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                integrationId:
                  type: string
                  description: >-
                    Id of a connected Google Sheets user integration; its access
                    token is resolved (and refreshed) server-side and never
                    leaves the server for API calls.
                accessToken:
                  type: string
                  minLength: 1
                  description: >-
                    Raw Google OAuth access token with the drive.file scope
                    (never persisted by the server). Ignored when integrationId
                    is provided.
                spreadsheetId:
                  type: string
                  minLength: 1
                  description: >-
                    Google Drive file id of the spreadsheet, as returned by the
                    Google Picker. The OAuth grant only covers files the user
                    picked (drive.file scope).
                includeSampleRows:
                  type: boolean
                  description: >-
                    Also return each tab's first few rows as cell texts (one
                    extra Sheets API request). Off by default: callers that only
                    list tabs should not pay for it.
              required:
                - spreadsheetId
      responses:
        '200':
          description: Returns the spreadsheet title and its tabs with grid sizes.
          content:
            application/json:
              schema:
                type: object
                properties:
                  spreadsheet:
                    type: object
                    properties:
                      id:
                        type: string
                      title:
                        type: string
                      sheets:
                        type: array
                        items:
                          type: object
                          properties:
                            sheetId:
                              type: number
                            title:
                              type: string
                            rowCount:
                              type: number
                            columnCount:
                              type: number
                            sampleRows:
                              type: array
                              items:
                                type: array
                                items:
                                  type: string
                          required:
                            - sheetId
                            - title
                            - rowCount
                            - columnCount
                    required:
                      - id
                      - title
                      - sheets
                required:
                  - spreadsheet
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          source: |-
            curl --request POST \
              --url https://app.teable.ai/api/base/import-google-sheet/analyze \
              --header 'Authorization: Bearer REPLACE_BEARER_TOKEN' \
              --header 'content-type: application/json' \
              --data '{"integrationId":"string","accessToken":"string","spreadsheetId":"string","includeSampleRows":true}'
        - lang: JavaScript
          source: >-
            const url =
            'https://app.teable.ai/api/base/import-google-sheet/analyze';

            const options = {
              method: 'POST',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              },
              body: '{"integrationId":"string","accessToken":"string","spreadsheetId":"string","includeSampleRows":true}'
            };


            try {
              const response = await fetch(url, options);
              const data = await response.json();
              console.log(data);
            } catch (error) {
              console.error(error);
            }
        - lang: Node.js
          source: |-
            const http = require('https');

            const options = {
              method: 'POST',
              hostname: 'app.teable.ai',
              port: null,
              path: '/api/base/import-google-sheet/analyze',
              headers: {
                Authorization: 'Bearer REPLACE_BEARER_TOKEN',
                'content-type': 'application/json'
              }
            };

            const req = http.request(options, function (res) {
              const chunks = [];

              res.on('data', function (chunk) {
                chunks.push(chunk);
              });

              res.on('end', function () {
                const body = Buffer.concat(chunks);
                console.log(body.toString());
              });
            });

            req.write(JSON.stringify({
              integrationId: 'string',
              accessToken: 'string',
              spreadsheetId: 'string',
              includeSampleRows: true
            }));
            req.end();
        - lang: Python
          source: >-
            import http.client


            conn = http.client.HTTPSConnection("app.teable.ai")


            payload =
            "{\"integrationId\":\"string\",\"accessToken\":\"string\",\"spreadsheetId\":\"string\",\"includeSampleRows\":true}"


            headers = {
                'Authorization': "Bearer REPLACE_BEARER_TOKEN",
                'content-type': "application/json"
            }


            conn.request("POST", "/api/base/import-google-sheet/analyze",
            payload, headers)


            res = conn.getresponse()

            data = res.read()


            print(data.decode("utf-8"))
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````