RienNeVaPlus / wikifolio

📊 Wikifolio (unofficial) API
18 stars 6 forks source link

Feature Request: Download 'Kontoauszug' from 'Analyse'-Tab #2

Closed beyse closed 3 years ago

beyse commented 3 years ago

From the Wikifolio-Website it is possible to download two sorts of CSV files for a given portfolio. The feature is available in the Tab "Analyse". A user can enter a start date and a end date and then klick a button to download the price (on a daily basis) and the account statement (Kontoauszug). I understand that obtaining the price of the portfolio on a daily basis is already covered in this API, however downloading the account statement is not to the best of my knowledge. The account statement lists with great details all trades including the exact quantity, time of day, execution price and fee for a given stock order and also the amount of cash in the portfolio before and after the trade. I do believe this is a very useful feature which can benefit the API and its users.

image

Below is an example of the data in the CSV file.

Datum (UTC) | Beschreibung | ISIN | Änderung Anzahl | Anzahl nachher | Preis | Preis (Brutto) | Änderung Cash | Cash nachher
13.12.2020 23:59 | Zertifikategebühr |   |   |   |   | -109,804 | 685536,405
14.12.2020 08:06 | Wertpapier-Transaktion (Kauf) | DE0006305006 | 20.000,00 | 20.000,00 | 5,030 |   | -100600,000 | 584936,405
14.12.2020 08:20 | Wertpapier-Transaktion (Kauf) | DE0007568578 | 5.000,00 | 15.000,00 | 15,320 |   | -76600,000 | 508336,405
14.12.2020 23:59 | Zertifikategebühr |   |   |   |   | -109,966 | 508226,439
15.12.2020 16:26 | Wertpapier-Transaktion (Kauf) | DE0007568578 | 5.000,00 | 20.000,00 | 15,500 |   | -77500,000 | 430726,439

Your opinion on this topic is very much appreciated, good Sir.

RienNeVaPlus commented 3 years ago
// v0.3.2
public async download(
    type: 'daily' | 'account-statement' = 'daily',
    from: Date = new Date,
    to: Date = new Date
): Promise<string>

// Kursdaten
await api.wikifolio(...).download('daily')

// Kontoauszug
await api.wikifolio(...).download('account-statement', new Date(2021, 0, 8))

I'm not parsing the response, because it has a different encoding and I don't want to ship large dependencies for a small feature. However I'm happy to accept PRs if anybody wants to improve this.