Create spreadsheets & documents with Notion
Pull rows from a Notion database and turn them into a shareable OpenOfficeAI spreadsheet — a clean export link for people who don't have access to your Notion workspace. Query the Notion API, map properties into rows, and POST them. Run it on a schedule or on demand.
import { Client } from "@notionhq/client";
const notion = new Client({ auth: process.env.NOTION_TOKEN });
const db = await notion.databases.query({ database_id: DB_ID });
const rows = [["Name", "Status"]];
for (const page of db.results) {
rows.push([
page.properties.Name.title[0]?.plain_text ?? "",
page.properties.Status.status?.name ?? "",
]);
}
const res = await fetch("https://openofficeai.com/api/v1/sheets", {
method: "POST",
headers: { "Authorization": `Bearer ${process.env.OPENOFFICEAI_KEY}`,
"Content-Type": "application/json" },
body: JSON.stringify({ title: "Notion export", sheets: [{ rows }] }),
});
console.log((await res.json()).url);How to create a spreadsheet with Notion
- 1Create a Notion integration and share your database with it.
- 2Query the database and map each page's properties into a row array.
- 3POST the rows to /api/v1/sheets with your OpenOfficeAI key.
- 4Share the returned url, or schedule the script for a recurring export.
Why use OpenOfficeAI with Notion
- Give non-Notion users a clean, downloadable export.
- No manual copy-paste from Notion to a spreadsheet.
- Schedule it for a daily/weekly snapshot link.
Frequently asked questions
Do recipients need a Notion account?
No — that's the point. The OpenOfficeAI link is a standalone spreadsheet anyone can open and download, unlike a shared Notion page that prompts for sign-in.
How do I handle different Notion property types?
Map each property by its type — title[0].plain_text, status.name, number, select.name, etc. Build a small helper that returns a string per property so your rows stay clean.
Can I run this automatically?
Yes. Put the script on a cron (GitHub Actions, a serverless schedule, or n8n) to regenerate the export link on a schedule.
Start creating documents with Notion
Free tier includes 500 API calls per month — no card required.