# Using Claude Code with Google Sheets

DevFeed: [Using Claude Code with Google Sheets](<https://devfeed.tech/articles/using-claude-code-with-google-sheets-20520.md>)

Original publisher: [Read original article](<https://code.dblock.org/2025/07/30/using-claude-code-with-google-sheets.html>)

Author: Daniel Doubrovkine (dblock@dblock.org)

Published: 2025-07-30T01:00:00Z

Content type: tutorial

Language: en

Sources: [Daniel Doubrovkine](<https://devfeed.tech/sources/daniel-doubrovkine.md>)

Topics: [Claude Code](<https://devfeed.tech/topics/claude-code.md>), [Google](<https://devfeed.tech/topics/google.md>), [API](<https://devfeed.tech/topics/api.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [cURL](<https://devfeed.tech/topics/curl.md>), [Code](<https://devfeed.tech/topics/code.md>), [Cloud](<https://devfeed.tech/topics/cloud.md>)

Tags: [ai](<https://devfeed.tech/tags/ai.md>), [api](<https://devfeed.tech/tags/api.md>), [claude](<https://devfeed.tech/tags/claude.md>), [claude-code](<https://devfeed.tech/tags/claude-code.md>), [cli](<https://devfeed.tech/tags/cli.md>), [cloud](<https://devfeed.tech/tags/cloud.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [curl](<https://devfeed.tech/tags/curl.md>), [google](<https://devfeed.tech/tags/google.md>), [install](<https://devfeed.tech/tags/install.md>), [tools](<https://devfeed.tech/tags/tools.md>), [troubleshooting](<https://devfeed.tech/tags/troubleshooting.md>)

## AI overview

This tutorial shows how to connect Claude Code to Google Sheets using Google Cloud, the Google Sheets API, Google Cloud CLI authentication with Drive access, and a curl request. It also demonstrates asking Claude Code to analyze spreadsheet data and describes authentication and project-configuration troubleshooting.

## Source excerpt

Let's get Claude Code to connect to Google Sheets. We'll use this Google Sample Spreadsheet. Go to the Google Cloud Console, create a new project, and enable the Google Sheets API on it. Install the Google Cloud CLI. brew install google-cloud-sdk Choose the newly created project on the command line. ~$ gcloud config set project gsheetscli Updated property [core/project]. Login again, but this time enable Google Drive access. gcloud auth login --enable-gdrive-access You can now access the spreadsheet with curl. curl -H "Authorization: Bearer $(gcloud auth print-access-token)" \ "https://sheets.googleapis.com/v4/spreadsheets/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/values/Class%20Data" { "range": "'Class Data'!A1:V101", "majorDimension": "ROWS", "values": [ [ "Student Name", "Gender", "Class Level", "Home State", "Major", "Extracurricular Activity" ], ... ] } Let's ask Claude to do something useful. Let's ask Claude to do something useful. ~$ claude ╭───────────────────────────────────────────────────╮ │ ✻ Welcome to Claude Code! │ ╰───────────────────────────────────────────────────╯ > analyze the distribution of extracurricular activities in https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit?gid=0#gid=0 ⏺ I'll analyze the distribution of extracurricular activities from the Google Sheets document you provided. ⏺ Fetch(https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit?gid=0#gid=0) ⎿ Received 193.5KB (200 OK) ⏺ The extracurricular activities distribution shows perfect balance: Activity Distribution: - Drama Club: 5 students (16.7%) - Basketball: 5 students (16.7%) - Debate: 5 students (16.7%) - Lacrosse: 5 students (16.7%) - Baseball: 5 students (16.7%) - Track & Field: 5 students (16.7%) Total: 30 students across 6 activities Each activity has exactly 5 students participating, resulting in an even distribution with no activity being more popular than others in this dataset. Whoa. Troubles