#notion-api #notion #properties #deserialize

notionrs

A Notion API client that provides type-safe request serialization and response deserialization

48 releases

Uses new Rust 2024

new 1.0.0-beta.3 May 4, 2025
1.0.0-alpha.40 Apr 15, 2025
1.0.0-alpha.37 Mar 11, 2025
1.0.0-alpha.26 Dec 27, 2024
1.0.0-alpha.15 Nov 28, 2024

#147 in HTTP client

Download history 23/week @ 2025-01-14 105/week @ 2025-01-21 120/week @ 2025-01-28 33/week @ 2025-02-04 5/week @ 2025-02-11 344/week @ 2025-02-18 378/week @ 2025-02-25 161/week @ 2025-03-04 157/week @ 2025-03-11 4/week @ 2025-03-18 24/week @ 2025-03-25 204/week @ 2025-04-01 87/week @ 2025-04-08 128/week @ 2025-04-15 16/week @ 2025-04-22 843/week @ 2025-04-29

1,133 downloads per month
Used in 2 crates

MIT/Apache

470KB
10K SLoC

Notion API Client for Rust

Unit Test Check Documentation Build Crates.io

ogp

Status: Alpha Release! (Under Construction) 🚧

This project is currently under active development and is not yet ready for production use. Features and API stability may change without notice. Contributions and feedback are welcome!

Features currently released

As part of the alpha release, the following features are available. Please note that API changes may occur before the official release.

  • Blocks
    • Append block children
    • Retrieve a block
    • Retrieve block children
    • Update a block
    • Delete a block
  • Databases
    • Create a database
    • Query a database
    • Retrieve a database
    • Update a database
  • Pages
    • Create a page
    • Retrieve a page property item
    • Retrieve a page
    • Update page properties
  • Users
    • List all users
    • Retrieve a user
    • Retrieve your token's bot user
  • Comments
    • Create comment
    • Retrieve comments
  • Search
    • Search by title

Basic Usage

Below is a basic example. (More detailed documentation is coming soon, so please stay tuned!)

use notionrs_types::prelude::*;
use notionrs::{Client, Error};

#[tokio::main]
async fn main() -> Result<(), Error> {
    let client = Client::new().secret("API_KEY");

    let rich_text = RichText::from("rich text");

    let block = Block::Paragraph {
        paragraph: ParagraphBlock::default()
            .rich_text(vec![rich_text.clone()])
            .blue_background(),
    };

    let request = client
        .append_block_children()
        .block_id("PARENT_BLOCK_ID")
        .children(vec![block]);

    let response = request.send().await?;

    println!("{:?}", response);

    Ok(())
}

Dependencies

~5–20MB
~313K SLoC