cURL Examples
Ready-to-copy cURL commands for every SheetsAPI operation — list, filter, sort, paginate, create, update, delete.
cURL Examples
All examples use two placeholder values. Replace them before running:
{YOUR_USER_KEY}— your SheetsAPI user key (visible in the dashboard){SHEET_NAME}— the exact name of your Google Sheet tab
The base URL for all requests is https://sheetsapi.gkit.mreshank.com.
Read Operations
List all rows
curl https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME}Paginate with limit and offset
curl "https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME}?limit=25&offset=0"Fetch page 2 (rows 26–50):
curl "https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME}?limit=25&offset=25"Filter rows with search
Substring match — returns any row where the city field contains "London":
curl "https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME}?search=city:London"Exact match — returns only rows where city equals "London" exactly:
curl "https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME}?search=city:London&search_exact=1"Sort rows
Ascending by name:
curl "https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME}?sort=name"Descending by date (most recent first):
curl "https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME}?sort=-date"Select specific fields
Return only name, email, and city columns:
curl "https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME}?fields=name,email,city"Fetch a single row
Row numbers are 1-based and refer to data rows (the header row is not counted):
curl https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME}/1Download as CSV
curl "https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME}?format=csv" \
-o contacts.csvDownload as TSV
curl "https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME}?format=tsv" \
-o contacts.tsvGet XML output
curl "https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME}?format=xml"Write Operations
Create a row (POST)
Append a new row to the sheet. Send field values as a JSON body:
curl -X POST \
https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME} \
-H "Content-Type: application/json" \
-d '{"name": "Alice", "email": "alice@example.com", "city": "London"}'Update a row (PUT)
Replace all fields on an existing row. The row number is 1-based:
curl -X PUT \
https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME}/1 \
-H "Content-Type: application/json" \
-d '{"name": "Alice Smith", "email": "alice.smith@example.com", "city": "London"}'Delete a row (DELETE)
curl -X DELETE \
https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME}/1Authenticated Requests
If your sheet requires an API key, pass it as a Bearer token in the Authorization header. This applies to all request methods (GET, POST, PUT, DELETE).
Authenticated list
curl https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME} \
-H "Authorization: Bearer sk_your_api_key_here"Authenticated create
curl -X POST \
https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME} \
-H "Authorization: Bearer sk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"name": "Bob", "email": "bob@example.com", "city": "Manchester"}'Authenticated delete
curl -X DELETE \
https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME}/3 \
-H "Authorization: Bearer sk_your_api_key_here"See Authentication for how to generate and manage API keys.
Combined Example
Filter by status, sort by date descending, paginate, and return only selected fields — all in one request:
curl "https://sheetsapi.gkit.mreshank.com/api/spreadsheets/{YOUR_USER_KEY}/{SHEET_NAME}?search=status:shipped&search_exact=1&sort=-date&limit=50&offset=0&fields=orderId,date,amount" \
-H "Authorization: Bearer sk_your_api_key_here"