Skip to content

m8ty_client_securities

m8ty_client_securities solves this by providing typed search and detail APIs for securities, listings, exchanges, and realtime prices, enabling informed investment journeys in one app.

Securities client for searching, listing, and fetching details of securities, stock exchanges, and realtime prices.

Check the documentation of the m8ty_client_securities library.

import 'package:dio/dio.dart';
import 'package:m8ty_client_securities/m8ty_client_securities.dart';
final client = M8tyClientSecurities();
client.setOAuthToken('ApiOAuth2', oauthToken);
Method Description
searchSecurities Search for securities
fetchSecurityById Get security details
Method Description
searchSecurityListing Search in the list of securities
fetchSecurityListingById Get security listing details
Method Description
searchSecurityTypes Get all security types
fetchSecurityTypeById Get security type details
Method Description
searchStockExchanges Search for stock exchanges
fetchStockExchangeById Get stock exchange details
Method Description
fetchRealtimePrice Get realtime price for a security on a certain stock exchange

Here some examples how the dart client can be used

final client = M8tyClientSecurities();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getSecuritiesApi();
try {
final response = await api.searchSecurities(
// provide search parameters
);
print('Securities: ${response.data}');
} on DioException catch (e) {
throw Exception(
'Request failed (status: ${e.response?.statusCode}): ${e.response?.data}',
);
}
final client = M8tyClientSecurities();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getRealtimePriceApi();
try {
final response = await api.fetchRealtimePrice(
securityNumber: '1234',
stockExchangeId: 'SIX',
currencyIsoCode: IsoCurrencyEnumModel.CHF,
);
print('Price: ${response.data}');
} on DioException catch (e) {
throw Exception(
'Request failed (status: ${e.response?.statusCode}): ${e.response?.data}',
);
}
final client = M8tyClientSecurities();
client.setOAuthToken('ApiOAuth2', oauthToken);
final api = client.getStockExchangesApi();
final response = await api.searchStockExchanges();