Skip to content

Highlights

Csaba Okrona edited this page Oct 6, 2020 · 1 revision

Instapaper's highlights API

Read more at the official Instapaper API docs page

Operations

List

svc := instapaper.HighlightService{
			Client: apiClient,
		}
		highlightList, err := svc.List(123456)

This returns a slice of Highlight:

type Highlight struct {
	ID         int `json:"highlight_id"`
	BookmarkID int `json:"bookmark_id"`
	Text       string
	Note       string
	Time       json.Number
	Position   int
}

Add

Add requires a bookmark ID, a text and a position to create a new highlight. The triplet needs to be unique, otherwise, an error is returned. It returns the created Highlight.

folder, err := svc.Add("Totally unique folder name I swear")

Delete

Delete removes a highlight from the specified bookmark. It requires a Highlight ID as a parameter.

err := svc.Delete(123456)