API-post-database-query
Retrieve and filter database entries from Notion using specific criteria, sort results, and manage pagination for efficient data extraction and analysis.
Instructions
Notion | Query a database
Input Schema
Name | Required | Description | Default |
---|---|---|---|
archived | No | ||
database_id | Yes | Identifier for a Notion database. | |
filter | No | When supplied, limits which pages are returned based on the [filter conditions](ref:post-database-query-filter). | |
filter_properties | No | A list of page property value IDs associated with the database. Use this param to limit the response to a specific page property value or values for pages that meet the `filter` criteria. | |
in_trash | No | ||
page_size | No | The number of items from the full list desired in the response. Maximum: 100 | |
sorts | No | When supplied, orders the results based on the provided [sort criteria](ref:post-database-query-sort). | |
start_cursor | No | When supplied, returns a page of results starting after the cursor provided. If not supplied, this endpoint will return the first page of results. |
Input Schema (JSON Schema)
{
"$defs": {},
"properties": {
"archived": {
"type": "boolean"
},
"database_id": {
"description": "Identifier for a Notion database.",
"type": "string"
},
"filter": {
"additionalProperties": true,
"description": "When supplied, limits which pages are returned based on the [filter conditions](ref:post-database-query-filter).",
"type": "object"
},
"filter_properties": {
"description": "A list of page property value IDs associated with the database. Use this param to limit the response to a specific page property value or values for pages that meet the `filter` criteria.",
"items": {
"type": "string"
},
"type": "array"
},
"in_trash": {
"type": "boolean"
},
"page_size": {
"default": 100,
"description": "The number of items from the full list desired in the response. Maximum: 100",
"type": "integer"
},
"sorts": {
"description": "When supplied, orders the results based on the provided [sort criteria](ref:post-database-query-sort).",
"items": {
"additionalProperties": true,
"properties": {
"direction": {
"enum": [
"ascending",
"descending"
],
"type": "string"
},
"property": {
"type": "string"
}
},
"required": [
"property",
"direction"
],
"type": "object"
},
"type": "array"
},
"start_cursor": {
"description": "When supplied, returns a page of results starting after the cursor provided. If not supplied, this endpoint will return the first page of results.",
"type": "string"
}
},
"required": [
"database_id"
],
"type": "object"
}