Example of fund profile data
Fund profile data realized with PHP
This PHP based example fetches the fund profile API endpoint by cURL and places all parts in a HTML structure.
HANSAsecur
ISIN: DE0008479023 / WKN: 847902
Fund category | Umbrella fund |
---|---|
Inception date | 02.01.1970 |
Currency | EUR |
Fund assets | 98432444.7000 EUR |
Total fund assets | 98432444.7000 EUR |
End of fiscal year | Dec 31 |
Dividend distribution | distributing |
Conformity | yes |
Issue surcharge | 5 % |
Redemption fee | 0 % |
TER (total expense ratio) | 1,58 % p.a. |
incl. management fee | 1,5 % p.a. |
incl. custodian bank fee | 0,05 % p.a. |
Performance fee | no |
Savings plan | yes |
One-time investment | yes |
Capital-forming payments | yes (min. 34.00 EUR) |
<?php
// Get cURL resource
$curl = curl_init();
// Set some options - we are passing in a useragent too here
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => 'https://api.hansainvest.com/api/v1/profile/DE0008479023/',
CURLOPT_USERAGENT => 'Sample cURL Request',
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
],
]);
// Send the request & save response to $respJson
$respJson = curl_exec($curl);
$fundProfile = json_decode($respJson);
// Close request to clear up some resources
curl_close($curl);
?>
<h3 class="hi-profile-name"><?php echo $fundProfile->fund->name; ?></h3>
<h4 class="hi-profile-isin">ISIN: <?php echo $fundProfile->fund->isin; ?> /
WKN: <?php echo $fundProfile->fund->wkn; ?></h4>
<table class="table hi-profile">
<tbody>
<tr>
<th scope="row">Fund category</th>
<td class="hi-profile-fund_category"><?php echo $fundProfile->fund->category; ?></td>
</tr>
<tr>
<th scope="row">Inception date</th>
<td class="hi-profile-fund_inception_date"><?php echo date(
'd.m.Y',
strtotime($fundProfile->fund->fund_inception_date)
); ?></td>
</tr>
<tr>
<th scope="row">Currency</th>
<td class="hi-profile-currency"><?php echo $fundProfile->fund->currency; ?></td>
</tr>
<tr>
<th scope="row">Fund assets</th>
<td class="hi-profile-fund_assets"><?php echo $fundProfile->fund->fund_assets; ?></td>
</tr>
<tr>
<th scope="row">Total fund assets</th>
<td class="hi-profile-total_fund_assets"><?php echo $fundProfile->fund->total_fund_assets; ?></td>
</tr>
<tr>
<th scope="row">End of fiscal year</th>
<td class="hi-profile-end_of_fiscal_year"><?php echo $fundProfile->fund->end_of_fiscal_year; ?></td>
</tr>
<tr>
<th scope="row">Dividend distribution</th>
<td class="hi-profile-dividend_distributions"><?php echo $fundProfile->fund->distributing; ?></td>
</tr>
<tr>
<th scope="row">Conformity</th>
<td class="hi-profile-conformity"><?php echo $fundProfile->fund->conformity ? 'yes' : 'no'; ?></td>
</tr>
<tr>
<th scope="row">Issue surcharge</th>
<td class="hi-profile-issue_surcharge"><?php echo $fundProfile->fund->issue_surcharge; ?></td>
</tr>
<tr>
<th scope="row">Redemption fee</th>
<td class="hi-profile-redemption_fee"><?php echo $fundProfile->fund->redemption_fee; ?></td>
</tr>
<tr>
<th scope="row">TER (total expense ratio)</th>
<td class="hi-profile-total_expense_ratio"><?php echo $fundProfile->fund->total_expense_ratio; ?> % p.a.</td>
</tr>
<tr>
<th scope="row"> incl. management fee</th>
<td class="hi-profile-management_fee"><?php echo $fundProfile->fund->management_fee; ?> % p.a.</td>
</tr>
<tr>
<th scope="row"> incl. custodian bank fee</th>
<td class="hi-profile-custodian_bank_fee"><?php echo $fundProfile->fund->custodian_bank_fee; ?> % p.a.</td>
</tr>
<tr>
<th scope="row">Performance fee</th>
<td class="hi-profile-performance_fee"><?php echo $fundProfile->fund->performance_fee ? 'yes' : 'no'; ?></td>
</tr>
<tr>
<th scope="row">Savings plan</th>
<td class="hi-profile-savings_plan">
<?php
if ($fundProfile->fund->savings_plan->possible) {
echo 'yes';
if ($fundProfile->fund->savings_plan->minimum_investment) {
echo $fundProfile->fund->savings_plan->minimum_investment;
}
} else {
echo 'no';
}
?>
</td>
</tr>
<tr>
<th scope="row">One-time investment</th>
<td class="hi-profile-one_time_investment">
<?php
if ($fundProfile->fund->one_time_investment->possible) {
echo 'yes';
if ($fundProfile->fund->one_time_investment->minimum_investment) {
echo $fundProfile->fund->one_time_investment->minimum_investment;
}
} else {
echo 'no';
}
?>
</td>
</tr>
<tr>
<th scope="row">Capital-forming payments</th>
<td class="hi-profile-capital_forming_payments">
<?php
if ($fundProfile->fund->capital_forming_payments->possible) {
echo 'yes';
if ($fundProfile->fund->capital_forming_payments->minimum_investment) {
echo $fundProfile->fund->capital_forming_payments->minimum_investment;
}
} else {
echo 'no';
}
?>
</td>
</tr>
</tbody>
</table>
<a class="hi-profile-link" href="<?php echo $fundProfile->fund->url; ?>">all fund details</a>