| Crates.io | notion-client |
| lib.rs | notion-client |
| version | 1.0.10 |
| created_at | 2024-02-13 13:55:42.119739+00 |
| updated_at | 2025-05-30 19:18:33.007423+00 |
| description | A Rust client library for the Notion API |
| homepage | |
| repository | https://github.com/takassh/notion-client |
| max_upload_size | |
| id | 1138513 |
| size | 255,134 |
A Rust client library for the Notion API. Supports (almost) all endpoints — everything except authentication, for now!
⚡️ The only Rust crate that is actively maintained and always up-to-date with the latest Notion API version.
Corresponding Notion API: Query a database
use notion_client::endpoints::{
databases::query::request::{QueryDatabaseRequest, Sort, SortDirection, Timestamp},
Client,
};
const NOTION_DB_ID: &str = ""; // ⚠️ Set your DB id which can be accessible from API
const NOTION_TOKEN: &str = ""; // ⚠️ Set your notion token
#[tokio::main]
async fn main() {
// Initialize client
let client = Client::new(NOTION_TOKEN.to_string(), None);
let Ok(client) = client else {
panic!("error");
};
// Set up request parameters
let request = QueryDatabaseRequest {
sorts: Some(vec![Sort::Timestamp {
timestamp: Timestamp::CreatedTime,
direction: SortDirection::Ascending,
}]),
..Default::default()
};
// Send request
let res = client
.databases
.query_a_database(NOTION_DB_ID, request)
.await;
// See result
print!("{:#?}", res);
}
👉 See more examples
Feel free to suggest new features or improvements! 🙌
Contributions are welcome and appreciated! ❤️
If you have an idea:
Here’s our Contributing Guide.
Let’s make this library even better together!
This project is licensed under the MIT License.
Q: Is authentication supported? A: Not yet — it's on our roadmap!
Q: Is this an official Notion SDK? A: No, this is a community-driven open-source library.
Q: How is this different from other crates? A: This is the only Rust crate actively maintained and updated to match the latest Notion API versions. If you want up-to-date support, you’re in the right place!
If you find this library useful: