1
0
mirror of https://github.com/dstotijn/go-notion.git synced 2024-12-02 09:11:40 +02:00
Go client for the Notion API.
Go to file
2021-12-17 11:18:13 +01:00
block.go Add embed block type 2021-12-17 11:18:13 +01:00
client_test.go Add support for Page's Icon retrieval and updates (#21) 2021-12-09 17:57:08 +01:00
client.go Add callout block type 2021-12-13 11:42:03 +01:00
database.go Add support for Page's Icon retrieval and updates (#21) 2021-12-09 17:57:08 +01:00
error.go Simplify APIError.Unwrap, fix missing error message prefixes 2021-05-14 18:24:56 +02: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 support for Page's Icon retrieval and updates (#21) 2021-12-09 17:57:08 +01:00
LICENSE Initial commit 2021-05-13 22:11:32 +02:00
page.go Add support for Page's Icon retrieval and updates (#21) 2021-12-09 17:57:08 +01:00
parent.go Add Parent field to Database type 2021-07-20 20:48:35 +02:00
README.md Add "create database" endpoint 2021-07-20 22:50:53 +02:00
rich_text.go Add custom type for Notion date properties with optional time 2021-05-23 14:02:17 +02: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 "list users" endpoint support 2021-05-15 20:50:47 +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 July 20, 2021:

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 — Twitter, Email