PeerBerry.API
2.0.0
dotnet add package PeerBerry.API --version 2.0.0
NuGet\Install-Package PeerBerry.API -Version 2.0.0
<PackageReference Include="PeerBerry.API" Version="2.0.0" />
<PackageVersion Include="PeerBerry.API" Version="2.0.0" />
<PackageReference Include="PeerBerry.API" />
paket add PeerBerry.API --version 2.0.0
#r "nuget: PeerBerry.API, 2.0.0"
#:package PeerBerry.API@2.0.0
#addin nuget:?package=PeerBerry.API&version=2.0.0
#tool nuget:?package=PeerBerry.API&version=2.0.0
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
⚠️ Legal notice and liability
- 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 optionalOnUnauthorizedAsyncand credential callback) - Loans list, investments, primary buy, secondary market list/buy, loan details, profile, balance
SendCustomApiAsyncfor endpoints not yet wrapped in the client
Requirements
- Target .NET 8 or later (same major as the package)
- Transitive dependencies include
Microsoft.Extensions.Logging.AbstractionsandMicrosoft.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 | Versions 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. |
-
net8.0
- Microsoft.AspNetCore.WebUtilities (>= 8.0.25)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.