TradegateEx (TradegateEx v0.2.0) View Source

An Elixir API to get stock prices from the german tradegate exchange via WKN/ISIN.

Link to this section Summary

Functions

Returns the asked quotes for the wkn/isin.

Link to this section Functions

Specs

get_quote(binary()) :: <<_::112>> | {:error, any()} | {:ok, any()}

Returns the asked quotes for the wkn/isin.

Returns {:ok, %{}}

Example

iex> TradegateEx.get_quote("US0378331005")
{:ok,
%{
"ask" => 111.88,
"asksize" => 500,
"avg" => 111.6493,
"bid" => 111.72,
"bidsize" => 500,
"delta" => "+0,50%",
"high" => 111.94,
"last" => 111.88,
"low" => 111.02,
"stueck" => 8182,
"umsatz" => 913515
}}

Strings that do not match as a valid WKN or ISIN length (6 or 12) will return an error.

iex> TradegateEx.get_quote("a")
{:error, "Invalid WKN/ISIN"}