|
1 | 1 | # python-ing-api
|
| 2 | + |
2 | 3 | Python interface for ING IB
|
| 4 | + |
| 5 | +Provided class enables very simple interface to read data from API |
| 6 | +provided by ING Bank. This service is currently deployed in |
| 7 | +[Czechia](https://ib.ing.cz/transactional-cz/) where the library |
| 8 | +has been tested. |
| 9 | + |
| 10 | +## Usage |
| 11 | + |
| 12 | +For the usage the `requirements.txt` must be installed to the |
| 13 | +environment. |
| 14 | +```bash |
| 15 | +pip3 install -r requirements.txt |
| 16 | +``` |
| 17 | + |
| 18 | +### Before Using |
| 19 | +Before using the library you should log in into the Internet Banking. |
| 20 | +- [Czechia](https://ib.ing.cz/transactional-cz/) |
| 21 | + |
| 22 | +When the login process is done and you're successfully logged in open |
| 23 | +the developer console of the browser. You should there network requests |
| 24 | +and take of of the requests going to bank API. It should contain the |
| 25 | +`/rest` part in the path. Then, find `Request headers` and there |
| 26 | +the `Cookie` header. Copy the whole value of the header and use it to |
| 27 | + set up the `IngClient`. |
| 28 | + |
| 29 | +> Keep in mind that you should stay logged in when you would like to |
| 30 | + run the script. |
| 31 | + |
| 32 | +### Initialize code |
| 33 | +```python |
| 34 | +from ing_api import IngClient |
| 35 | + |
| 36 | +# set up cookie |
| 37 | +cookie = 'copied value of Cookie header from browser' |
| 38 | +api = IngClient(cookie) |
| 39 | +``` |
| 40 | + |
| 41 | +### Get information about the client |
| 42 | +```python |
| 43 | +client = api.client() |
| 44 | +``` |
| 45 | + |
| 46 | +### Get all products of the client |
| 47 | +```python |
| 48 | +products = api.products() |
| 49 | +``` |
| 50 | + |
| 51 | +### Get list of transactions (movements) |
| 52 | +In the terminology of the API the transactions are called movements. |
| 53 | + |
| 54 | +```python |
| 55 | +product_id = 'uuid' |
| 56 | +from_date = datetime.date(1970, 1, 1) |
| 57 | +movements = api.movements(product_id, from_date=from_date) |
| 58 | +print(movements['count']) |
| 59 | +``` |
| 60 | + |
| 61 | +Arguments are: |
| 62 | +- `product_uuid` - UUID of selected product |
| 63 | +- `from_date` - starting date (required) |
| 64 | +- `to_date` - ending date of selection (default is today) |
| 65 | +- `limit` - number of items which should be loaded once - pagination (default: 25) |
| 66 | +- `offset` - offset for pagination (default: 0) |
| 67 | + |
| 68 | +### Get transaction (movement) detail |
| 69 | +The information provided in the list of movements is not complete. For |
| 70 | +the detailed information the detail should be called. |
| 71 | + |
| 72 | +```python |
| 73 | +movement = api.movement('uuid') |
| 74 | +``` |
0 commit comments