Quickstart

    Read a Google Sheet as JSON

    SheetsDB reads a public Google Sheet and returns its rows as JSON through one authenticated endpoint.

    By Zainul Ariffin
    1

    Make the sheet available

    Share the Sheet so anyone with the link can view it, or publish it to the web. SheetsDB cannot read private Sheets.

    2

    Create an API key

    Sign in with Google, open your dashboard, and create an API key. Copy the key when it appears because SheetsDB shows it only once.

    3

    Send your first request

    Send the Sheet URL or ID and indicate whether the first row contains headers. SheetsDB returns a JSON array.

    Request

    Replace the API key and Sheet reference, then run this request from your server or local development environment.

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

    Response

    With hasHeader: true, values in the first row become object keys.

    [
      {
        "name": "Ada",
        "role": "Engineer"
      },
      {
        "name": "Grace",
        "role": "Researcher"
      }
    ]

    Try it with your own sheet

    The sandbox builds the same request, previews its headers and body, and shows the response without leaving SheetsDB.