go-notion is a client for the Notion API, written in Go.
The client supports all (non-deprecated) endpoints available in the Notion API, as of July 20, 2021:
- Retrieve a database
- Query a database
- Create a database
- Retrieve a page
- Create a page
- Update page properties
- Retrieve block children
- Append block children
- Retrieve a user
- List all users
- Search
$ go get github.com/eblanchette/go-notion
To obtain an API key, follow Notion’s getting started guide.
First, construct a new Client
:
import "github.com/eblanchette/go-notion"
(...)
client := notion.NewClient("secret-api-key")
Then, use the methods defined on Client
to make requests to the API. For
example:
page, err := client.FindPageByID(context.Background(), "18d35eb5-91f1-4dcb-85b0-c340fd965015")
if err != nil {
// Handle error...
}
👉 Check out the docs on pkg.go.dev for further reference and examples.
The Notion API is currently in public beta.
v1.0
of the module is released.
- Write tests
- Provide examples