The Notion Ricette API serves as a bridge between GPT and the Notion API, providing RESTful endpoints for database operations. This API simplifies interaction with Notion databases and pages.
http://localhost:5000/api
This API uses the Notion Integration Token for authentication. The token is configured server-side via the NOTION_INTEGRATION_SECRET environment variable.
NOTION_INTEGRATION_SECRET - Your Notion integration tokenSESSION_SECRET - Flask session secret (optional)GET /api/health
Check the API health and configuration status.
{
"status": "healthy",
"service": "notion-ricette-api",
"notion_configured": true
}
GET /api/databases/{database_id}
Retrieve database schema and metadata.
database_id (path) - Notion database IDPOST /api/databases/{database_id}/query
Query database with filters, sorting, and pagination.
{
"filter": {
"property": "Status",
"select": {
"equals": "Published"
}
},
"sorts": [
{
"property": "Created",
"direction": "descending"
}
],
"page_size": 50
}
POST /api/databases/{database_id}/pages
Create a new page in the database.
{
"properties": {
"Title": {
"title": [
{
"text": {
"content": "New Recipe"
}
}
]
},
"Status": {
"select": {
"name": "Draft"
}
}
}
}
GET /api/pages/{page_id}
Retrieve page information and properties.
page_id (path) - Notion page IDPATCH /api/pages/{page_id}
Update page properties.
{
"properties": {
"Status": {
"select": {
"name": "Published"
}
}
}
}
DELETE /api/pages/{page_id}
Archive (delete) a page.
POST /api/search
Search across the workspace.
{
"query": "recipe",
"filter": {
"value": "page",
"property": "object"
},
"page_size": 10
}
curl -X POST http://localhost:5000/api/databases/YOUR_DATABASE_ID/pages \
-H "Content-Type: application/json" \
-d '{
"properties": {
"Name": {
"title": [{"text": {"content": "Pasta Carbonara"}}]
},
"Difficulty": {
"select": {"name": "Medium"}
},
"Prep Time": {
"number": 30
}
}
}'
curl -X POST http://localhost:5000/api/databases/YOUR_DATABASE_ID/query \
-H "Content-Type: application/json" \
-d '{
"filter": {
"property": "Difficulty",
"select": {
"equals": "Easy"
}
}
}'
The API returns structured error responses with appropriate HTTP status codes.
{
"error": {
"message": "Database not found",
"code": "object_not_found",
"details": {}
}
}
200 - Success201 - Created400 - Bad Request404 - Not Found429 - Rate Limited500 - Internal Server Error