Census v0.1.1 Census.Client

Struct representing an API client.

Summary

Functions

Create a new api client

Types

t :: %Census.Client{api_key: term, dataset: term, vintage: term}

Functions

new(api_key, options \\ [])

Specs

new(api_key :: String.t, options :: Keyword.t) :: Census.Client.t

Create a new api client.

Usage:

iex> Census.Client.new("YOUR_API_KEY")
%Census.Client{api_key: "YOUR_API_KEY", dataset: "SF1", vintage: "2010"}

Clients default to the 2010 SF1 dataset. To set an alternate dataset and vintage:

iex> Census.Client.new("YOUR_API_KEY", dataset: "ACS5", vintage: "2005")
%Census.Client{api_key: "YOUR_API_KEY", dataset: "ACS5", vintage: "2005"}