SheetFast API reference

Authentication

Sheetfast uses API keys to allow access to the API. You can get an API key by creating one in the settings tab in Sheetfast.

Sheetfast expects the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: Bearer SECRET_KEY

All API requests on Sheetfast are scoped to a Project.

Generate a file

Method

POST https://api.sheetfast.com/generate

Headers

Content-Type: application/json
Authorization: Bearer API_KEY

Body

The request body is a JSON object with two main keys: options and sheets.

Options

The options key contains a JSON object with various options for the file generation and upload.

KeyTypeDefaultSheet optionDescription
headersobject{}✅ YesCustom headers to be included in the file. The key is the header name and the value is the header value.
formattersobject{}✅ YesCustom formatters to be applied to the data. The key is the data field name and the value is the formatter function. See Formatters.
subRowColumnsstring[][]✅ YesColumns to split into multiple rows. For each input row, every of these columns must contain arrays of equal length.
subRowDroppedColumnsstring[][]✅ YesIf using subRowColumns, columns for which values must not be duplicated across subrows.
removeHeaderRowbooleanfalse❌ NoIf true, the first row of the data will be treated as the header row and will be removed from the data.
decimalSeparatorCommabooleanfalse❌ NoIf true, the decimal separator in the data will be a comma (,) instead of a period (.).
CSVDelimiterstring','❌ NoThe delimiter to be used in the CSV files.
CSVRowDelimiterstring'\n'❌ NoThe row delimiter to be used in the CSV files.
filenamestring'export-<TIME_NS>'❌ NoThe filename for the generated files. The default value is a dynamic filename with the current timestamp.
noXlsxbooleanfalse❌ NoIf true, the XLSX file will not be generated.
CSVExtensionstring'csv'❌ NoThe file extension for the CSV files.
forceZipboolean'false'❌ Nothe csv key will point to a compressed ZIP file containing the individual CSV files for each sheet.
contentDispositionstring'attachment'❌ NoThe content disposition of the file uploaded in the bucket.

Sheet data

KeyTypeDefaultDescription
rowsobject[]❌ RequiredAn array of objects, where each object is a row of data for the file. The data key contains an array of objects, where each object is a row of data for the file. The keys in the objects are the column names for the file, and the values are the data for the columns.
namestring'Sheet {i+1}'The sheet name. If already used, a number will be appended. Make sure the name you entered does not exceed 30 characters and does not contain any of the following characters: : \ / ? \* [ or ]
optionsobject{}Sheet-bound options. See Options.

Column order

The columns follow the order given by the headers option. Any other column will be appended after, sorted in alphabetical order.

Formatters

FormatterArgumentsDescription
jsonKeep the value as-is, without splitting it in multiple columns.
date::argarg (string): Python datetime formatFormat a date. Available codes: https://docs.python.org/3/library/datetime.html#strftime-and-strptime-format-codes
devise::centsDivide the input number by 100.

Response

The response is a JSON object with two keys: csv and xlsx. The values for these keys are the URLs and ObjectKey for the generated CSV and XLSX files, respectively. If noXlsx is true, the xlsx key will not be present in the response.

The key key is the ObjectKey for the generated file in the bucket. Is useful if you want to download the file later, or if you want to delete it immediately after the file is downloaded.

Example

{
  "csv": {
    "key": "1715351964513062365/export-1715351964493862473.csv",
    "url": "https://your-own-bucket.url/1715351964513062365/export-1715351964493862473.csv?AWSAccessKeyId=DO003ANE2UHTLZ8NEME8&Signature=ZOHQlNZldfHN6Tlf%2BEF4tInkjEs%3D&Expires=1719866878"
  },
  "xlsx": {
    "key": "1715351964513062365/export-1715351964493862473.xlsx",
    "url": "https://your-own-bucket.url/1715351964513062365/export-1715351964493862473.xlsx?AWSAccessKeyId=DO003ANE2UHTLZ8NEME8&Signature=zmROfxGnsy07cGOq1jQ%2B8bIeAsI%3D&Expires=1719866878"
  }
}

Reasons Why CSV is a Zip

If forceZip is true, the CSV file is larger than 10MB, or there are multiple sheets, the csv key will point to a compressed ZIP file containing the individual CSV files for each sheet.

ConditionResult
options.forceZip is truePoints to a compressed ZIP file containing CSV files
Generated CSV file is larger than 10MBPoints to a compressed ZIP file containing CSV files
There are multiple sheetsPoints to a compressed ZIP file containing CSV files
{
  "csv": "https://byob.url/171xxxx53/export-1715351964493862473.zip",
  "xlsx": "https://byob.url/171xxxx53/export-1715351964493862473.xlsx"
}