GithubHelp home page GithubHelp logo

insire / monstercatnet Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 2.0 301 KB

MonstercatNet is a .NET wrapper around the API that drives monstercat.com written in C#

License: MIT License

C# 99.90% PowerShell 0.04% Shell 0.06%
monstercat api wrapper-library monstercat-api hacktoberfest

monstercatnet's Introduction

MonstercatNet

License: MIT NuGet Build status CodeFactor codecov

MonstercatNet is a .NET wrapper around the API that drives monstercat.com written in C#.

Supported Platforms

Since this library relies on refit for setting up the API endpoints, there are limitations. You can find the limitations here.

Installation

You can find the latest nuget package here.

Changelog

See here

Usage

creating the api client

using SoftThorn.MonstercatNet;

var httpClient  = new HttpClient().UseMonstercatApiV2();
var client = MonstercatApi.Create(httpClient);

creating the cdn client

using SoftThorn.MonstercatNet;

var httpClient  = new HttpClient().UseMonstercatCdn();
var client = MonstercatCdn.Create(httpClient);

NOTE: The HttpClient for the CDN should be a different instance than the one for the API, as they use a different BaseAddress.

signing in

using SoftThorn.MonstercatNet;

var credentials = new ApiCredentials()
{
    Email = "", // your account e-mail
    Password = "" // your password
};

await client.Login(credentials);

searching for music

using SoftThorn.MonstercatNet;

var tracks = await client.SearchTracks(new TrackSearchRequest()
{
    Limit = 1,
    Skip = 0,
    Creatorfriendly = true,
    Genres = new[] { "Drumstep" },
    ReleaseTypes = new[] { "Album" },
    Tags = new[] { "Uncaged", "Energetic" },
});

getting albumns, EPs and singles (releases)

using SoftThorn.MonstercatNet;

var releases = await client.GetReleases(new ReleaseBrowseRequest()
{
    Limit = 1,
    Skip = 0
});

getting release details

using SoftThorn.MonstercatNet;

var release = await client.GetRelease("the release catalogId which looks like this MCRLX001-8");

getting release cover

using SoftThorn.MonstercatNet;

var cdn = MonstercatCdn.Create(new HttpClient(new HttpLoggingHandler()).UseMonstercatCdn());

var builder = ReleaseCoverArtBuilder
    .Create()
    .ForRelease(new TrackRelease() { CatalogId = "the release catalog Id which looks like this 2FMCS1347" };);

var releaseCoverBytes = await cdn.GetReleaseCoverAsByteArray(builder);
var releaseCoverStream = await cdn.GetReleaseCoverAsStream(builder);

Endpoints

The currently implemented and supported endpoints can be found here

Versions

See here

Contributing

See here


A special thanks goes out to defvs who with many others documented the unofficial API.

monstercatnet's People

Contributors

deccer avatar insire avatar karimelazzouni avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

monstercatnet's Issues

add endpoint self/playlists

See

  • should include unit tests for validating the request in memory
  • should include integration/live test for executing the request against the actual monstercat api

Add endpoint POST /self/playlist

See

  • should include unit tests for validating the request in memory
  • should include integration/live test for executing the request against the actual monstercat api

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.