Overview
Retrieves a database object by its ID. Returns information about the database including its title, description, parent, data sources, and metadata.Parameters
string
required
The ID of the database to retrieve. Can be a raw ID or a Notion database URL.
string
Optional authentication token to override the client’s default token for this request.
Response
Returns aDatabaseObjectResponse or PartialDatabaseObjectResponse.
string
Always
database.string
The ID of the database.
array
The title of the database as an array of rich text objects.
array
The description of the database as an array of rich text objects.
object
The parent of the database. Can be a page, block, workspace, or another database.
boolean
Whether the database is displayed inline in the parent page.
boolean
Whether the database is in the trash.
boolean
Whether the database is locked from editing in the Notion app UI.
string
ISO 8601 timestamp when the database was created.
string
ISO 8601 timestamp when the database was last edited.
array
Array of data source references contained in this database. Each reference includes an ID and name.
object
The icon of the database, or
null if none is set.object
The cover image of the database, or
null if none is set.string
The URL of the database in Notion.
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.