//native
/**
* Retrieve Page
* Get a page's properties (title, database columns, icon, parent, trash state). Its content is not included — use Get Page as Markdown or Retrieve Block Children.
*/
export async function main(
auth: RT.Notion,
page_id: string,
filter_properties: string[] | undefined
) {
const url = new URL(`https://api.notion.com/v1/pages/${page_id}`)
for (const p of filter_properties ?? []) {
if (p !== "") url.searchParams.append("filter_properties", p)
}
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${auth.token}`,
Accept: "application/json",
"Notion-Version": "2026-03-11",
},
})
if (!response.ok) {
throw new Error(`${response.status} ${await response.text()}`)
}
return await response.json()
}
Submitted by hugo989 4 days ago