DiscogsConnect 4.1.1

dotnet add package DiscogsConnect --version 4.1.1
                    
NuGet\Install-Package DiscogsConnect -Version 4.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DiscogsConnect" Version="4.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DiscogsConnect" Version="4.1.1" />
                    
Directory.Packages.props
<PackageReference Include="DiscogsConnect" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add DiscogsConnect --version 4.1.1
                    
#r "nuget: DiscogsConnect, 4.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package DiscogsConnect@4.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=DiscogsConnect&version=4.1.1
                    
Install as a Cake Addin
#tool nuget:?package=DiscogsConnect&version=4.1.1
                    
Install as a Cake Tool

DiscogsConnect

DiscogsConnect is a .NET client library for accessing the REST API v2.0 of Discogs.

Installation

Install with NuGet

Install-Package DiscogsConnect

Quickstart

static async Task Main(string[] args)
{
    var options = new DiscogsOptions
    {
        Token = "...",
        UserAgent = "MyApp/2.0"
    };

    var client = new DiscogsClient(options);
                
    var artist        = await client.Database.GetArtistAsync(1360);
    var artistRelease = await client.Database.GetArtistReleasesAsync(1360, 1, 100);
    var release       = await client.Database.GetReleaseAsync(8310);            
    var masterRelease = await client.Database.GetMasterReleaseAsync(36961);

    var username = "...";
    var items  = await client.UserCollection.GetItemsByFolderAsync(username, 0);
    var wanted = await client.UserWantlist.GetAllAsync(username);
    // ...
}

Rate Limiting

Note that requests are throttled by Discogs by source IP to 60 per minute. The number of requests remaining are passed through headers.

Below you find a simple but working example to wait when you reach the limit of number of requests.

static async Task Main(string[] args)
{
    var options = new DiscogsOptions
    {
        Token = "...",
        UserAgent = "MyApp/2.0"
    };
    
    var httpClient = new HttpClient(new RateLimitHandler(), true);
    var client = new DiscogsClient(options, httpClient);
                                    
    var username = "...";
    var items = await client.UserCollection.GetItemsByFolderAllAsync(username, 0);
}

public class RateLimitHandler : HttpClientHandler
{
    protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
    {
        var response = await base.SendAsync(request, cancellationToken);
        var rateLimit = RateLimit.Parse(response);

        Console.WriteLine($"Used:{rateLimit.Total} - Remaining:{rateLimit.Remaining} - Total:{rateLimit.Total}");

        if (rateLimit.Remaining < 2)
            Thread.Sleep(TimeSpan.FromSeconds(90));

        return response;
    }
}

Development

After cloning the project, go to the Properties directory in the test project, rename _launchSettings.json to launchSettings.json (remove the preceding underscore) and edit the file to insert your personal Discord token. This file is gitignore'd after renaming so you won't have to worry about accidentally leaking your token.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.1.1 166 9/17/2025
4.1.0 162 9/17/2025
4.0.0 727 12/5/2023
3.0.0 626 9/15/2022
2.1.0 716 2/22/2021
0.7.0 3,261 9/20/2011
0.6.0 1,979 8/18/2011
0.5.0 1,990 8/9/2011