1
0
mirror of https://github.com/dstotijn/go-notion.git synced 2024-11-28 08:58:51 +02:00
Go client for the Notion API.
Go to file
2022-08-13 19:46:00 +02:00
block.go Add created_by and last_edited_by support, add archived for DB (#30) 2022-08-13 19:46:00 +02:00
client_test.go Add created_by and last_edited_by support, add archived for DB (#30) 2022-08-13 19:46:00 +02:00
client.go Handle changes introduced in version 2022-02-22 (#29) 2022-08-13 12:28:49 +02:00
cover.go Add file metadata to file DB page prop 2021-12-20 20:12:44 +01:00
database.go Add created_by and last_edited_by support, add archived for DB (#30) 2022-08-13 19:46:00 +02:00
error.go Simplify APIError.Unwrap, fix missing error message prefixes 2021-05-14 18:24:56 +02:00
file.go Add file metadata to file DB page prop 2021-12-20 20:12:44 +01:00
go.mod Add tests for NewClient and Client.FindDatabaseByID 2021-05-17 21:08:13 +02:00
go.sum Add tests for NewClient and Client.FindDatabaseByID 2021-05-17 21:08:13 +02:00
icon.go Add file metadata to file DB page prop 2021-12-20 20:12:44 +01:00
LICENSE Initial commit 2021-05-13 22:11:32 +02:00
page.go Add created_by and last_edited_by support, add archived for DB (#30) 2022-08-13 19:46:00 +02:00
parent.go Add parent property to blocks (#28) 2022-08-12 21:03:51 +02:00
README.md Add missing endpoints to README 2021-12-22 14:41:52 +01:00
rich_text.go Add time_zone field to date prop type 2021-12-22 14:29:37 +01:00
search.go Fix faulty search sort type, add consts for sort props 2021-05-27 20:50:04 +02:00
time_test.go Add custom type for Notion date properties with optional time 2021-05-23 14:02:17 +02:00
time.go Add custom type for Notion date properties with optional time 2021-05-23 14:02:17 +02:00
user.go Add created_by and last_edited_by support, add archived for DB (#30) 2022-08-13 19:46:00 +02:00
util.go Fix incorrect types for Formula, Relation and Rollup page props 2021-05-24 16:33:03 +02: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