0.2.0 • Published 8 years ago

mixradio v0.2.0

Weekly downloads
8
License
MIT
Repository
-
Last release
8 years ago

Travis Build Status Circle Build Status Appveyor Build Status Build Status io.js supported

Install

npm install mixradio

Usage

var mixradio = require('mixradio');

Set Config

var mix = new MixRadio();
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringoptionalMust be set to “music” in this version of the API, otherwise a 400 response will be returned
uristringoptionalMix radio Api url

Search

Example

   mixradio.Search({q:"lady gaga"}).then(function(data){
     console.log(data);
   });
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringrequiredMust be set to “music” in this version of the API, otherwise a 400 response will be returned
qstringoptionalFree-text search filter - this can be an artist or track name or other keywords such as “love”.
idstringoptionalAn artist or product id to get details for.
categorystringoptionalFilters for results returned to a specific Category.
genrestringoptionalFilters for results returned to a specific Genre.
locationstringoptionalFind artists orginating around a geocoordinate - e.g. location=51.45534,-2.59239
maxdistancestringoptionalSpecifies a maximum distance from the location in km - e.g. maxdistance=5 - the default is 10km.
itemsperpageIntegeroptionalFor pagination, the number of results to return.
startindexIntegeroptionalFor 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);
   });
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringrequiredMust be set to “music” in this version of the API, otherwise a 400 response will be returned
qstringoptionalFree-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);
   });
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringrequiredMust be set to “music” in this version of the API, otherwise a 400 response will be returned
qstringoptionalFree-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);
   });
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringrequiredMust be set to “music” in this version of the API, otherwise a 400 response will be returned
idstringrequiredThe ID of the artist to get products for.
categorystringoptionalFilters for results returned to a specific Category.
orderbystringoptionalA field to order results returned by - see Order By Enumeration.
sortorderstringoptionalThe direction to sort in - see Sort Order Enumeration.
itemsperpageIntegeroptionalFor pagination, the number of results to return.
startindexIntegeroptionalFor pagination, the zero-based index of the first result to be returned.

Genres

Example

   mixradio.Genres({}).then(function(data){
     console.log(data);
   });
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringrequiredMust 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);
   });
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringrequiredMust be set to “music” in this version of the API, otherwise a 400 response will be returned
genreidstringrequiredThe genre to get the chart for.
categorystringrequiredDetermines the type of chart returned. For this resource, only the album and track Category types are valid.
itemsperpageIntegeroptionalFor pagination, the number of results to return.
startindexIntegeroptionalFor 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);
   });
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringrequiredMust be set to “music” in this version of the API, otherwise a 400 response will be returned
genreidstringrequiredThe genre to get the chart for.
categorystringrequiredDetermines the type of chart returned. For this resource, only the album and track Category types are valid.
itemsperpageIntegeroptionalFor pagination, the number of results to return.
startindexIntegeroptionalFor pagination, the zero-based index of the first result to be returned.

ProductDetails

Example

   mixradio.ProductDetails({id:"234234"}).then(function(data){
     console.log(data);
   });
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringrequiredMust be set to “music” in this version of the API, otherwise a 400 response will be returned
idstringrequiredThe ID of the product to get details for.

Charts

Example

   mixradio.Charts({category:"xxxx"}).then(function(data){
     console.log(data);
   });
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringrequiredMust be set to “music” in this version of the API, otherwise a 400 response will be returned
categorystringrequiredDetermines the type of chart returned. For this resource, only the album and track Category types are valid.
itemsperpageIntegeroptionalFor pagination, the number of results to return.
startindexIntegeroptionalFor pagination, the zero-based index of the first result to be returned.

NewReleases

Example

   mixradio.NewReleases({category:"xxxx"}).then(function(data){
     console.log(data);
   });
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringrequiredMust be set to “music” in this version of the API, otherwise a 400 response will be returned
categorystringrequiredDetermines the type of chart returned. For this resource, only the album and track Category types are valid.
itemsperpageIntegeroptionalFor pagination, the number of results to return.
startindexIntegeroptionalFor pagination, the zero-based index of the first result to be returned.

ArtistImage

Example

   mixradio.ArtistImage({size:"xxxx"}).then(function(data){
     console.log(data);
   });
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringrequiredMust be set to “music” in this version of the API, otherwise a 400 response will be returned
sizestringrequiredThe image size to get - see Image Size Enumeration.
idStringoptionalThe ID of the artist - supply an ID or Name.
nameStringoptionalThe Name of the artist - supply an ID or Name.

ProductImage

Example

   mixradio.ProductImage({size:"xxxx"}).then(function(data){
     console.log(data);
   });
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringrequiredMust be set to “music” in this version of the API, otherwise a 400 response will be returned
sizestringrequiredThe image size to get - see Image Size Enumeration.
idStringoptionalThe 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);
   });
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringrequiredMust be set to “music” in this version of the API, otherwise a 400 response will be returned
categoryEnumoptionalgeneral or genre
itemsperpageIntegeroptionalFor pagination, the number of results to return.
startindexIntegeroptionalFor pagination, the zero-based index of the first result to be returned..

Mixes

Example

   mixradio.Mixes({id:"xxx"}).then(function(data){
     console.log(data);
   });
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringrequiredMust be set to “music” in this version of the API, otherwise a 400 response will be returned
idStringrequiredThe ID of the Mix Group to get mixes for.
itemsperpageIntegeroptionalFor pagination, the number of results to return.
startindexIntegeroptionalFor pagination, the zero-based index of the first result to be returned..

ProductRecommendations

Example

   mixradio.ProductRecommendations({}).then(function(data){
     console.log(data);
   });
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringrequiredMust be set to “music” in this version of the API, otherwise a 400 response will be returned
categoryStringoptionalAn artist name for the track to recommend from.
albumStringoptionalAn album name for the track to recommend from.
nameStringoptionalA track name for the track to recommend from.
genreStringoptionalA genre for the track to recommend from.
idStringoptionalThe 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);
   });
ParamsTypeOptionDesc
countrycodestringrequiredThe ISO3166-2 country code for the user’s home territory.
domainstringrequiredMust be set to “music” in this version of the API, otherwise a 400 response will be returned
idstringrequiredThe ID of the artist.
itemsperpageIntegeroptionalFor pagination, the number of results to return.
startindexIntegeroptionalFor pagination, the zero-based index of the first result to be returned.