https://github.com/maisak/monobank-api
This library is a wrapper on Monobank open API
https://github.com/maisak/monobank-api
api monobank wrapper
Last synced: 6 months ago
JSON representation
This library is a wrapper on Monobank open API
- Host: GitHub
- URL: https://github.com/maisak/monobank-api
- Owner: maisak
- Created: 2019-06-29T08:09:44.000Z (about 7 years ago)
- Default Branch: main
- Last Pushed: 2025-06-23T13:16:23.000Z (about 1 year ago)
- Last Synced: 2025-12-24T23:39:15.996Z (7 months ago)
- Topics: api, monobank, wrapper
- Language: C#
- Homepage:
- Size: 70.3 KB
- Stars: 7
- Watchers: 0
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [Monobank](https://www.monobank.ua) API library
[](https://www.nuget.org/packages/Monobank.API.Core/)
[](https://github.com/maisak/monobank-api/actions/workflows/build-and-test.yaml)
[](https://github.com/maisak/monobank-api/actions/workflows/package.yaml)
This library is a wrapper on Monobank open API. To use it you will need to get a personal token at https://api.monobank.ua/.
## How to use:
### Public API:
Available without a personal token. Just intitialize MonoClient with it's default constructor.
```
static async Task Main(string[] args)
{
var mono = new MonoClient();
var currencies = await mono.Currency.GetCurrencies();
}
```
### Client API:
Available only with a personal token.
#### User information
```
static async Task Main(string[] args)
{
var mono = new MonoClient("YOUR_TOKEN");
var userInfo = await mono.Client.GetClientInfo();
}
```
#### Statements
```
static async Task Main(string[] args)
{
var mono = new MonoClient("YOUR_TOKEN");
var statements = await mono.Client.GetStatements(from: new DateTime(2019, 6, 1),
to: new DateTime(2019, 6, 30));
}
```
#### Webhook
Allows to be notified when there are transactions on user account.
According to [documentation](https://api.monobank.ua/docs), you need a POST endpoint to listen to webhook and the same GET endpoint for backing services to check availability. If you set webhook at ```https:\\example.com\webhook\test``` url - you will actually need two endpoints:
**GET https:\\example.com\webhook\test**
**POST https:\\example.com\webhook\test**
```
static async Task Main(string[] args)
{
var mono = new MonoClient("YOUR_TOKEN");
bool success = await mono.Client.SetWebhook("https:\\example.com\webhook\test");
}
```
To check webhook url - query user information and refer to ```webHookUrl``` property:
```
static async Task Main(string[] args)
{
var mono = new MonoClient("YOUR_TOKEN");
var userInfo = await mono.Client.GetClientInfo();
var webHookUrl = userInfo.WebHookUrl;
}
```
## How to test:
In a test project create `appsettings.test.json` file. Set its `Copy to output directory` property to `Copy if newer`. Fill in the `ApiKey` field and enjoy safe testing :)
```
{
"ApiKey": ""
}
```
Note: `appsettings.test.json` added to `.gitignore`, so it won't be commited and pushed to the repository.