Notion -> Database: Retrieve
Readonly
Action summary
How to Get a Notion API Key
Create an Integration
- Go to the Notion Developers Portal.
- Click "New Integration", name it, select a workspace, and submit.
Get Your API Key
- Copy the Internal Integration Token from the integration settings page.
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.
Use the API Key
- Add it to your Xano Actions in the
Settings Registryinput option:
- Add it to your Xano Actions in the
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
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
- Authorization: Bearer
- Replace
%sin the endpoint with the provideddatabase_id
- API Endpoint:
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