Google Sheets API guide

    Turn a Google Sheet into a JSON API

    Share the Google Sheet for anyone with the link to view, create a SheetsDB API key, and send the Sheet URL to one POST endpoint. SheetsDB returns each row as a JSON object.

    By Zainul Ariffin
    Short answer: SheetsDB works with a public shared URL, a published-to-web URL, or the spreadsheet ID. Set hasHeader to true when the first row contains column names.

    1. Make the Sheet readable

    Open Share in Google Sheets. Under General access, choose Anyone with the link and Viewer. SheetsDB cannot open a Sheet that requires a signed-in Google account.

    2. Create an API key

    Sign in to SheetsDB, open the dashboard, and create an API key. Copy it when it appears. The full key is not shown again.

    3. Send the request

    cURL
    curl --request POST \
      --url https://www.sheetsdb.io/api/v1/getsheet \
      --header 'Authorization: Bearer YOUR_API_KEY' \
      --header 'Content-Type: application/json' \
      --data '{
        "sheetRef": "YOUR_PUBLIC_GOOGLE_SHEET_URL",
        "hasHeader": true
      }'

    The response is a JSON array. If hasHeader is true, the first row supplies the property names. Without headers, SheetsDB uses column_1, column_2, and so on.

    Common errors

    • UNAUTHORIZED: the bearer API key is missing, invalid, or revoked.
    • SHEET_UNAVAILABLE: the URL is wrong or the Sheet is not public.
    • RESPONSE_TOO_LARGE: the Sheet exceeds the response safety ceiling.

    Use the X-Request-ID response header when asking for support. The limits and errors page lists every stable code.

    What this setup does not cover

    SheetsDB is read-only and does not support private Sheets, cell formatting, formulas as formulas, or writes. Use the Google Sheets API when you need those features.