Create spreadsheets & documents with Rust
Create a shareable spreadsheet from Rust in a single async call with reqwest and serde_json — no Excel crate, no Google setup. POST your rows and read the URL from the JSON response. Works in Actix/Axum services, CLIs, and background workers.
use serde_json::json;
let res: serde_json::Value = reqwest::Client::new()
.post("https://openofficeai.com/api/v1/sheets")
.bearer_auth("YOUR_API_KEY")
.json(&json!({
"title": "Q3 Revenue",
"sheets": [{ "rows": [
["Month", "Revenue", "Growth"],
["July", 48200, "+12%"]
] }]
}))
.send().await?
.json().await?;
println!("{}", res["url"]);How to create a spreadsheet with Rust
- 1Add reqwest (with the json feature) and serde_json to Cargo.toml.
- 2POST a json! body to /api/v1/sheets with .bearer_auth(your key).
- 3Deserialize the response and read res["url"].
- 4For a file, request /api/v1/download/{id}?format=xlsx and write the bytes.
Why use OpenOfficeAI with Rust
- No spreadsheet crate (calamine/xlsxwriter) to compile or maintain.
- Fits async Axum/Actix services and CLI tools.
- serde_json keeps the request ergonomic and type-checked where it matters.
Frequently asked questions
Do I need an Excel crate like xlsxwriter?
No. You send JSON and OpenOfficeAI builds the workbook. To get an .xlsx, call /api/v1/download/{id}?format=xlsx and write the response bytes — no native Excel crate needed.
How do I handle errors idiomatically?
Use the ? operator with reqwest::Error and check resp.status() (201 on success). On a non-2xx, deserialize the JSON error body to surface the message in your logs.
Is reqwest blocking or async here?
The example is async (reqwest default). For sync code, enable the blocking feature and use reqwest::blocking::Client with the same builder pattern.
Start creating documents with Rust
Free tier includes 500 API calls per month — no card required.