Get started
On this page
https://sheetfast.com is a service that generate xlsx and csv file.
- You send a JSON array to the sheetfast API
- We generate a csv file and an xlsx file that we upload to your s3 bucket
- You can download the file.
It is convenient because :
- We handle large file with thousand of rows
- We support weird JSON with sub arrays and sub objects
- You can export well designed multisheet xlsx file with templates
Authentication
SheetFast uses API keys for authentication. You can generate a secret key in the "project" tab. You have to create a project to get an API key. Each project has one secret key.
All API requests must include the API key in the headers as shown below:
Authorization: Bearer YOUR_API_KEY
All API requests on Sheetfast are scoped to a Project.
Generate a File
Overview
This API endpoint is designed to generate and upload files in CSV or XLSX format. The data for the files is provided in the request body, and the files are uploaded to a S3 compatible bucket.
- JSON to CSV
- JSON to Excel (xlsx)
Endpoint
POST https://api.sheetfast.com/generate
Headers
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
Request Body
The request body should be a JSON object with two main keys: options
and sheets
.
Options
Key | Type | Default | Description |
---|---|---|---|
headers | object | {} | Custom headers to be included in the file. The key is the header name and the value is the header value. |
filename | string | 'export-<TIME_NS>' | The filename for the generated files. The default value is a dynamic filename with the current timestamp. |
Sheets
Key | Type | Default | Description |
---|---|---|---|
rows | object | Required | An array of objects representing the rows of data. |
name | string | 'Sheet {i+1}' | The name of the sheet. |
options | object | {} | Sheet-bound options. |
Response
The response is a JSON object with keys csv
and xlsx
containing the URLs and ObjectKeys for the generated files.
Example
cURL
curl -X POST https://api.sheetfast.com/generate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"options": {
"filename": "my_export",
"headers": {
"column1": "Header 1",
"column2": "Header 2"
}
},
"sheets": [
{
"name": "Sheet1",
"rows": [
{"column1": "value1", "column2": "value2", "columnwithout_custom_header": 13},
{"column1": "value3", "column2": "value4", "columnwithout_custom_header": 19}
]
}
]
}'
Node.js (Axios)
const axios = require("axios");
const data = {
options: {
filename: "my_export",
headers: {
column1: "Header 1",
column2: "Header 2",
},
},
sheets: [
{
name: "Sheet1",
rows: [
{
column1: "value1",
column2: "value2",
columnwithout_custom_header: 13,
},
{
column1: "value3",
column2: "value4",
columnwithout_custom_header: 19,
},
],
},
],
};
axios
.post("https://api.sheetfast.com/generate", data, {
headers: {
"Content-Type": "application/json",
Authorization: "Bearer YOUR_API_KEY",
},
})
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.error(error);
});
Python (Requests)
import requests
import json
url = "https://api.sheetfast.com/generate"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
}
data = {
"options": {
"filename": "my_export",
"headers": {
"column1": "Header 1",
"column2": "Header 2"
}
},
"sheets": [
{
"name": "Sheet1",
"rows": [
{"column1": "value1", "column2": "value2", "columnwithout_custom_header": 13},
{"column1": "value3", "column2": "value4", "columnwithout_custom_header": 19}
]
}
]
}
response = requests.post(url, headers=headers, data=json.dumps(data))
print(response.json())
Output
The output of the API call with the given input will be a JSON response containing the URLs and ObjectKeys for the generated CSV and XLSX files.
{
"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"
}
}
The response includes the URLs for downloading the generated CSV and XLSX files. The actual URLs and keys will vary based on your specific API call and bucket configuration.
Output inside the .csv/.xlsx file
column1,column2,columnwithout_custom_header
value1,value2,13
value3,value4,19
Header 1 | Header 2 | columnwithout_custom_header |
---|---|---|
value1 | value2 | 13 |
value3 | value4 | 19 |
Explanation
- The
headers
option provides custom headers forcolumn1
andcolumn2
. - The
columnwithout_custom_header
retains its original name since it is not specified in theheaders
option. - The table displays the rows from the input payload with the specified custom headers.