Notion API

Create an integration to retrieve an API token, add your database and page ID's as variables in the collection, and start making your requests!
For our full documentation, including sample integrations and guides, visit developers.notion.com
Need more help? Join our developer community on Slack
Installation
To install the library, use the following command:
go get github.com/go-api-libs/notion/pkg/notion
Usage
Example 1: Retrieve a Page
package main
import (
"context"
"github.com/go-api-libs/notion/pkg/notion"
"github.com/google/uuid"
)
func main() {
c, err := notion.NewClient()
if err != nil {
panic(err)
}
ctx := context.Background()
page, err := c.GetPage(ctx, uuid.MustParse("96245c8f-1784-44a4-82ad-1941127c3ec3"))
if err != nil {
panic(err)
}
// Use page object
}
Example 2: Retrieve block children
package main
import (
"context"
"github.com/go-api-libs/notion/pkg/notion"
"github.com/google/uuid"
)
func main() {
c, err := notion.NewClient()
if err != nil {
panic(err)
}
ctx := context.Background()
blocksList, err := c.GetBlocks(ctx, uuid.MustParse("96245c8f-1784-44a4-82ad-1941127c3ec3"), ¬ion.GetBlocksParams{
PageSize: 100,
StartCursor: uuid.MustParse("d05aa478-397e-4954-b694-b7c1c6c78956"),
})
if err != nil {
panic(err)
}
// Use blocksList object
}
Contributing
If you have any contributions to make, please submit a pull request or open an issue on the GitHub repository.
License
This project is licensed under the MIT License. See the LICENSE file for details.