The KKBOX English Developer Hub

Welcome to the KKBOX English developer hub. You'll find comprehensive guides and documentation to help you start working with KKBOX English as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Getting Started

Step 1. Create the application client id and client secret

Please sign in KKBOX developer site. Create an app and get the client id and client secret.

Step 2. Get an access token

You can get an access token by calling KKBOX OAuth 2.0 Token API with credentials.

Generate Credentials

echo -n "client_id:client_secret" | base64
fCVTwABPlcO6Qxc7Ll23rsdfsf

Step 2. HTTP Request

POST /oauth2/token HTTP/1.1
Host: account.kkbox.com
Authorization: Basic credentials
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials

By Command Line Tool

curl -u "client_id:client_secret" --data-urlencode "grant_type=client_credentials" https://account.kkbox.com/oauth2/token

Step 2. HTTP Response

{
  "access_token": "fCVTwABPlcO6Qxc7Ll23rsdfsf",
  "expires_in": 1492982700,
  "token_type": "Bearer"
}

Step 3. Fetch resource from KKBOX APIs

While fetch resources from KKBOX APIs. You must add "Authorization: Bearer {ACCESS_TOKEN}" to the HTTP header. For example, calling Search API.

Step 3. HTTP Request

GET /v1.1/search?q=剛好遇見你&type=track&territory=TW HTTP/1.1
Host: api.kkbox.com
Authorization: Bearer fCVTwABPlcO6Qxc7Ll23rsdfsf

By Command Line Tool

curl --header "Authorization: Bearer fCVTwABPlcO6Qxc7Ll23rsdfsf" "https://api.kkbox.com/v1.1/search?q=剛好遇見你&type=track&territory=TW"

Step 3. HTTP Response

{
  "tracks": {...},
  "paging": {...},
  "summary": {...}
}