1
0
mirror of https://github.com/dstotijn/go-notion.git synced 2025-06-06 23:36:14 +02:00
2022-08-12 19:49:36 +02:00
2021-12-22 11:18:42 +01:00
2021-12-20 20:12:44 +01:00
2021-12-20 20:12:44 +01:00
2021-05-13 22:11:32 +02:00
2021-07-20 20:48:35 +02:00
2021-12-22 14:41:52 +01:00

go-notion

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

go-notion is a client for the Notion API, written in Go.

Features

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

Databases

Pages

Blocks

Users

Installation

$ go get github.com/dstotijn/go-notion

Getting started

To obtain an API key, follow Notion’s getting started guide.

Code example

First, construct a new Client:

import "github.com/dstotijn/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.

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.

To do

  • Write tests
  • Provide examples

License

MIT License

© 2021 David Stotijn

Description
Go client for the Notion API.
Readme MIT 267 KiB
Languages
Go 100%