Description
Find Brazilian addresses by zip code, directly from Correios database. No HTML parsers.
Correios CEP alternatives and similar packages
Based on the "Third Party APIs" category.
Alternatively, view Correios CEP alternatives based on common mentions on social networks and blogs.
-
google-cloud
Elixir client libraries for accessing Google APIs. -
gringotts
A complete payment library for Elixir and Phoenix Framework -
MongoosePush
MongoosePush is a simple Elixir RESTful service allowing to send push notification via FCM and/or APNS. -
sendgrid
Create and send composable emails with Elixir and SendGrid. -
mailchimp
A basic Elixir wrapper for version 3 of the MailChimp API -
sparkpost
SparkPost client library for Elixir https://developers.sparkpost.com -
diplomat
Elixir library for interacting with Google's Cloud Datastore -
elixtagram
:camera: Instagram API client for the Elixir language (elixir-lang) -
google_sheets
Elixir library for fetching Google Spreadsheet data in CSV format -
amazon_product_advertising_client
An Amazon Product Advertising API client for Elixir -
pay_pal
:money_with_wings: PayPal REST API client for the Elixir language (elixir-lang) -
cashier
Cashier is an Elixir library that aims to be an easy to use payment gateway, whilst offering the fault tolerance and scalability benefits of being built on top of Erlang/OTP -
elixir_ipfs_api
The Elixir library that is used to communicate with the IPFS REST endpoint. -
dogstatsd
An Elixir client for DogStatsd https://www.datadoghq.com/
Static code analysis for 29 languages.
Do you think we are missing an alternative of Correios CEP or a related project?
README
Correios CEP
Find Brazilian addresses by postal code, directly from Correios API. No HTML parsers.
DEPRECATION NOTE
Correios.CEP.Address.zipcode
was removed in the version 0.6.0
. Use Correios.CEP.Address.postal_code
instead.
Installation
The package can be installed by adding correios_cep
to your list of dependencies in mix.exs
:
def deps do
[
{:correios_cep, "~> 0.7.0"}
]
end
Usage
iex> Correios.CEP.find_address("54250610")
{:ok,
%Correios.CEP.Address{
street: "Rua Fernando Amorim",
neighborhood: "Cavaleiro",
complement: "",
city: "Jaboatão dos Guararapes",
state: "PE",
postal_code: "54250610"
}}
iex> Correios.CEP.find_address("00000-000")
{:error,
%Correios.CEP.Error{
type: :postal_code_not_found,
message: "Postal code not found",
reason: "CEP NAO ENCONTRADO"
}}
iex> Correios.CEP.find_address!("54250-610")
%Correios.CEP.Address{
street: "Rua Fernando Amorim",
neighborhood: "Cavaleiro",
complement: "",
city: "Jaboatão dos Guararapes",
state: "PE",
postal_code: "54250610"
}
iex> Correios.CEP.find_address!("00000-000")
** (Correios.CEP.Error) Postal code not found
Options
There are some supported options that can be added to the request, as timeouts, proxy and URL configuration.
The example below shows the use of request_timeout
and proxy
options:
iex> Correios.CEP.find_address("54250610", request_timeout: 3000, proxy: {"localhost", 8888})
{:ok,
%Correios.CEP.Address{
street: "Rua Fernando Amorim",
neighborhood: "Cavaleiro",
complement: "",
city: "Jaboatão dos Guararapes",
state: "PE",
postal_code: "54250610"
}}
See Correios.CEP.find_address/2
documentation to check the details of the available options.
Documentation
The full documentation is available at https://hexdocs.pm/correios_cep.
Contributing
See the contributing guide.
License
Correios CEP is released under the Apache 2.0 License. See the LICENSE file.
Copyright © 2018-2020 Fernando Hamasaki de Amorim
Author
Fernando Hamasaki de Amorim (prodis)
*Note that all licence references and agreements mentioned in the Correios CEP README section above
are relevant to that project's source code only.