Other methods

This section describes the other methods of the SheetDB API.


GET/api/v1/{API_ID}/cells/{CELL}

Get value of single cell

If you want to retrieve the contents of a single cell using coordinates, such as A1, B10, etc. you can use this endpoint. It returns an array with the coordinates as the key and the contents of the cell as the value.

If you want to get multiple cells, just separate them with a comma. Example:

https://sheetdb.io/api/v1/58f61be4dda40/cells/A1,A2,B5

Optional attributes

  • Name
    sheet
    Type
    string
    Description

    The sheet (tab) you want to select.

JSON Response

{
    "A1": "id",
    "A2": "1",
    "B5": "Steve"
}

POST/api/v1/{API_ID}/import/json

Import JSON

If you have an empty spreadsheet, with the first row unfilled, you can use this endpoint to import the entire JSON file. Make sure the spreadsheet is empty, otherwise the content will be appended below.

Required attributes

  • Name
    json
    Type
    json
    Description

    Should contain the json array you want to import.
    Example: [{"id": 1,"name": "Mark"},{"id": 2,"name": "Susan"}]

Optional attributes

  • Name
    sheet
    Type
    string
    Description

    The sheet (tab) you want to select.

Request

POST
/api/v1/{API_ID}/import/json
curl -X POST -H "Content-Type: application/json" \
    https://sheetdb.io/api/v1/58f61be4dda40/import/json \
    -d '{"json":[{"id": 1,"name": "Mark"},{"id": 2,"name": "Susan"}]}'

JSON Response

{
    created: 1
}

GET/api/v1/{API_ID}/sheets

List of available sheets

Returns a list of all available sheets (tabs).

JSON Response

{
    "sheets": [
        "Sheet1",
        "Sheet2",
        "large"
    ]
}

POST/api/v1/{API_ID}/sheet

Create new sheet

Creates a new sheet (tab) in the spreadsheet.

Required attributes

  • Name
    name
    Type
    string
    Description

    name of the new sheet

  • Name
    first_row
    Type
    array
    Description

    column names in the form of an array, example: ["id", "name"]

Request

POST
/api/v1/{API_ID}/sheet
curl -X POST -H "Content-Type: application/json" \
  https://sheetdb.io/api/v1/58f61be4dda40/sheet \
  -d '{"name": "New Sheet", "first_row":["id","name"]}'

JSON Response

{
    created: 1
}

DELETE/api/v1/{API_ID}/sheet

Delete a sheet

Deletes a sheet (tab) and the content. Requires one param:

Required attributes

  • Name
    name
    Type
    string
    Description

    name of the sheet you want to delete

Request

DELETE
/api/v1/{API_ID}/sheet
curl -X DELETE -H "Content-Type: application/json" \
  https://sheetdb.io/api/v1/58f61be4dda40/sheet \
  -d '{"name": "New Sheet"}'

JSON Response

{
    created: 1
}