A go client for the Notion API
This aims to be an unofficial Go version of the official SDK which is written in JavaScript.
go get -u github.com/mkfsn/notion-go
c := notion.New("<NOTION_AUTH_TOKEN>")
// Retrieve block children
c.Blocks().Children().List(context.Background(), notion.BlocksChildrenListParameters{...})
// Append block children
c.Blocks().Children().Append(context.Background(), notion.BlocksChildrenAppendParameters{...})
// List databases
c.Databases().List(context.Background(), notion.DatabasesListParameters{...})
// Query a database
c.Databases().Query(context.Background(), notion.DatabasesQueryParameters{...})
// Retrieve a database
c.Databases().Retrieve(context.Background(), notion.DatabasesRetrieveParameters{...})
// Create a page
c.Pages().Create(context.Background(), notion.PagesCreateParameters{...})
// Retrieve a page
c.Pages().Retreive(context.Background(), notion.PagesRetrieveParameters{...})
// Update page properties
c.Pages().Update(context.Background(), notion.PagesUpdateParameters{...})
// List all users
c.Users().List(context.Background(), notion.UsersListParameters{...})
// Retrieve a user
c.Users().Retrieve(context.Background(), notion.UsersRetrieveParameters{...})
// Search
c.Search(context.Background(), notion.SearchParameters{...})
For more information, please see examples.
This client supports all endpoints in the Notion API.