Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notion API search method returns nothing

Tags:

notion-api

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 }
like image 429
Xstoudi Avatar asked May 05 '26 17:05

Xstoudi


1 Answers

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 :/

like image 139
Matias Avatar answered May 11 '26 16:05

Matias



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!