Read

GET/v1/data/:id/:sheet?

This endpoint allows you to retrieve content from a specific sheet in your spreadsheet. You can refine the data using query parameters, including filtering, pagination, sorting, and column selection.

id
stringRequired
Example: aace0271-c068-499f-bb40-83354a35eebc
The unique identifier for the API
sheet
stringOptional
Example: contacts
The name of the sheet (tab) within the spreadsheet to operate on.

filter
stringOptional
Example: and(age:eq:21,id:eq:40)

Apply filters to refine the data returned.

Learn More
limit
numberOptional
Example: 10
Specifies the maximum number of rows to return. This helps control the size of the result set.
offset
numberOptional
Example: 10
Determines the starting point for fetching results, allowing you to skip a specified number of initial records. Useful for pagination.
sort
stringOptional
Example: Age
The name of the column you want to sort the data by.
sortDirection
stringOptional
Example: asc

Defines the sorting order:

  • asc: Sort in ascending order. (Default)
  • desc:Sort in descending order.
format
stringOptional
Example: 10

Specifies the format in which the data is returned:

  • rows: Returns each row as a JSON object with keys matching column names. (Default)
  • columns: Returns a JSON object with column names as keys and lists of corresponding values.
  • matrix: Returns data as a 2D array (matrix) representation.
columns
stringOptional
Example: Name,Age,Date
Specify the columns you want to include or exclude from the response.

Request Example

curl -X GET "https://api.sheet2db.dev/v1/data/aace0271-c068-499f-bb40-83354a35eebc/contacts" \
-G \
-d "filter=and(age:eq:21,id:eq:40)" \
-d "limit=10" \
-d "offset=10" \
-d "sort=Age" \
-d "sortDirection=asc" \
-d "format=rows" \
-d "columns=Name,Age,Date"

Successful Response Example

[
  {
    "Name": "Alice",
    "Age": 21,
    "Date": "2024-12-01"
  },
  {
    "Name": "Bob",
    "Age": 21,
    "Date": "2024-12-05"
  }
]