I'm trying to get all the pages of my Notion workspace but the search method returns an empty response while there is pages on my personal workspace.
Code :
import { Client, LogLevel } from '@notionhq/client'
const notion = new Client({
auth: '<hidden>',
logLevel: LogLevel.DEBUG
})
const databasesQuery = await notion.search({})
console.log(databasesQuery)
Output
@notionhq/client info: request start { method: 'post', path: 'search' }
@notionhq/client info: request success { method: 'post', path: 'search' }
{ object: 'list', results: [], next_cursor: null, has_more: false }
sorry for the late reply but I just ran into the same issue.
I think it's because you haven't shared any pages with your integration. As far as I know from my own testing you have to share each page with your integration for the search request to work, even if it's your own notion workspace :/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With