{"markdown":"## Request a preview\n\nSpreadsheet Preview converts CSV, XLS, and XLSX files into PNG tables.\nSend the file bytes directly in the body of `POST /preview`. Include\n`Authorization: Bearer YOUR_API_KEY`. On success, the server returns HTTP 200\nwith `Content-Type: image/png`.\n\nSet `API_KEY` in your shell to the server's bearer key. Set `BASE_URL` to the\nserver URL without a trailing slash. The examples use the local server if you\nomit `BASE_URL`.\n\n```sh\nprintf 'Item,Units\\nCartons,120\\n' | curl --fail --silent --show-error \\\n  -H 'Content-Type: text/csv' \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  --data-binary @- \\\n  \"${BASE_URL:-http://127.0.0.1:3000}/preview\" \\\n  -o preview.png\n```\n\nUse `application/octet-stream` for XLS and XLSX files. To preview the Sales\nsheet, replace `inventory.xlsx` with the path to your workbook.\n\n```sh\ncurl --fail --silent --show-error \\\n  -H 'Content-Type: application/octet-stream' \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  --data-binary @inventory.xlsx \\\n  \"${BASE_URL:-http://127.0.0.1:3000}/preview?sheet=Sales\" \\\n  -o sales.png\n```\n\n| Query parameter | Default | Accepted values |\n| --- | --- | --- |\n| `sheet` | First worksheet | Exact worksheet name in an Excel workbook. |\n| `max_rows` | 20 | 1 to 40. |\n| `max_cols` | 8 | 1 to 12. |\n\nThe preview starts at A1 and shows **Partial sheet** if the row or column\nlimit cuts off data. The renderer uses its own table style and displays saved\nformula results when the workbook contains them.\n\nCSV files must use UTF-8 and commas. The upload limit is 8 MiB. XLSX archives can\ncontain up to 4,096 entries and declare up to 64 MiB of uncompressed data. The\nserver accepts two preview requests at a time.\n\n| HTTP status | Meaning |\n| --- | --- |\n| 400 | The body is empty or the query parameters are invalid. |\n| 401 | The bearer API key is missing or invalid. |\n| 408 | The upload took more than 15 seconds. |\n| 413 | The server could not read the body within the upload limit. |\n| 415 | The server does not accept the request's content type. |\n| 422 | The server could not read the file or find the requested worksheet. |\n| 503 | Both preview slots are busy. Retry after a delay. |\n\n`GET /healthz` reports `status` and the compiled `revision` without a key."}