tag is parsed. Two tags cover both CORS-tagged and non-CORS fetches. -->How to build a Google Sheets API integration with Nango and Codex | Nango Blog<br>Theme
Table of Contents
This guide shows how to build a custom, customer-facing Google Sheets API integration with Nango and an AI coding agent (Codex, Claude Code, Cursor, or any other).<br>By the end of this guide, you will have:<br>A Google Sheets auth UI in your product (Nango Connect) so your customers can connect their own spreadsheets to your app.<br>A durable sync that imports rows from a connected spreadsheet and keeps them up to date as the sheet changes.<br>The ability to append rows to a customer’s spreadsheet and export reports to new spreadsheets, from your UI or from an AI agent in your product (via an MCP tool call).<br>Get the working example: the complete demo (frontend, backend, nango-integrations) is on GitHub at NangoHQ/google-sheets-api-integration. Clone it to run the whole thing end to end, or follow the guide below and let Codex generate the same functions in your own project.<br>Why is it hard to integrate the Google Sheets API into your app?<br>A production Google Sheets API integration needs a few decisions up front:<br>You need an OAuth app, not an API key: a Google Sheets API key only reads public spreadsheets. Accessing customer spreadsheets takes an OAuth 2.0 app with a consent screen, token refresh, and revocation handling.<br>Decide on scopes early, they set your verification timeline: most integrations request https://www.googleapis.com/auth/spreadsheets, the standard read-write scope. Google classifies it as sensitive, so your app needs verification to go live (unverified apps cap at 100 users), and while the OAuth app’s publishing status is Testing, refresh tokens expire every 7 days.<br>Plan around the rate limits: the quota is 300 read and 300 write requests per minute per project, and 60 per user. Past that, requests fail with 429: Too many requests, and Google’s limits page says exceeding quota is planned to incur charges later in 2026.<br>No Google Sheets webhooks: the v4 API has no push notifications. Change detection means polling, or Drive API files.watch channels that expire after at most one day and carry no payload.<br>Decide whether you want Google’s auto-formatting on writes: valueInputOption=USER_ENTERED parses values the way the Sheets UI does (strings can become numbers and dates), while RAW stores them as-is. Phone numbers and zip codes usually belong in RAW.<br>Keep the data you write contiguous: values.append looks for a “table” in the target range and writes after the last one it finds, so empty rows shift where new rows land.<br>Avoid hardcoding sheet names or ranges: customers rename tabs and reorder columns, which breaks A1 ranges (Unable to parse range). Store the stable numeric sheetId, resolve the current tab name with spreadsheets.get before building ranges, and read headers instead of assuming column order.<br>Building all of this by hand takes weeks. With Nango and a coding agent like Codex, the same Google Sheets API integration can ship in about an hour.<br>Why use Nango for a Google Sheets API integration<br>Nango is the integration platform where coding agents build API integrations. An agent like Codex writes the integration as code in your repo, and Nango’s runtime runs it with managed auth, retries, and observability across 800+ APIs.<br>For a Google Sheets integration, we will use these Nango features:<br>OAuth for Google Sheets: your product gets a customizable, white-label auth UI where customers connect their Google Sheets account, while Nango handles token storage, refresh, and encryption behind it.<br>A function builder skill for Codex: to build your integration logic and flows, Codex uses the Nango function builder skill. It researches the Sheets API, writes your actions and syncs from a prompt, tests them against a real Google Sheets connection, and iterates until the integration works end to end.<br>Note: The Nango skill also works with other coding agents like Claude Code, Cursor, Gemini CLI, etc.<br>Integrations infrastructure for every use case: Actions: one-off operations on a customer’s sheet, like appending a row or creating a spreadsheet.<br>Syncs: scheduled functions that keep spreadsheet rows flowing into your app.<br>Webhooks: route external events, like Drive file-change notifications, to your integration.<br>MCP server: exposes your deployed actions as tools for the AI agents in your product.
Nango also has pre-built actions and syncs for Google Sheets. They cover the common operations (a worksheet rows sync, appending values, reading values, upserting rows, creating spreadsheets) and you can enable them from your dashboard and use them right away, without building anything. Or have Codex clone and customize them to fit your use case.<br>Prerequisites<br>Sign up for Nango (the free tier is enough for development).<br>Add Google Sheets as an integration on the Nango dashboard. For this tutorial, use Nango’s pre-configured developer app: activate...