Chartmetric
Documentation for Chartmetric.
Chartmetric.Request
Chartmetric.Token
Chartmetric.dorequest
Chartmetric.getparsed
Chartmetric.newtoken!
Chartmetric.parseresponse
Chartmetric.Request
— TypeRequest(token::Token, url::String[, maxtries::Int, sleeptime::Number, state::Dict])
Request(refreshtoken::String, url::String[, maxtries::Int, sleeptime::Number])
Creates a Request
to be used with dorequest(...)
Arguments:
token
: the requestToken
url
: Chartmetric URL to be requested- [
maxtries
] : maximum number of tries to get the request (default =token.maxtries
) - [
sleeptime
] : Time to wait after server error in seconds (default = 600) - [
state
] : Metadata for a request. Allows multiple requests of the same variable with different offset. refreshtoken
: Chartmetric refreshtoken associated with your account
Chartmetric.Token
— TypeToken(refreshtoken::String)
Returns a Token
that can be used for requests.
Arguments:
refreshtoken
: Refreshtoken associated with your Chartmetric account.
Chartmetric.dorequest
— Methoddorequest(request::Request)
Run the request using a Request
object
Arguments:
request
: theRequest
objectskip404 = true
: Iftrue
404 errors will not be retriedverbose = false
: Iftrue
all unusual events (e.g. rate limit is hit) will print a message
Chartmetric.getparsed
— Functiongetparsed(tkn, path, parameters = nothing; kwargs...)
Do a full request and return a Dict of the response. Keyword arguments are passed to Request and are maxtries
and sleeptime
.
Arguments:
token
: the requestToken
path
: Chartmetric API pathparameters=nothing
: Chartmetric parameters of the form ["limit=100", "since=2020-01-01"]skip404 = true
: Iftrue
404 errors will not be retriedverbose = false
: Iftrue
all unusual events (e.g. rate limit is hit) will print a message
Chartmetric.newtoken!
— Methodnewtoken!(token::Token; verbose = false)
Refreshes an existing request Token
Arguments:
token
: the requestToken
verbose=false
: print a message when a new token is requested
Chartmetric.parseresponse
— Methodparseresponse(response::HTTP.Messages.Response)
Parses the response from the API to a Dict
.