# Google Sheets Reader: Public Sheets to JSON, No OAuth (`robindesbios/public-google-sheets-reader`) Actor

Read any public Google Sheet (shared link, published-to-web link or ID) and get one clean JSON row per line. It covers all tabs, keeps numbers and dates typed, cleans headers and gives clear errors. No Google account, OAuth or API key needed. Export to JSON, CSV or Excel, or use it via API.

- **URL**: https://apify.com/robindesbios/public-google-sheets-reader.md
- **Developed by:** [Robin DESBIOS](https://apify.com/robindesbios) (community)
- **Categories:** Integrations, Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Google Sheets Reader: Public Sheets to JSON, No OAuth

Turn any **public Google Sheet** into clean JSON rows, ready for your Apify pipelines, APIs, AI agents, n8n / Make / Zapier flows or databases. Paste a link and run. You don't need a Google account, OAuth consent, service account or API key.

### What it does

- Reads **every tab** of a spreadsheet in one run, or just the tab in your link (`#gid=...`).
- Accepts **"Anyone with the link can view"** links, **"Published to the web"** links (`/d/e/2PACX-...`) and bare spreadsheet IDs.
- Outputs **one dataset item per row**, using your header row as field names.
- Keeps types where Google provides them: numbers stay numbers, dates become ISO 8601 strings and empty cells become `null`.
- Handles messy headers: blank header cells become `column_N`, and duplicate headers become `Name_2`, `Name_3`.
- Lets you set a custom header row (for sheets with a title above the table), skip empty rows and filter by tab name.
- Fails loudly with a clear message when a sheet is private or the link is wrong. A broken link never produces a silent empty run.

### Who it's for

- **Scraper and automation builders** who keep input lists (URLs, keywords, SKUs, leads) in a Google Sheet and want to feed them to other Actors.
- **No-code users** who need a stable JSON/CSV/Excel endpoint for a shared sheet.
- **AI and agent developers** who want sheet content as structured data.
- **Data teams** that regularly pull public datasets published as Google Sheets.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `spreadsheetUrls` | array of strings | Google's public sample sheet | Sheet URLs or IDs |
| `allTabs` | boolean | `true` | Read all tabs. If `false`, reads only the tab in the URL's `gid` (or the first tab) |
| `sheetNames` | array of strings | `[]` | Only read these tabs (exact names) |
| `headerRow` | integer | `1` | Row number that contains the column names |
| `skipEmptyRows` | boolean | `true` | Ignore fully empty rows |
| `flattenColumns` | boolean | `true` | Also copy each column to a top-level field (best for CSV/Excel export) |
| `maxItems` | integer | `20` | Maximum rows in total (`0` = no limit) |

Example input:

```json
{
  "spreadsheetUrls": [
    "https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit"
  ],
  "allTabs": true,
  "maxItems": 100
}
```

### Output

Each row looks like this:

```json
{
  "spreadsheetId": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
  "sheetName": "Class Data",
  "rowNumber": 2,
  "sourceUrl": "https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit",
  "data": {
    "Student Name": "Alexandra",
    "Gender": "Female",
    "Class Level": "4. Senior",
    "Home State": "CA",
    "Major": "English",
    "Extracurricular Activity": "Drama Club"
  },
  "Student Name": "Alexandra",
  "Gender": "Female",
  "Class Level": "4. Senior",
  "Home State": "CA",
  "Major": "English",
  "Extracurricular Activity": "Drama Club"
}
```

- `spreadsheetId`: the Google spreadsheet ID
- `sheetName`: the tab name (or `gid=N` in single-tab mode)
- `rowNumber`: the row number as shown in Google Sheets
- `data`: the full row as an object
- `sourceUrl`: the link you provided
- One top-level field per column (when `flattenColumns` is on)

You can download results as JSON, CSV, Excel or XML, or read them through the Apify API.

### Pricing

You pay **per row extracted** (pay per result) and nothing else: there is no start fee and no monthly rental. See the Pricing tab for the current price per row. Use `maxItems` to cap your spend.

### How to make a sheet readable

In Google Sheets, click **Share**, then set **General access** to **Anyone with the link** (Viewer). You can also use **File > Share > Publish to web**. Then paste the link into `spreadsheetUrls`.

### Limits

- The Actor only reads sheets that are **public**. Private sheets, sheets restricted to an organization and sheets that require sign-in are refused with a clear error. The Actor never signs in.
- It is **read only**: it does not write to Google Sheets.
- Cell values are the **computed values** exported by Google. Formulas, formatting, comments and images are not included.
- In single-tab mode (`allTabs: false`), values come from Google's CSV export, so dates stay as they are displayed in the sheet.
- Very large spreadsheets are limited by Google's export size limits.

### Legal

This Actor only downloads files through Google's own export links, for spreadsheets their owners have chosen to share publicly. You are responsible for respecting the owner's rights and any personal data a sheet may contain.

# Actor input Schema

## `spreadsheetUrls` (type: `array`):

Links to Google Sheets shared as 'Anyone with the link can view' or 'Published to the web'. You can also paste a bare spreadsheet ID.

## `allTabs` (type: `boolean`):

If enabled, every tab (worksheet) of the spreadsheet is read. If disabled, only the tab in the URL (#gid=...) is read, or the first tab when no gid is given.

## `sheetNames` (type: `array`):

Restrict reading to tabs with these exact names (only used when 'Read all tabs' is enabled). Leave empty to read every tab.

## `headerRow` (type: `integer`):

Row that contains the column names (1 = first row). Rows above it are ignored.

## `skipEmptyRows` (type: `boolean`):

Ignore rows where every cell is empty.

## `flattenColumns` (type: `boolean`):

Also copy each column to a top-level field of the result (handy for CSV/Excel export). The full row is always available in the 'data' field.

## `maxItems` (type: `integer`):

Maximum number of rows to output across all spreadsheets and tabs (0 = no limit).

## Actor input object example

```json
{
  "spreadsheetUrls": [
    "https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit"
  ],
  "allTabs": true,
  "sheetNames": [],
  "headerRow": 1,
  "skipEmptyRows": true,
  "flattenColumns": true,
  "maxItems": 20
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "spreadsheetUrls": [
        "https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("robindesbios/public-google-sheets-reader").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "spreadsheetUrls": ["https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit"] }

# Run the Actor and wait for it to finish
run = client.actor("robindesbios/public-google-sheets-reader").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "spreadsheetUrls": [
    "https://docs.google.com/spreadsheets/d/1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms/edit"
  ]
}' |
apify call robindesbios/public-google-sheets-reader --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,robindesbios/public-google-sheets-reader"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/BuPeO4n81sveSQERJ/builds/c7IVwyCpe3GUrdvuo/openapi.json
