Skip to main content

Create a Connection

A connection maps a data source to a Sheet Best API URL. Choose the source for the data you need:

  1. From a Google Sheets URL (the sheet must be shared by link).
  2. From a Google Drive folder — a read-only listing of file IDs, names, and links.
  3. By uploading a spreadsheet file to Sheet Best.

A fourth option, Connect with Drive (beta), connects one private spreadsheet without making it public. It is separate from the folder listing.

Google Sheets connections use /sheets/<connection-id>, Drive folders use /drives/<connection-id>, and uploads use /uploads/<connection-id>. Always copy the Connection URL from the dashboard; its ID is the Sheet Best connection ID, not the Google file or folder ID.

Open the Sheet Best dashboard and click + CONNECTION to start.

Add Connection

From a Google Sheets URL​

  1. In Google Sheets, click Share and grant Anyone with the link → Viewer (or Editor if you need writes). See Prepare your Sheet for screenshots.

  2. Copy the sheet URL from the browser address bar.

  3. In the Sheet Best dashboard, name the connection, choose Google Sheets as the Connection Origin, paste the URL, and click CONNECT.

    Connection Form

  4. Click DETAILS on the new connection and copy the Connection URL.

    Copy Connection URL

From a Google Drive folder​

Use a folder connection as a JSON file catalog. For example, use the returned names, IDs, and links to build:

  • A download list for shared documents.
  • An image gallery for accessible image files.
  • An asset directory for a website or application.

Links depend on each file's sharing settings and type. Check that they work for your intended download or display; Google-native documents may need a different export or viewing URL.

:::note Spreadsheet rows need a spreadsheet connection A folder connection does not read spreadsheet cells or combine spreadsheets into one API. To read a spreadsheet's rows, create a Google Sheets connection for that spreadsheet, using its URL or the private-sheet picker. Each spreadsheet connection counts separately against your plan's connection limit. :::

Your plan must include Google Drive folder connections. The Starter/Free trial supports Google Sheets connections only. See plans and pricing.

  1. In Google Drive, right-click the folder and select Get Link.

    Right Click to Share

  2. Set the folder permission to Anyone with the link → Viewer and copy the link. The files you want to list must also be accessible through sharing.

    Google Drive Share

  3. In the dashboard, choose Google Drive as the Connection Origin, paste the folder link, and click CONNECT.

  4. Open DETAILS and copy the Connection URL. Test it with:

    curl https://api.sheetbest.com/drives/YOUR_CONNECTION_ID

    A populated folder returns file metadata, sorted by name:

    [
    {
    "id": "GOOGLE_FILE_ID",
    "name": "product-photo.png",
    "link": "https://drive.google.com/uc?export=view&id=GOOGLE_FILE_ID"
    }
    ]

    The returned id is a Google file ID. It is not a Sheet Best connection ID or an endpoint for that spreadsheet's rows. An accessible empty folder returns [].

One folder connection uses one connection slot. Newly added files can appear in its listing after the cache refreshes, without creating new Sheet Best connections. This does not give those files spreadsheet-row APIs. The default output is an array of records; _format=index only reshapes the same file metadata. Its index keys are not stable file identifiers; use id to identify a file.

:::caution Listing limits The connector lists direct folder children without traversing subfolders. It currently retrieves only the first Google Drive results page, so larger listings may be incomplete. It does not provide a continuation token or a way to fetch subsequent pages. :::

A Valid URL status does not confirm that Google can read the folder. The form's Read Only label is not a measurement of its Google sharing permissions. Folder connections are read-only regardless of Editor sharing.

By uploading a file​

Use this for one-off spreadsheets that don't live in Google Drive.

  1. In the dashboard, choose File Upload as the Connection Origin.

  2. Pick the spreadsheet file from your computer in the File field, then click CONNECT.

    Upload Sheet

  3. Open DETAILS and copy the Connection URL.

    Upload Sheet URL

Test your connection​

The following examples are for a Google Sheets connection. For an upload, use its copied /uploads/<connection-id> URL. For a folder, use the /drives/<connection-id> example above.

curl https://api.sheetbest.com/sheets/YOUR_SHEET_ID

For spreadsheet connections, you should get back an array of objects, one per spreadsheet row. Folder connections return one metadata record per listed file instead.

Permissions and writes​

Write support depends on the connection type, source permissions, allowed methods, and plan:

  • Google Sheets URL: needs Editor sharing.
  • Google Drive folder: read-only. POST, PUT, PATCH, and DELETE return 405 Method Not Allowed, even if the folder is shared with Editor access.
  • File upload: supports writes to the uploaded data.
  • Connect with Drive: supports spreadsheet writes when the connected Google account has edit access.

For spreadsheet connections, a write failure because the underlying sheet isn't editable can return the write_error code. This is separate from a folder's unsupported-method response. See Error Codes.

Protect the API with a key​

By default, the connection URL is reachable by anyone who has it. On a plan that supports API keys, require an X-Api-Key header by clicking Edit on the connection, opening Advanced Settings, and enabling the API key.

Edit Connection

Protect Your API

Full details in Authentication.

Next​