Skip to content

GetoXs/PeerBerry.API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 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.

About

PeerBerry.API is an unofficial .NET client library for accessing the PeerBerry API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages