Read Content
Read data from your spreadsheet
GET
https://api.sheet2db.com/v1/{connection-id}
Query Parameters
sheet
string (Optional)
Specify the name of the sheet (tab) you wish to select within your Google Spreadsheet.
limit
integer (Optional)
Set a limit on the maximum number of rows to be returned, providing control over result volume.
offset
integer (Optional)
Determine the starting point for fetching results, allowing you to skip a specified number of initial results.
cast_numbers
string (Optional)
Specify the column name(s) that you want to cast into numeric values. You can use multiple column names, separated by commas, to perform this operation.
columns
string (Optional)
Specify the column name(s) that you want to include in the result. You can use multiple column names, separated by commas, to perform this operation.
format
enum (Optional)
Specify how you want the response format to be. Allowed values records
, dict
, series
, split
, index
. Default Value records
.
sort
string (Optional)
Name of the column by which you want to sort the result. To specify sort order, add :
after column name followed by order (asc
or desc
). Defaults to desc
Example:
https://api.sheet2db.com/v1/{connection-id}?sort=Age:asc
sort_method
enum (Optional)
If you want to sort by date, set this attribute to date, Sheet2DB will try to automatically detect the data format but it is recommended to specify the format in the sort_date_format attribute.
sort_date_format
string (Optional)
Applies only when sort_method=date.
Date format, e.g. if your date is 2022-19-12 use YYYY-mm-dd. For date time like 2022-19-12 13:55:00 use YYYY-mm-dd hh:mm:ss.
Examples
records
[
{
"id": "1",
"name": "John",
"age": 24,
},
],
dict
{
"id": {
"0": "1",
},
"name": {
"0": "John",
},
"age": {
"0": 24,
},
}
series
{
"id": ["1"],
"name": ["John"],
"age": [24],
}
split
{
"columns": ["id", "name", "age"],
"data": [["1", "John", 24]]
}
index
{
"0": {
"id": "1",
"name": "John",
"age": 24,
},
}
Example Request
curl -XGET 'https://api.sheet2db.com/v1/{connection-id}?format=records&limit=10'
Example Response
[
{
"id": "5",
"name": "James",
"age": 19,
"comment": ""
},
{
"id": "4",
"name": "Steve",
"age": 22,
"comment": "special"
}
]