yahoo-finance-api-0.2.0.2: Read quotes from Yahoo Finance API

Copyright(c) James M.C. Haver II 2016
LicenseBSD3
Safe HaskellNone
LanguageHaskell2010

Web.Yahoo.Finance.YQL

Contents

Description

This module contains methods for accessing the Yahoo Finance YQL APIs.

Synopsis

Fetch Stock Quotes

getQuotes :: YQLQuery -> ClientM YQLResponse #

General client API to access Yahoo financial data. Quotes are returned in the order they are queried.

yahooFinanceJsonBaseUrl :: BaseUrl #

BaseUrl for the Yahoo Finance YQL API. This represents https://finance.yahoo.com.

Types

data YQLQuery #

Query for yahoo finance api.

Constructors

YQLQuery 

Fields

Instances

Eq YQLQuery # 
Show YQLQuery # 
Generic YQLQuery # 

Associated Types

type Rep YQLQuery :: * -> * #

Methods

from :: YQLQuery -> Rep YQLQuery x #

to :: Rep YQLQuery x -> YQLQuery #

ToHttpApiData YQLQuery #

Automate a simple YQL query.

>>> toUrlPiece $ YQLQuery [StockSymbol "GOOG", StockSymbol "YHOO"]
"select * from yahoo.finance.quotes where symbol in (\"GOOG\",\"YHOO\")"
type Rep YQLQuery # 
type Rep YQLQuery = D1 (MetaData "YQLQuery" "Web.Yahoo.Finance.YQL.Internal.Types" "yahoo-finance-api-0.2.0.2-JGME6E3VOcdIaZPsvJmN40" False) (C1 (MetaCons "YQLQuery" PrefixI True) (S1 (MetaSel (Just Symbol "yqlQuery") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [StockSymbol])))

newtype StockSymbol #

Use this type to encode toUrlPiece or toText (depending on Servant version) for queries.

Constructors

StockSymbol 

Fields

Instances

Eq StockSymbol # 
Ord StockSymbol # 
Show StockSymbol # 
Generic StockSymbol # 

Associated Types

type Rep StockSymbol :: * -> * #

ToHttpApiData StockSymbol #

Surround StockSymbol with double quotes.

>>> toUrlPiece (StockSymbol "GOOG")
"\"GOOG\""
ToHttpApiData [StockSymbol] #

Connect separate StockSymbols with a comma.

>>> toUrlPiece ([StockSymbol "GOOG", StockSymbol "YHOO", StockSymbol "GSPC"] :: [StockSymbol])
"\"GOOG\",\"YHOO\",\"GSPC\""
type Rep StockSymbol # 
type Rep StockSymbol = D1 (MetaData "StockSymbol" "Web.Yahoo.Finance.YQL.Internal.Types" "yahoo-finance-api-0.2.0.2-JGME6E3VOcdIaZPsvJmN40" True) (C1 (MetaCons "StockSymbol" PrefixI True) (S1 (MetaSel (Just Symbol "unStockSymbol") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))

data YQLResponse #

Response from a YQL query.

data Quote #

Quote data received from YQL.

Instances

Eq Quote # 

Methods

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

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

Read Quote # 
Show Quote # 

Methods

showsPrec :: Int -> Quote -> ShowS #

show :: Quote -> String #

showList :: [Quote] -> ShowS #

Generic Quote # 

Associated Types

type Rep Quote :: * -> * #

Methods

from :: Quote -> Rep Quote x #

to :: Rep Quote x -> Quote #

FromJSON Quote # 
type Rep Quote # 
type Rep Quote = D1 (MetaData "Quote" "Web.Yahoo.Finance.YQL.Internal.Types" "yahoo-finance-api-0.2.0.2-JGME6E3VOcdIaZPsvJmN40" False) (C1 (MetaCons "Quote" PrefixI True) ((:*:) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "quoteAverageDailyVolume") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) ((:*:) (S1 (MetaSel (Just Symbol "quoteChange") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) (S1 (MetaSel (Just Symbol "quoteDaysLow") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))) ((:*:) (S1 (MetaSel (Just Symbol "quoteDaysHigh") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) ((:*:) (S1 (MetaSel (Just Symbol "quoteYearLow") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) (S1 (MetaSel (Just Symbol "quoteYearHigh") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text))))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "quoteMarketCapitalization") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) ((:*:) (S1 (MetaSel (Just Symbol "quoteLastTradePriceOnly") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) (S1 (MetaSel (Just Symbol "quoteDaysRange") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))) ((:*:) ((:*:) (S1 (MetaSel (Just Symbol "quoteName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) (S1 (MetaSel (Just Symbol "quoteSymbol") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text))) ((:*:) (S1 (MetaSel (Just Symbol "quoteVolume") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)) (S1 (MetaSel (Just Symbol "quoteStockExchange") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Text)))))))