Skip to content
DocumentationAPI Reference

Get Available Markets

client.Markets.List(ctx) (*MarketListResponse, error)
GET/markets

Get the list of markets where Spotify is available.

ReturnsExpand Collapse
type MarketListResponse struct{…}
Markets []stringoptional

Get Available Markets

package main

import (
  "context"
  "fmt"

  "github.com/cjavdev/spotted-go"
  "github.com/cjavdev/spotted-go/option"
)

func main() {
  client := spotted.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  markets, err := client.Markets.List(context.TODO())
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", markets.Markets)
}
{
  "markets": [
    "CA",
    "BR",
    "IT"
  ]
}
Returns Examples
{
  "markets": [
    "CA",
    "BR",
    "IT"
  ]
}