saltbo / notion

Go client for official Notion API.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

notion

GitHub tag (latest SemVer) Go Reference GitHub Go Report Card

notion is a Go client for the Notion API.

Features

The client supports all (non-deprecated) endpoints available in the Notion API, as of May 15, 2021:

Getting started

To obtain an API key (required for API calls), follow Notion’s getting started guide.

Code example

First, construct a new Client:

import "github.com/kjk/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.GetPage(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.

Status

The Notion API is currently in public beta.

⚠️ Although the API itself is versioned, this client will make breaking changes in its code until v1.0 of the module is released.

Official Notion API is still limited:

  • not all block types are supported
  • no way to avoid re-downloading data we already have

Other clients

License

MIT License

I based this code on https://github.com/dstotijn/go-notion (as of https://github.com/dstotijn/go-notion/commit/55aa9db5c7a72af2a57ac953ebbbdbdec3e1efa1, May 19 2021). I made API changes so it's not compatible with go-notion.

About

Go client for official Notion API.

License:MIT License


Languages

Language:Go 99.9%Language:Shell 0.0%Language:Batchfile 0.0%