Skip to content
Csaba Okrona edited this page Oct 6, 2020 · 5 revisions

Basics, authentication and conventions

Instapaper's API uses OAuth v1a. If you want to access the full API, you need two things:

  1. OAuth client credentials (a client ID and a client secret) - you need to request them here.
  2. Your username (usually your email address) and password for Instapaper.

You can pin the version in go.mod: github.com/ochronus/instapaper-go-client v1.0.0

You can instantiate a new client like this:

import "github.com/ochronus/instapaper-go-client/instapaper"
.
.
.
apiClient, err := instapaper.NewClient("YOUR CLIENT ID", "YOUR CLIENT SECRET", 
                                       "YOUR INSTAPAPER EMAIL ADDRESS", "YOUR INSTAPAPER PASSWORD")

Once you have a client instance, the next thing you need to do is authenticate against Instapaper's API so the client gets the tokens it needs to call any of the endpoints:

authErr := apiClient.Authenticate()

Without this, all calls will return an error immediately.