Estated v0.2.0 Estated View Source

Elixir client for the Estated v4 API.

Link to this section Summary

Types

Estated API key

A property can be requested by a variety of methods.

Functions

Get a property with one of the available request methods.

Link to this section Types

Link to this type

api_key()

View Source (since 0.1.0)
api_key() :: String.t()

Estated API key

Link to this type

get_property_opts()

View Source (since 0.1.0)
get_property_opts() :: [{:sandbox, boolean()}]

Options for get_property/3.

Options

  • :sandbox - If true, use the Sandbox API, a free endpoint to test your code against. Any value other than true will call the real Property API. Defaults to false.

A property can be requested by a variety of methods.

Choose the method based on what works best for your application.

Link to this section Functions

Link to this function

get_property(api_key, property_request, opts \\ [])

View Source (since 0.1.0)
get_property(api_key(), property_request(), get_property_opts()) ::
  {:ok, Estated.Response.t()} | {:error, reason :: any()}

Get a property with one of the available request methods.

Returns an :ok tuple if the HTTP request completed successfully, regardless of whether the t:Response.t/0 contains warnings or errors. An :error tuple will only be returned if the HTTP request could not be completed.

Options

  • :sandbox - If true, use the Sandbox API, a free endpoint to test your code against. Any value other than true will call the real Property API. Defaults to false.

Examples

Split property request

iex> api_key = System.get_env("ESTATED_API_KEY")
iex> property_request = %Estated.PropertyRequest.Split{
...>   street_address: "1101 Sloan St",
...>   city: "Scranton",
...>   state: "PA",
...>   zip_code: "18504"
...> }
iex> Estated.get_property(api_key, property_request, sandbox: true)
{:ok, %Response{...}}

Parsed property request

iex> api_key = System.get_env("ESTATED_API_KEY")
iex> property_request = %Estated.PropertyRequest.Parsed{
...>   street_number: "1101",
...>   street_name: "Sloan",
...>   street_suffix: "St",
...>   city: "Scranton",
...>   state: "PA",
...>   zip_code: "18504"
...> }
iex> Estated.get_property(api_key, property_request, sandbox: true)
{:ok, %Response{...}}

Combined property request

iex> api_key = System.get_env("ESTATED_API_KEY")
iex> property_request = %Estated.PropertyRequest.Combined{
...>   combined_address: "1101 Sloan St, Scranton, PA 18504"
...> }
iex> Estated.get_property(api_key, property_request, sandbox: true)
{:ok, %Response{...}}

FIPS code and APN property request

iex> api_key = System.get_env("ESTATED_API_KEY")
iex> property_request = %Estated.PropertyRequest.FipsAndApn{
...>   fips: "42069",
...>   apn: "15613060014"
...> }
iex> Estated.get_property(api_key, property_request, sandbox: true)
{:ok, %Response{...}}