ACTIONS
  • Home
  • My Actions
  • My Projects
  • My Packages
Notion -> Database: Retrieve
Readonly
How to Get a Notion API Key

Action summary

Notion -> Database: Retrieve

Xano / Notion

How to Get a Notion API Key

  1. Create an Integration

    • Go to the Notion Developers Portal.
    • Click "New Integration", name it, select a workspace, and submit.
  2. Get Your API Key

    • Copy the Internal Integration Token from the integration settings page.
  3. Grant Database Access

    • Open your Notion database.
    • Click the three button dropdown at the top right of your screen, click Connections, and then select your integration.
  4. Use the API Key

    • Add it to your Xano Actions in the Settings Registry input option:

For more details, see the Notion API Docs.

Notion → Database: Retrieve

Overview

This Xano action retrieves a database from Notion using its unique identifier (database_id). It uses the Notion API's GET method to fetch the database's details.


Inputs

Name Type Description
notion_api_key registry text
database_id text The unique identifier of the database

Function Stack

  1. Notion API Request

    • API Endpoint: https://api.notion.com/v1/databases/%s
    • HTTP Method: GET
    • Headers:
      • Authorization: Bearer <notion_api_key>
      • Notion-Version: 2022-06-28
    • Replace %s in the endpoint with the provided database_id
  2. Precondition

    • Ensures that the HTTP request was successful
    • Condition: notion_api_response.status == 200
    • If this condition fails, execution halts and an error is thrown

Response

Key Value
As Self Returns notion_api_response.result

Example

Input

{
  "database_id": "9bc30ad4-9373-46a5-84ab-0a7845ee52e6"
}

Output

{
  "object": "database",
  "id": "03f9337c-1a8d-4b4e-9aa1-a4406dd2ed92",
  "cover": {
    "type": "external",
    "external": {
      "url": "https://images.unsplash.com/photo-1533038590840-1cde6e668a91?ixlib=rb-4.0.3&q=85&fm=jpg&crop=entropy&cs=srgb"
    }
  },
  "icon": {
    "type": "external",
    "external": {
      "url": "https://www.notion.so/icons/checklist_lightgray.svg"
    }
  },
  .
  .
  .
  "public_url": null,
  "archived": false,
  "in_trash": false,
  "request_id": "2cda43d3-b2e3-46a7-9663-b44c305c0133"
}

Version notes

Initial version
Current
2025-04-15T22:44:41.000+00:00