MyNixOS website logo
Description

Api client for popular Ukrainian bank - Monobank.

Api client for popular Ukrainian bank - Monobank

Monobank Api Client

Hackage Azure DevOps builds

Haskell client for Monobank API services.

  1. Introduction
  2. Public API
  3. Private API
  4. Using library
  5. Example
  6. Say Thanks

Introduction

API for extracting information and personal account status. To grant access, you must pass the authorization in your personal office at https://api.monobank.ua/ and get a token for personal use.

If you have questions about the operation of the API, we invite to the community in the Telegram channel.

If you have a service or application and you want to centrally join the API for customer service, you need to connect to a corporate API that has more features.

This will allow monobank clients to log in to your service (for example, in a financial manager) to provide information about the status of an account or statements.

In the event of the exploitation of this API as corporate, the bank reserves the right to impose sanctions on the company.

Public

General information provided without authorization.

#PathTypeParamsDescriptionResponseNotes
1/bank/currencyGETGet a basic list of monobank currency rates. Information is cached and updated no more than once every 5 minutes.JSONResponse will be a json array with objects of 2 types
   {
    "currencyCodeA": 978,
    "currencyCodeB": 840,
    "date": 1561426807,
    "rateBuy": 1.1249,
    "rateSell": 1.1368
  },
  {
    "currencyCodeA": 826,
    "currencyCodeB": 980,
    "date": 1561461569,
    "rateCross": 33.2857
  },

note the absence of rateBuy, rateSell in a second example.Inside client system automatically convert int base date into normalized UTCTime format.

Private

Information provided with authorization.

#PathTypeParamsDescriptionResponseNotes
1/personal/client-infoGETObtaining information about the client and the list of his accounts. Limit on the use of the function no more than 1 time in 60 seconds.JSON
X-Token string; in headerToken for personal access to the API
2/personal/statementGET/{account}/{from}/{to}Receive an extract for the time from {to} to {to} time in seconds Unix time format. The maximum time for which it is possible to extract an extract is 31 days (2678400 seconds) Limit on the use of the function no more than 1 time in 60 seconds.JSON
X-Token string; in headerToken for personal access to the API
account string; in pathAccount ID from the Statement list list or 0 is a default account.
from string; in pathStart of the excerpt time
to string; in pathEnd time of the excerpt (if not, the current time will be used)

Use

  • src - contains actual API that can be used in 3rd part apps
  • app - executable for CLI app that can be used to view current value or run continuosly

Just build repository with stack build

$ stack exec -- mnb-app

or simply mnb-app if you used stack install command

$ mnb-app

that will bring following output if runned without keys, currency info

Monobank | Not tokenized API access available for currencies only
Monobank | Getting last currency prices

USD/UAH
 - Buy:  25.961 ₴
 - Sell: 26.2357₴

EUR/UAH
 - Buy:  29.161 ₴
 - Sell: 29.9294₴

RUB/UAH
 - Buy:  0.378 ₴
 - Sell: 0.418₴

TRY/UAH
 - Cross: 4.5473₴

...

Getting personal information with function getPersonalInfo' supply token

getPersonalInfo' (Just "bm90IHNvIGZhc3QgSm9obm55")

Lead to response:

Right (User {uName = "Paul Atreides", uAccounts = [Account {acId = "jTw-r2md_cykrO9vdNgNyQ", acBalance = 4446033, acCreditLimit = 10000000, acCurrencyCode = 980, acCashbackType = "UAH"},Account {acId = "8uZb22LO716bxAYRJ6FxG-ZA", acBalance = 17520, acCreditLimit = 0, acCurrencyCode = 840, acCashbackType = "None"},Account {acId = "6s-YdQTmX7MhndGGXPHEjg", acBalance = 5000, acCreditLimit = 0, acCurrencyCode = 978, acCashbackType = "None"}]})

Getting transations avalable with getPersonalStatement'' function like this

getPersonalStatement'' (Just "bm90IHNvIGZhc3QgSm9obm55") "0" "2019-06-05 10:00:00" "2019-06-25 10:00:00"

where you can have date in normal, human-readable form. They are converted to Posix based Unix epoch string automatically. If you want to calculate Unix epoch on your own, use raw access function getPersonalStatement':

`getPersonalStatement' (Just "bm90IHNvIGZhc3QgSm9obm55") "0" "1559728800" ""

Example

Accumulated statement by month for the year. Implemented inside Monolytics app with data collected by this API client.

Contributions

Say thanks, send tip:

  • monobank: https://send.monobank.com.ua/3BNNDq3CV
  • btc: 39oVXpsgsyW8ZgzsnX3sV7HLdtXWfT96qN
  • eth: 0x9cDBA6bb44772259B3A3fb89cf233A147a720f34
  • xlm: GD2FROTYXYSNOQQREYXHCXVOYWV556EM6PAHMVUHJNJEUYTUXUSNUZQ3
Metadata

Version

0.1.3.0

License

Platforms (77)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows