https://github.com/mkfsn/notion-go
Unofficial SDK of official notion API in Go
https://github.com/mkfsn/notion-go
api go notion open-source
Last synced: 8 months ago
JSON representation
Unofficial SDK of official notion API in Go
- Host: GitHub
- URL: https://github.com/mkfsn/notion-go
- Owner: mkfsn
- License: mit
- Created: 2021-05-14T04:06:39.000Z (over 4 years ago)
- Default Branch: develop
- Last Pushed: 2021-05-19T17:26:52.000Z (over 4 years ago)
- Last Synced: 2025-04-10T01:14:46.317Z (8 months ago)
- Topics: api, go, notion, open-source
- Language: Go
- Homepage:
- Size: 150 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# notion-go
[](https://goreportcard.com/report/github.com/mkfsn/notion-go)
[](https://github.com/mkfsn/notion-go/actions)
[](https://codecov.io/gh/mkfsn/notion-go)
[](https://pkg.go.dev/github.com/mkfsn/notion-go)

[](./LICENSE.md)
A go client for the [Notion API](https://developers.notion.com/)
## Description
This aims to be an unofficial Go version of [the official SDK](https://github.com/makenotion/notion-sdk-js)
which is written in JavaScript.
## Installation
```
go get -u github.com/mkfsn/notion-go
```
## Usage
```go
c := notion.New("")
// 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](./examples).
## Supported Features
This client supports all endpoints in the [Notion API](https://developers.notion.com/reference/intro).
- [x] Users ✅
* [x] [Retrieve](https://developers.notion.com/reference/get-user) ✅
* [x] [List](https://developers.notion.com/reference/get-users) ✅
- [x] Databases ✅
* [x] [Retrieve](https://developers.notion.com/reference/get-database) ✅
* [x] [List](https://developers.notion.com/reference/get-databases) ✅
* [x] [Query](https://developers.notion.com/reference/post-database-query) ✅
- [x] Pages ✅
* [x] [Retrieve](https://developers.notion.com/reference/get-page) ✅
* [x] [Create](https://developers.notion.com/reference/post-page) ✅️
* [x] [Update](https://developers.notion.com/reference/patch-page) ✅️
- [x] Blocks ✅️
* [x] Children ✅
- [x] [Retrieve](https://developers.notion.com/reference/get-block-children) ✅
- [x] [Append](https://developers.notion.com/reference/patch-block-children) ✅
- [x] [Search](https://developers.notion.com/reference/post-search) ✅