PeerBerry.API 2.0.0

dotnet add package PeerBerry.API --version 2.0.0
                    
NuGet\Install-Package PeerBerry.API -Version 2.0.0
                    
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="PeerBerry.API" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PeerBerry.API" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="PeerBerry.API" />
                    
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 PeerBerry.API --version 2.0.0
                    
#r "nuget: PeerBerry.API, 2.0.0"
                    
#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 PeerBerry.API@2.0.0
                    
#: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=PeerBerry.API&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=PeerBerry.API&version=2.0.0
                    
Install as a Cake Tool

PeerBerry.API

A strongly typed .NET client for the PeerBerry investor HTTP API. It is not an official PeerBerry SDK or product of the platform.

GitHub Actions Status NuGet NuGet license


  • PeerBerry terms of use may restrict bots, scripts, or other automation. Using this library in ways that conflict with those rules may violate the platform terms.
  • This repository is for educational and technical purposes only. You use it at your own risk, including any legal consequences, account suspension, or loss of funds.
  • Authors and contributors accept no liability for how this code is used.

Features

  • Strongly typed request/response models
  • Sign-in with email/password (with 2FA or email-code flows when required), or access/refresh tokens
  • Automatic token refresh on 401 (with optional OnUnauthorizedAsync and credential callback)
  • Loans list, investments, primary buy, secondary market list/buy, loan details, profile, balance
  • SendCustomApiAsync for endpoints not yet wrapped in the client

Requirements

  • Target .NET 8 or later (same major as the package)
  • Transitive dependencies include Microsoft.Extensions.Logging.Abstractions and Microsoft.AspNetCore.WebUtilities; you normally do not reference them manually

Install and quick start

1. Add the NuGet package:

dotnet add package PeerBerry.API

2. Create the client and call the API (replace placeholders with your credentials):

using PeerBerry.API;
using PeerBerry.API.Initialize;
using Microsoft.Extensions.Logging;

using var client = new PeerBerryClient(NullLogger<PeerBerryClient>.Instance);

// Option A — existing tokens (simplest for a smoke test)
await client.InitializeUsingTokensAsync(accessToken, refreshToken);

// Option B — email and password (handle InitResult for 2FA or email code)
// var init = await client.InitializeUsingEmailAsync("you@example.com", "password");
// if (init.Result != InitResultEnum.Succeed) { /* InitializeUsing2Fa / InitializeUsingEmailCode */ }

var balance = await client.GetBalanceMainAsync();

Use a real ILogger<PeerBerryClient> (e.g. from LoggerFactory) instead of NullLogger when you want log output. Pass a credentials callback to the PeerBerryClient constructor if you need to persist refreshed tokens.


License

See LICENSE.txt.


Trademark disclaimer

“PeerBerry” is a trademark of its owner. This project is not affiliated with or endorsed by PeerBerry.

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.

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
2.0.0 37 3/27/2026
1.0.1 220 2/26/2025
1.0.0 182 11/28/2024