I need to create a page for every single day in my database in notion, So can I create pages for each month in one request using notion-api?
Asked
Active
Viewed 711 times
2 Answers
0
You need multiple requests to create multiple pages.
However, you can make them in parallel using Promise.all
:
import { range } from "lodash-es";
import { Client } from "@notionhq/client";
const notion = new Client();
await Promise.all(
range(1, 31).map((day) =>
notion.pages.create({
parent: {
database_id: "...",
},
properties: {
day,
},
})
)
);

Nick McCurdy
- 17,658
- 5
- 50
- 82
-
Well, you'll probably hit the requests limit, according to the Notion documentation: "The rate limit for incoming requests is an average of 3 requests per second." – Alex MAN Oct 07 '22 at 08:03