All Projects → appleboy → go-kkbox

appleboy / go-kkbox

Licence: MIT License
KKBOX Open API SDK for Golang.

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to go-kkbox

laravel-bitcoinrpc
Bitcoin JSON-RPC Service Provider for Laravel.
Stars: ✭ 83 (+418.75%)
Mutual labels:  api-client
tyfon
typed functions over network
Stars: ✭ 38 (+137.5%)
Mutual labels:  api-client
youtube-deno
A Deno client library of the YouTube Data API.
Stars: ✭ 30 (+87.5%)
Mutual labels:  api-client
approveapi-go
A Go library for using ApproveAPI
Stars: ✭ 16 (+0%)
Mutual labels:  api-client
primeuploads-py
An unoffcial python API client for primeuploads.com
Stars: ✭ 40 (+150%)
Mutual labels:  api-client
canvas python sdk
Canvas Python SDK
Stars: ✭ 21 (+31.25%)
Mutual labels:  api-client
genderize
Python client for the Genderize.io web service.
Stars: ✭ 59 (+268.75%)
Mutual labels:  api-client
fusionauth-typescript-client
A TypeScript client for FusionAuth
Stars: ✭ 37 (+131.25%)
Mutual labels:  api-client
helpscout-docs-api-php
DocsApi client for HelpScout
Stars: ✭ 21 (+31.25%)
Mutual labels:  api-client
vsphere-automation-sdk-rest
REST (Postman and JavaScript) samples and API reference documentation for vSphere using the VMware REST API
Stars: ✭ 194 (+1112.5%)
Mutual labels:  api-client
Custom-Software-For-Xiaomi-Dafang
API and panel site for Xiaomi Dafang
Stars: ✭ 36 (+125%)
Mutual labels:  api-client
webapi
WAI based library for web api
Stars: ✭ 27 (+68.75%)
Mutual labels:  api-client
go-teamcity
Golang client for TeamCity REST API
Stars: ✭ 32 (+100%)
Mutual labels:  sdk-go
healthchecksio
Update and display the status of your healthchecks.io checks.
Stars: ✭ 30 (+87.5%)
Mutual labels:  api-client
thetvdb2
Thetvdb.com API v2 Client
Stars: ✭ 33 (+106.25%)
Mutual labels:  api-client
HaloSharp
A C# wrapper for the Halo® 5 Game Data API.
Stars: ✭ 24 (+50%)
Mutual labels:  api-client
salt-netapi-client
Java bindings for the Salt API
Stars: ✭ 78 (+387.5%)
Mutual labels:  api-client
ContextIO-node
[DEPRECATED] - Official Node.js client library for the Context.IO Email API
Stars: ✭ 86 (+437.5%)
Mutual labels:  api-client
nodejs-passdock
PassDock API methods for iOS Wallet (PassBook)
Stars: ✭ 13 (-18.75%)
Mutual labels:  api-client
adyen-dotnet-api-library
Adyen API Library for .NET
Stars: ✭ 69 (+331.25%)
Mutual labels:  api-client

go-kkbox

GoDoc Build Status codecov Go Report Card

KKBOX Open API SDK for Golang.

Features

  • Tracks
    • /tracks/{track_id}
  • Albums
    • /albums/{album_id}
    • /albums/{album_id}/tracks
  • Artists
    • /artists/{artist_id}
    • /artists/{artist_id}/albums
    • /artists/{artist_id}/top-tracks
    • /artists/{artist_id}/related-artists
  • Shared Playlists
    • /shared-playlists/{playlist_id}
    • /shared-playlists/{playlist_id}/tracks
  • Featured Playlists
    • /featured-playlists
    • /featured-playlists/{playlist_id}
    • /featured-playlists/{playlist_id}/tracks
  • Featured Playlist Categories
    • /featured-playlist-categories
    • /featured-playlist-categories/{category_id}
    • /featured-playlist-categories/{category_id}/playlists
  • Mood Stations
    • /mood-stations
    • /mood-stations/{station_id}
  • Genre Stations
    • /genre-stations
    • /genre-stations/{station_id}
  • New Release Categories
    • /new-release-categories
    • /new-release-categories/{category_id}
    • /new-release-categories/{category_id}/albums
  • Search
    • /search
  • New Hits Playlists
    • /new-hits-playlists
    • /new-hits-playlists/{playlist_id}
    • /new-hits-playlists/{playlist_id}/tracks
  • Charts
    • /charts
    • /charts/{playlist_id}
    • /charts/{playlist_id}/tracks

Install

Install SDK library

$ go get -u github.com/appleboy/go-kkbox

Inital the KKBox client:

package main

import (
	"log"
	"os"

	"github.com/appleboy/go-kkbox"
)

var clientID = os.Getenv("CLIENT_ID")
var clientSecret = os.Getenv("CLIENT_SECRET")

func main() {
	if clientID == "" || clientSecret == "" {
		log.Fatal("missing client id or secret")
	}
	k, err := kkbox.New(clientID, clientSecret)

	if err != nil {
		log.Fatal(err)
	}

	fmt.Println("====== kkbox client ======")
	spew.Dump(k)
	fmt.Println("====== kkbox end ======")

	// fetch charts
	charts, err := k.FetchCharts()
	if err != nil {
		fmt.Printf("%#v\n", err)
	}

	fmt.Printf("%#v\n", charts)

	ranks, err := k.FetchChartPlayList("4nUZM-TY2aVxZ2xaA-")
	if err != nil {
		fmt.Printf("%#v\n", err)
	}

	spew.Dump(ranks)

	tracks, err := k.FetchChartPlayListTrack("4nUZM-TY2aVxZ2xaA-", kkbox.Param{
		PerPage:   1,
		Page:      2,
		Territory: "HK",
	})
	if err != nil {
		fmt.Printf("%#v\n", err)
	}

	spew.Dump(tracks)
	log.Println("length: ", len(tracks.Data))
}

Run program:

$ CLIENT_ID=xxx CLIENT_SECRET=xxx go run main.go
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].