KyleBanks Goodreads Save

Goodreads API client written in Go.

Project README

goodreads

GoDoc  Build Status  Go Report Card  Coverage Status

An unofficial Goodreads API client written in Go.

Usage

The first thing you'll need to do is register for a Goodreads API Key: https://www.goodreads.com/api/keys

Once you have your key, you can initialize a Goodreads client like so:

package main

import (
    "os"
    "github.com/KyleBanks/goodreads"
)

func main() {
    key := os.Getenv("API_KEY")	
    c := goodreads.NewClient(key)
}

With a client initialized, simply call the API methods as needed:

u, err := c.UserShow("38763538")
if err != nil {
    panic(err)
}
fmt.Printf("Loaded user details of %s:\n", u.Name)

The client function names match those of the Goodreads API documentation. For example, user.show is UserShow above. To see the full list of supported methods:

$ go doc github.com/KyleBanks/goodreads Client 

Examples

Example code is available in the example/ directory.

After you've obtained a Goodreads API Key, you can run the examples like so:

$ API_KEY="api key" go run example/example.go
Open Source Agenda is not affiliated with "KyleBanks Goodreads" Project. README Source: KyleBanks/goodreads
Stars
67
Open Issues
0
Last Commit
3 years ago
Repository
License
MIT

Open Source Agenda Badge

Open Source Agenda Rating