/google-photos-api-client-go

Google photos api client in go

Primary LanguageGoMIT LicenseMIT

Google Photos API client (Go library)

Build Status Go Report Card

This is a Google Photos API client based on the official Google Photos API client library, that was removed from Google API client library for Go and it was mirrored here.

Contains two packages:

Quick start

Download using go get github.com/gphotosuploader/google-photos-api-client-go

Then use this way:

import "github.com/gphotosuploader/google-photos-api-client-go/noserver-gphotos"

func main() {
	// ask the user to authenticate on google in the browser
	photosClient, err := gphotosclient.NewClient(
		gphotosclient.AuthenticateUser(
			gphotoslib.NewOAuthConfig(gphotoslib.APIAppCredentials{
				ClientID:     "your-google-client-id",
				ClientSecret: "very_secret",
			}),
		),
	)
	if err != nil {
		log.Fatal(err)
	}

	_, err = photosClient.UploadFile("/path/to/file")
	if err != nil {
		log.Fatal(err)
	}
}