# Google Sheets Reader

Any Google Sheet shared "anyone with the link", turned into headers plus rows from Google's own CSV export — no account or key needed.

- Method: `GET`
- Path: `/v1/google/sheets`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `id` | string | required | The spreadsheet ID from its URL — `docs.google.com/spreadsheets/d/<id>/…`. |
| `gid` | integer | optional | The sheet tab to read. `0` is the first tab. |
| `limit` | integer | optional | Rows to return, 1 to 10000. |
| `max_age` | integer (seconds) | optional | Ask for data no older than this. Clamped to the product's own floor, so it can narrow the window but never force a refresh on every call. |

**Example request**

```bash
curl https://api.diraz.ae/v1/google/sheets \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "spreadsheet_id": "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms",
    "sheet_id": 0,
    "headers": ["Student Name", "Gender", "Class Level", "Home State", "Major", "Extracurricular Activity"],
    "rows": [
      ["Alexandra", "Female", "4. Senior", "CA", "English", "Drama Club"],
      ["Andrew", "Male", "1. Freshman", "SD", "Math", "Lacrosse"]
    ],
    "total_rows": 30
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ",
    "as_of": "2026-08-20T04:05:00.000Z",
    "age_seconds": 3,
    "next_update_at": "2026-08-20T04:05:45.000Z"
  }
}
```