Read a Google Sheet in Laravel
You do not need the Google client library to get a spreadsheet into a Laravel app. If the sheet is shared, an HTTP call and a cache is the whole integration.
Last updated
Key facts
- Google's API requires a Google Cloud project plus OAuth credentials or a service account before it will return a single row. source
-
Against a JSON endpoint the whole Laravel integration is
Http::get()wrapped inCache::remember()— nogoogle/apiclient, no service-account JSON in your repo. -
The Google Sheets API allows 300 read requests per minute per project and 60 per minute per user. Past that it returns
429 RESOURCE_EXHAUSTED. source - A cached endpoint reads the sheet once per TTL, not once per request — so 10,000 visitors become one upstream read, and Google's quota stops being your problem.
How do you read a Google Sheet in Laravel?
Point Http::get() at a JSON endpoint backed by the sheet and cache the response. That is the entire integration — no google/apiclient, no service-account JSON in your repo, no Cloud project to keep alive.
The Google client library is the right call if you need to write to the sheet. For reading content, config, or listings into a Laravel app, it is a lot of machinery for a GET.
The whole integration
Connect the sheet to PasteSheet, then read it like any other JSON API:
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Http;
public function active(): array
{
return Cache::remember('listings', now()->addMinutes(5), fn () => Http::get(
'https://pastesheet.com/api/your-endpoint-id',
['status' => 'active', 'sort' => '-created', 'limit' => 100],
)->json('data'));
}Why cache twice?
You do not have to — PasteSheet already caches, so the endpoint is fast on its own. A short local cache simply saves the network hop when the same page renders repeatedly, which matters more on a busy route than on a cron job.
The values arrive typed. Because the column schema is inferred when the sheet is connected, a number comes back as a number and a date as a date — not the strings a CSV export would give you.
What it costs
MCP is included on the Free plan. Connect any public endpoint over MCP with no Google Cloud project and no credit card. Private endpoints and the account-wide workspace server need a paid plan (from Starter ($9/mo)) for the keys and OAuth they authenticate with.
Pro adds full-text search and aggregation (count, sum, avg, group_by) that your AI agent can call through query_rows.
Free
For side projects and trying things out.
- Endpoints
- 3
- Requests / mo
- 2,000
- Row cap
- 500
- Type-mapped columns
- Custom cache TTL
Frequently asked questions
Do I need the Google API client for Laravel?
Only for writes or private-sheet access. To read a shared sheet, Http::get against a JSON endpoint does the job without a Cloud project or a service-account key in your repository.
Where should the sheet data live in my app?
Treat it like any external API: wrap the call in a small service class, cache the result, and return typed arrays or DTOs. Do not scatter Http::get calls through your controllers and Blade views.
What happens if the sheet is edited?
The change appears once the cache expires. PasteSheet's TTL is configurable from 30 seconds to an hour, and any local Laravel cache you add sits on top of that.
Can I write to the sheet from Laravel?
Not through PasteSheet — it is read-only by design. If you need writes, use Google's API for that path; the read path can still go through a cached endpoint.
Sources
- Authorize requests — Google Sheets API — Google
- Usage limits — Google Sheets API — Google
Related guides
How to Read a Google Sheet in Python
Three ways to read a Google Sheet from Python: gspread, the official API, and a plain HTTP endpoint. Working code and the gotchas for each approach.
How to Read a Google Sheet in React
Fetch Google Sheet rows into a React app as JSON. Why you cannot safely call Google's API from the browser, and what to do instead. With working code.
How to Cache a Google Sheets JSON API
Should you cache a Google Sheets JSON API? How edge caching keeps reads fast, avoids Google's rate limits, and serves your app from a CDN-like layer.
Turn Google Sheets Into a REST API (No Code)
Turn a public or restricted Google Sheet into a live JSON REST API with filtering, sorting, and pagination — no backend, no code.
Turn your sheet into an API in minutes
Paste a Google Sheet URL and get a live REST API and MCP server — no backend, no code, free to start.