title: Notion widget by Scriptable
body: <p>I've tried to create <code>Scriptable</code> widget using <code>Notion API</code>.
  I need to get count of page inside DB.</p>
  <p>So, I used <a href="https://developers.notion.com/docs/getting-started" rel="nofollow noreferrer">guide</a> to create token and share DB, and by this <a href="https://developers.notion.com/reference/post-database-query" rel="nofollow noreferrer">guide</a> I create cURL request:</p>
  <pre><code>  curl 'https://api.notion.com/v1/databases/%DB_ID%/query' \
    -H 'Authorization: Bearer %TOKEN%' \
    -H 'Notion-Version: 2021-05-13' \
    --data '{
        &quot;filter&quot;: 
  
              {
  
              }
          }'
  </code></pre>
  <p>The filter in body is required, without this param you will get error.</p>
  <p>So, the curl works fine.</p>
  <hr />
  <p>Then I've tried to create scriptable code:</p>
  <pre><code>async function notion_fetchData() {
  
    const url = 'https://api.notion.com/v1/databases/%DB_ID%/query'
    request = new Request(url)
    request.headers = {'Authorization':Bearer ${todoist_Api_key}, 'Notion-Version': '2021-05-13'}
    request.body = Data.fromString('{&quot;filter&quot;: {}}')
  
    const res_notion = await request.loadJSON()
    console.log(res_notion)
    return res_notion
  }
  </code></pre>
  <p>And this code gets error: &quot;resource exceeds maximum size&quot;.
  <strong>Any ideas how to debug this error?</strong></p>