# Google Sheets

> Use the Google Sheets integration API locally with LocalCloud: connection settings, supported workflows, known limits, and code examples.
>
> Source: https://local.cloud/services/google-sheets/

Google Sheets exposes spreadsheet data through an API. LocalCloud provides a read-only values API for testing applications that consume tabular fixtures.

## Typical uses

Use when an application consumes small, human-maintained lookup tables through A1 ranges. Seed read-only spreadsheet fixtures locally to test how those rows are interpreted.

Examples

- Spreadsheet-backed lookup data
- Deterministic fixtures for data consumers

Auxiliary API connection

Environment variable

`SHEETS_EMULATOR_HOST=http://localhost:5380`

Runtime details

- **Endpoints:** HTTP/REST :5380
- **Minimum tier:** Community
- **Persistence:** metadata
- **Implementation:** Local Facade

## Example usage

Service ID: `sheets`. Starts by default. Use an already running LocalCloud runtime for the examples below.

Export the local project and mapped endpoints in your client process, then use the client settings below. [First-time setup](https://local.cloud/docs/)

```bash
# Export GOOGLE_CLOUD_PROJECT and SHEETS_EMULATOR_HOST
eval "$(localcloud env)"
```

HTTP:

### HTTP

### Read a spreadsheet range

Read a seeded spreadsheet range; Sheets lets an application consume human-maintained lookup tables.

Use the ID and A1 range from a seeded spreadsheet. Google Sheets exposes read-only fixture values locally.

#### Configure HTTP

```bash
export SPREADSHEET_ID="your-seeded-spreadsheet-id"
export A1_RANGE="Sheet1!A1:B3"
```

#### Run in your terminal

```bash
curl --fail-with-body --get "${SHEETS_EMULATOR_HOST%/}/v4/spreadsheets/${SPREADSHEET_ID}/values/${A1_RANGE}"
```

#### Verify the result

The response contains the values for the seeded spreadsheet ID and exact A1 range. Seed the fixture first; this read-only request does not create a spreadsheet.

Verify a resource workflow by creating isolated state, performing the operation, and reading the result back. Run cleanup even after a failure; delete only test-owned resources.

Connection failed? Check `localcloud status --verbose`, enabled services, and client exports. Stop accidental Google Cloud calls; correct local routing before retrying.

## Documented workflows

- ### Exact A1-range reads: values.get and values.batchGet

    Seed a spreadsheet ID and exact A1 range, then call values.get or values.batchGet. Compare the returned rows with the lookup data expected by the consuming application.

## Service boundaries

- Read-only auxiliary fixture API
- No spreadsheet metadata, writes, range slicing, or formulas
- No Google OAuth authority

## Code examples and integrations

- [Build an integration test loop](https://local.cloud/gcp-integration-testing/): Start the runtime, verify readiness, exercise your SDK, and clean up test state.

Agent testing

## Use Google Sheets with an AI agent

Before the agent changes application logic, have it create local Google Sheets state, read it back with the project SDK, and note which feature the check covered. That first local call catches accidental production routing and needs no GCP account, service-account key, or billing project.

### Configure this repo

```
Set up this repository to use LocalCloud for local GCP development. First read https://local.cloud/ai/agents.md, then inspect this repo, identify the GCP services and SDK language, configure emulator environment variables, and run the narrowest integration test against localhost. Do not use real GCP credentials or production endpoints.
```

Production endpoints, auth, IAM, quotas, regional behavior, and final release validation still need the target Google Cloud project.

[Agent resources](https://local.cloud/ai/) has more prompts and the AGENTS.md template.

## Related guides

- [Compatibility](https://local.cloud/compatibility/): compare all 27 service guides.
- [Configuration](https://local.cloud/docs/configuration/): service selection and runtime settings.
- [Official Google Sheets documentation](https://developers.google.com/workspace/sheets/api/guides/concepts): service concepts and cloud usage.
