Skip to content
The ViaCEP web service client for .NET projects
Branch: master
Clone or download
Latest commit fbf2d11 Feb 16, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE
ViaCEP.Tests
ViaCEP
.gitignore
LICENSE
README.md
ViaCEP.sln
appveyor.yml
logo.png

README.md

ViaCEP

The ViaCEP web service client for .NET projects

Build status ViaCEP NuGet Version ViaCEP NuGet Downloads Github All Releases Last release

codecov Quality Gate Status Lines of Code Technical Debt Maintainability Rating Security Rating

ViaCEP

The ViaCEP service is exclusive for Brazil! No zipcode data available for other countries (Feb/2019)!


NuGet package: https://www.nuget.org/packages/ViaCEP

Install-Package ViaCEP

Usage

The package has two classes:

You can search using the zip code/postal code (AKA CEP) or using the address data (state initials - UF, city name and location name - street, avenue, park, square). Both methods support async and sync!

Querying by zip code / postal code (single result)

var result = ViaCEPClient.Search("01234567"); //searches for the postal code 01234-567
var address = result.Address;
var neighborhood = result.Neighborhood
//do what you need with 'result' instance of ViaCEPResult.

Querying by addres (list result)

var results = ViaCEPClient.Search("SP", "São Paulo", "Avenida Paulista"); //search for the Avenida Paulista in São Paulo / SP
foreach(var result in results){
    var address = result.Address;
    var neighborhood = result.Neighborhood;
    var zipCode = result.ZipCode;
    //do what you need with 'result' instance of ViaCEPResult.
}
You can’t perform that action at this time.