Fetch all genres for the current top charts.
Technology
- Apple Music 1.0+
URL
GET https://api .music .apple .com /v1 /catalog /{storefront} /genres
Path Parameters
storefront
string
An Apple Music territory, specified by an ISO 3166 alpha-2 country code. The possible values are the id
attributes of Storefront objects.
Query Parameters
l
string
The localization to use, specified by a language tag. The possible values are in the supported
array belonging to the Storefront
object specified by storefront
. Otherwise, the storefront’s default
is used.
limit
number
The limit on the number of objects, or number of objects in the specified relationship, that are returned.
offset
string
The next page or group of objects to fetch.
Response Codes
200 OK
OK
The request was successful.
Discussion
If successful, the HTTP status code is 200 (OK) and the data
array in the ResponseRoot object contains an array of Genre objects. If unsuccessful, the HTTP status code indicates the error and the details are in the errors
array. See Handle a Response.
Example
https://api.music.apple.com/v1/catalog/us/genres
{
"data": [
{
"attributes": {
"name": "Music"
},
"href": "/v1/catalog/us/genres/34",
"id": "34",
"type": "genres"
},
{
"attributes": {
"name": "Alternative"
},
"href": "/v1/catalog/us/genres/20",
"id": "20",
"type": "genres"
},
{
"attributes": {
"name": "Blues"
},
"href": "/v1/catalog/us/genres/2",
"id": "2",
"type": "genres"
},
{
"attributes": {
"name": "Children's Music"
},
"href": "/v1/catalog/us/genres/4",
"id": "4",
"type": "genres"
},
{
"attributes": {
"name": "Christian & Gospel"
},
"href": "/v1/catalog/us/genres/22",
"id": "22",
"type": "genres"
},
{
"attributes": {
"name": "Classical"
},
"href": "/v1/catalog/us/genres/5",
"id": "5",
"type": "genres"
},
{
"attributes": {
"name": "Comedy"
},
"href": "/v1/catalog/us/genres/3",
"id": "3",
"type": "genres"
},
{
"attributes": {
"name": "Country"
},
"href": "/v1/catalog/us/genres/6",
"id": "6",
"type": "genres"
},
{
"attributes": {
"name": "Dance"
},
"href": "/v1/catalog/us/genres/17",
"id": "17",
"type": "genres"
},
{
"attributes": {
"name": "Electronic"
},
"href": "/v1/catalog/us/genres/7",
"id": "7",
"type": "genres"
},
{
"attributes": {
"name": "Fitness & Workout"
},
"href": "/v1/catalog/us/genres/50",
"id": "50",
"type": "genres"
},
{
"attributes": {
"name": "Hip-Hop/Rap"
},
"href": "/v1/catalog/us/genres/18",
"id": "18",
"type": "genres"
},
{
"attributes": {
"name": "Jazz"
},
"href": "/v1/catalog/us/genres/11",
"id": "11",
"type": "genres"
},
{
"attributes": {
"name": "K-Pop"
},
"href": "/v1/catalog/us/genres/51",
"id": "51",
"type": "genres"
},
{
"attributes": {
"name": "Latino"
},
"href": "/v1/catalog/us/genres/12",
"id": "12",
"type": "genres"
},
{
"attributes": {
"name": "Metal"
},
"href": "/v1/catalog/us/genres/1153",
"id": "1153",
"type": "genres"
},
{
"attributes": {
"name": "Music Videos"
},
"href": "/v1/catalog/us/genres/31",
"id": "31",
"type": "genres"
},
{
"attributes": {
"name": "Pop"
},
"href": "/v1/catalog/us/genres/14",
"id": "14",
"type": "genres"
},
{
"attributes": {
"name": "R&B/Soul"
},
"href": "/v1/catalog/us/genres/15",
"id": "15",
"type": "genres"
},
{
"attributes": {
"name": "Reggae"
},
"href": "/v1/catalog/us/genres/24",
"id": "24",
"type": "genres"
},
{
"attributes": {
"name": "Rock"
},
"href": "/v1/catalog/us/genres/21",
"id": "21",
"type": "genres"
},
{
"attributes": {
"name": "Singer/Songwriter"
},
"href": "/v1/catalog/us/genres/10",
"id": "10",
"type": "genres"
},
{
"attributes": {
"name": "Soundtrack"
},
"href": "/v1/catalog/us/genres/16",
"id": "16",
"type": "genres"
},
{
"attributes": {
"name": "World"
},
"href": "/v1/catalog/us/genres/19",
"id": "19",
"type": "genres"
}
]
}