mixradio
v0.2.0
Published
mixradio metadata api module
Downloads
8
Readme
Install
npm install mixradio
Usage
var mixradio = require('mixradio');
Set Config
var mix = new MixRadio();
| Params | Type | Option | Desc | |---------|-------|--------|------| |countrycode | string | required | The ISO3166-2 country code for the user’s home territory. | |domain | string | optional | Must be set to “music” in this version of the API, otherwise a 400 response will be returned | |uri| string | optional | Mix radio Api url |
Search
Example
mixradio.Search({q:"lady gaga"}).then(function(data){
console.log(data);
});
| Params | Type | Option | Desc | |---------|-------|--------|------| |countrycode | string | required | The ISO3166-2 country code for the user’s home territory. | |domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned | |q | string | optional | Free-text search filter - this can be an artist or track name or other keywords such as “love”. | |id | string | optional | An artist or product id to get details for. | |category | string | optional | Filters for results returned to a specific Category. | |genre | string | optional | Filters for results returned to a specific Genre. | |location | string | optional | Find artists orginating around a geocoordinate - e.g. location=51.45534,-2.59239 | |maxdistance | string | optional | Specifies a maximum distance from the location in km - e.g. maxdistance=5 - the default is 10km. | |itemsperpage | Integer | optional | For pagination, the number of results to return. | |startindex | Integer | optional | For pagination, the zero-based index of the first result to be returned. |
ArtistSuggestions
Example
mixradio.ArtistSuggestions({q:"foo bar"}).then(function(data){
console.log(data);
});
| Params | Type | Option | Desc | |---------|-------|--------|------| |countrycode | string | required | The ISO3166-2 country code for the user’s home territory. | |domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned | |q | string | optional | Free-text search filter - this can be an artist or track name or other keywords such as “love”. |
SearchSuggestions
Example
mixradio.SearchSuggestions({q:"foo bar"}).then(function(data){
console.log(data);
});
| Params | Type | Option | Desc | |---------|-------|--------|------| |countrycode | string | required | The ISO3166-2 country code for the user’s home territory. | |domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned | |q | string | optional | Free-text search filter - this can be an artist or track name or other keywords such as “love”. |
ArtistProducts
Example
mixradio.ArtistProducts({id:"234234"}).then(function(data){
console.log(data);
});
| Params | Type | Option | Desc | |---------|-------|--------|------| |countrycode | string | required | The ISO3166-2 country code for the user’s home territory. | |domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned | |id | string | required | The ID of the artist to get products for. | |category | string | optional | Filters for results returned to a specific Category. | |orderby | string | optional | A field to order results returned by - see Order By Enumeration. | |sortorder | string | optional | The direction to sort in - see Sort Order Enumeration. | |itemsperpage | Integer | optional | For pagination, the number of results to return. | |startindex | Integer | optional | For pagination, the zero-based index of the first result to be returned. |
Genres
Example
mixradio.Genres({}).then(function(data){
console.log(data);
});
| Params | Type | Option | Desc | |---------|-------|--------|------| |countrycode | string | required | The ISO3166-2 country code for the user’s home territory. | |domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned |
GenreCharts
Example
mixradio.GenreCharts({genreid:"234234" category:"xxx"}).then(function(data){
console.log(data);
});
| Params | Type | Option | Desc | |---------|-------|--------|------| |countrycode | string | required | The ISO3166-2 country code for the user’s home territory. | |domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned | |genreid | string | required | The genre to get the chart for. | |category | string | required | Determines the type of chart returned. For this resource, only the album and track Category types are valid. | |itemsperpage | Integer | optional | For pagination, the number of results to return. | |startindex | Integer | optional | For pagination, the zero-based index of the first result to be returned. |
GenreNewReleases
Example
mixradio.GenreNewReleases({genreid:"234234" category:"xxx"}).then(function(data){
console.log(data);
});
| Params | Type | Option | Desc | |---------|-------|--------|------| |countrycode | string | required | The ISO3166-2 country code for the user’s home territory. | |domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned | |genreid | string | required | The genre to get the chart for. | |category | string | required | Determines the type of chart returned. For this resource, only the album and track Category types are valid. | |itemsperpage | Integer | optional | For pagination, the number of results to return. | |startindex | Integer | optional | For pagination, the zero-based index of the first result to be returned. |
ProductDetails
Example
mixradio.ProductDetails({id:"234234"}).then(function(data){
console.log(data);
});
| Params | Type | Option | Desc | |---------|-------|--------|------| |countrycode | string | required | The ISO3166-2 country code for the user’s home territory. | |domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned | |id | string | required | The ID of the product to get details for. |
Charts
Example
mixradio.Charts({category:"xxxx"}).then(function(data){
console.log(data);
});
| Params | Type | Option | Desc | |---------|-------|--------|------| |countrycode | string | required | The ISO3166-2 country code for the user’s home territory. | |domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned | |category | string | required | Determines the type of chart returned. For this resource, only the album and track Category types are valid. | |itemsperpage | Integer | optional | For pagination, the number of results to return. | |startindex | Integer | optional | For pagination, the zero-based index of the first result to be returned. |
NewReleases
Example
mixradio.NewReleases({category:"xxxx"}).then(function(data){
console.log(data);
});
| Params | Type | Option | Desc | |---------|-------|--------|------| |countrycode | string | required | The ISO3166-2 country code for the user’s home territory. | |domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned | |category | string | required | Determines the type of chart returned. For this resource, only the album and track Category types are valid. | |itemsperpage | Integer | optional | For pagination, the number of results to return. | |startindex | Integer | optional | For pagination, the zero-based index of the first result to be returned. |
ArtistImage
Example
mixradio.ArtistImage({size:"xxxx"}).then(function(data){
console.log(data);
});
| Params | Type | Option | Desc | |---------|-------|--------|------| |countrycode | string | required | The ISO3166-2 country code for the user’s home territory. | |domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned | |size | string | required | The image size to get - see Image Size Enumeration. | |id | String | optional | The ID of the artist - supply an ID or Name. | |name | String | optional | The Name of the artist - supply an ID or Name. |
ProductImage
Example
mixradio.ProductImage({size:"xxxx"}).then(function(data){
console.log(data);
});
| Params | Type | Option | Desc | |---------|-------|--------|------| |countrycode | string | required | The ISO3166-2 country code for the user’s home territory. | |domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned | |size | string | required | The image size to get - see Image Size Enumeration. | |id | String | optional | The ID of the product. |
ProductSample
Example
mixradio.ProductSample({id:"xxxx"}).then(function(data){
console.log(data);
});
```
| Params | Type | Option | Desc |
|---------|-------|--------|------|
|countrycode | string | required | The [ISO3166-2](https://www.iso.org/obp/ui/#search/code/) country code for the user’s home territory. |
|domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned |
|id | String | required | The ID of the product. |
### MixGroups
#### Example
```js
mixradio.MixGroups({}).then(function(data){
console.log(data);
});
| Params | Type | Option | Desc |
|---------|-------|--------|------|
|countrycode | string | required | The ISO3166-2 country code for the user’s home territory. |
|domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned |
|category | Enum | optional | general
or genre
|
|itemsperpage | Integer | optional | For pagination, the number of results to return. |
|startindex | Integer | optional | For pagination, the zero-based index of the first result to be returned.. |
Mixes
Example
mixradio.Mixes({id:"xxx"}).then(function(data){
console.log(data);
});
| Params | Type | Option | Desc | |---------|-------|--------|------| |countrycode | string | required | The ISO3166-2 country code for the user’s home territory. | |domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned | |id | String | required | The ID of the Mix Group to get mixes for. | |itemsperpage | Integer | optional | For pagination, the number of results to return. | |startindex | Integer | optional | For pagination, the zero-based index of the first result to be returned.. |
ProductRecommendations
Example
mixradio.ProductRecommendations({}).then(function(data){
console.log(data);
});
| Params | Type | Option | Desc | |---------|-------|--------|------| |countrycode | string | required | The ISO3166-2 country code for the user’s home territory. | |domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned | |category | String | optional | An artist name for the track to recommend from. | |album | String | optional | An album name for the track to recommend from. | |name | String | optional | A track name for the track to recommend from. | |genre | String | optional | A genre for the track to recommend from. | |id | String | optional | The ID of the product to get recommendations for. If an ID is supplied, the creator, album and name parameters are ignored. |
SimilarArtists
Example
mixradio.SimilarArtists({id:"xxxx"}).then(function(data){
console.log(data);
});
| Params | Type | Option | Desc | |---------|-------|--------|------| |countrycode | string | required | The ISO3166-2 country code for the user’s home territory. | |domain | string | required | Must be set to “music” in this version of the API, otherwise a 400 response will be returned | |id | string | required | The ID of the artist. | |itemsperpage | Integer | optional | For pagination, the number of results to return. | |startindex | Integer | optional | For pagination, the zero-based index of the first result to be returned. |