BlsData.BlsType

A connection to the BLS API.

Constructors

  • Bls()
  • Bls(key::AbstractString)

Arguments

  • key: Registration key provided by the BLS.

Methods

  • api_url(b::Bls): Get the base URL used to connect to the server
  • set_api_url!(b::Bls, url::AbstractString): Set the base URL used to connect to the server
  • api_key(b::Bls): Get the API key
  • api_version(b::Bls): Get the API version (v1 or v2) used
  • requests_made(b::Bls): Get the number of requests made today
  • requests_remaining(b::Bls): Get the number of requests remaining today

Notes

  • A default API key can be specified in a ~/.blsdatarc file.
  • A valid registration key increases the allowable number of requests per day as well making catalog metadata available.
BlsData.BlsSeriesType

A time series with metadata returned from a get_data call.

For a series s, access fields with

s.id
s.data
s.catalog
BlsData.get_dataMethod

get_data(b, series [; startyear, endyear, catalog]) Request one or multiple series using the BLS API.

Arguments

  • b: A Bls connection
  • series: A string, or array of strings, identifying the time series
  • startyear: A four-digit year identifying the start of the data request. Defaults to 9 or 19 years before endyear, depending on the API version used.
  • endyear: A four-digit year identifying the end of the data request. Defaults to 9 or 19 years after endyear, depending on the API version used; or, this year, if neither startyear nor endyear is provided.
  • catalog: Whether to return any available metadata about the series. Defaults to false.

Returns

A BlsSeries, or an array of BlsSeries.