hledger-stockquotes-0.1.3.0: Generate HLedger Price Directives From Daily Stock Quotes.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Web.AlphaVantage

Description

A minimal client for the AlphaVantage API.

Currently only supports the TIME_SERIES_DAILY & DIGITAL_CURRENCY_DAILY endpoints.

Synopsis

Documentation

newtype Config Source #

Configuration for the AlphaVantage API Client.

Constructors

Config 

Fields

Instances

Instances details
Generic Config Source # 
Instance details

Defined in Web.AlphaVantage

Associated Types

type Rep Config :: Type -> Type #

Methods

from :: Config -> Rep Config x #

to :: Rep Config x -> Config #

Read Config Source # 
Instance details

Defined in Web.AlphaVantage

Show Config Source # 
Instance details

Defined in Web.AlphaVantage

Eq Config Source # 
Instance details

Defined in Web.AlphaVantage

Methods

(==) :: Config -> Config -> Bool #

(/=) :: Config -> Config -> Bool #

type Rep Config Source # 
Instance details

Defined in Web.AlphaVantage

type Rep Config = D1 ('MetaData "Config" "Web.AlphaVantage" "hledger-stockquotes-0.1.3.0-J2HvfjiJ1gZ9yDtqhUMJgC" 'True) (C1 ('MetaCons "Config" 'PrefixI 'True) (S1 ('MetaSel ('Just "cApiKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data AlphaVantageResponse a Source #

Wrapper type enumerating between successful responses and error responses with notes.

Constructors

ApiResponse a 
ApiError Text 

Instances

Instances details
Functor AlphaVantageResponse Source # 
Instance details

Defined in Web.AlphaVantage

FromJSON a => FromJSON (AlphaVantageResponse a) Source #

Check for errors by attempting to parse a Note or Information field. If one does not exist, parse the inner type.

Instance details

Defined in Web.AlphaVantage

Generic (AlphaVantageResponse a) Source # 
Instance details

Defined in Web.AlphaVantage

Associated Types

type Rep (AlphaVantageResponse a) :: Type -> Type #

Read a => Read (AlphaVantageResponse a) Source # 
Instance details

Defined in Web.AlphaVantage

Show a => Show (AlphaVantageResponse a) Source # 
Instance details

Defined in Web.AlphaVantage

Eq a => Eq (AlphaVantageResponse a) Source # 
Instance details

Defined in Web.AlphaVantage

type Rep (AlphaVantageResponse a) Source # 
Instance details

Defined in Web.AlphaVantage

type Rep (AlphaVantageResponse a) = D1 ('MetaData "AlphaVantageResponse" "Web.AlphaVantage" "hledger-stockquotes-0.1.3.0-J2HvfjiJ1gZ9yDtqhUMJgC" 'False) (C1 ('MetaCons "ApiResponse" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "ApiError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data Prices Source #

The Single-Day Price Quotes & Volume for a Stock,.

Constructors

Prices 

Fields

Instances

Instances details
FromJSON Prices Source # 
Instance details

Defined in Web.AlphaVantage

Generic Prices Source # 
Instance details

Defined in Web.AlphaVantage

Associated Types

type Rep Prices :: Type -> Type #

Methods

from :: Prices -> Rep Prices x #

to :: Rep Prices x -> Prices #

Read Prices Source # 
Instance details

Defined in Web.AlphaVantage

Show Prices Source # 
Instance details

Defined in Web.AlphaVantage

Eq Prices Source # 
Instance details

Defined in Web.AlphaVantage

Methods

(==) :: Prices -> Prices -> Bool #

(/=) :: Prices -> Prices -> Bool #

type Rep Prices Source # 
Instance details

Defined in Web.AlphaVantage

getDailyPrices :: Config -> Text -> Day -> Day -> IO (AlphaVantageResponse [(Day, Prices)]) Source #

Fetch the Daily Prices for a Stock, returning only the prices between the two given dates.

getDailyCryptoPrices :: Config -> Text -> Text -> Day -> Day -> IO (AlphaVantageResponse [(Day, Prices)]) Source #

Fetch the Daily Prices for a Cryptocurrency, returning only the prices between the two given dates.