Skip to main content

Overview

Retrieves a database object by its ID. Returns information about the database including its title, description, parent, data sources, and metadata.

Parameters

database_id
string
required
The ID of the database to retrieve. Can be a raw ID or a Notion database URL.
auth
string
Optional authentication token to override the client’s default token for this request.

Response

Returns a DatabaseObjectResponse or PartialDatabaseObjectResponse.
object
string
Always database.
id
string
The ID of the database.
title
array
The title of the database as an array of rich text objects.
description
array
The description of the database as an array of rich text objects.
parent
object
The parent of the database. Can be a page, block, workspace, or another database.
is_inline
boolean
Whether the database is displayed inline in the parent page.
in_trash
boolean
Whether the database is in the trash.
is_locked
boolean
Whether the database is locked from editing in the Notion app UI.
created_time
string
ISO 8601 timestamp when the database was created.
last_edited_time
string
ISO 8601 timestamp when the database was last edited.
data_sources
array
Array of data source references contained in this database. Each reference includes an ID and name.
icon
object
The icon of the database, or null if none is set.
cover
object
The cover image of the database, or null if none is set.
url
string
The URL of the database in Notion.
public_url
string
The public URL of the database if it is publicly accessible, otherwise null.

Examples

Retrieve a database

Retrieve and check database properties

Extract database ID from URL

Access data sources

To query the contents of a database, use notion.dataSources.query() with one of the data source IDs from the data_sources array.