ViaCep 4.1.511
dotnet add package ViaCep --version 4.1.511
NuGet\Install-Package ViaCep -Version 4.1.511
<PackageReference Include="ViaCep" Version="4.1.511" />
<PackageVersion Include="ViaCep" Version="4.1.511" />
<PackageReference Include="ViaCep" />
paket add ViaCep --version 4.1.511
#r "nuget: ViaCep, 4.1.511"
#:package ViaCep@4.1.511
#addin nuget:?package=ViaCep&version=4.1.511
#tool nuget:?package=ViaCep&version=4.1.511
ViaCEP SDK .NET
A .NET client wrapper for both .NET Core & .NET Framework projects of Via CEP API

CI/CD
| Build status | Last commit | Tests | Coverage | Code Smells | LOC |
|---|---|---|---|---|---|
Code Quality
Installation
Github Releases
Download the latest zip file from the Release page.
Nuget package manager
| Package | Version | Downloads |
|---|---|---|
| ViaCEP |
Usage
The package has two classes:
- ViaCepClient: The main class (methods).
- ViaCepResult: The result class (data).
This package is fully compatible with Dependency Injection. Use the interface IViaCepClient and the constructor with HttpClient parameter with a IHttpClientFactory instance.
//your DI container
services.AddHttpClient<IViaCepClient, ViaCepClient>(client => { client.BaseAddress = new Uri("https://viacep.com.br/"); });
//then use in your domain service, handler, controller...
var viaCepClient = container.GetService<IViaCepClient>();
var result = await viaCepClient.SearchAsync("01001000", cancellationToken);
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 = new ViaCepClient().Search("01001000"); //searches for the postal code 01001-000
var address = result.Address; //Praça da Sé
var city = reuslt.City; //São Paulo
//do what you need with 'result' instance of ViaCEPResult.
Querying by address (list result)
var results = new 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.
}
Changelog
- 2023-07-28: Add integration tests #71 by @Riju-bak
- 2023-03-03: Update dependencies, change branch name, update logo. @guibranco
- 2021-06-21: Update dependencies version. @guibranco
- 2020-10-23: Add support to .NET Standard 2.0 and .NET Framework v4.6.1 and above. @guibranco
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.AspNet.WebApi.Client (>= 6.0.0)
- Newtonsoft.Json (>= 13.0.3)
-
.NETStandard 2.1
- Microsoft.AspNet.WebApi.Client (>= 6.0.0)
- Newtonsoft.Json (>= 13.0.3)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on ViaCep:
| Package | Downloads |
|---|---|
|
JotaSystem.Sdk.Providers
Pacote com providers reutilizáveis. |
|
|
DrCash.Application
Package Description |
|
|
DrCash.Application.SDK
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.1.511 | 9,161 | 5/31/2024 |
| 4.1.510 | 1,138 | 5/28/2024 |
| 4.1.507 | 1,120 | 5/28/2024 |
| 4.1.502 | 1,122 | 5/28/2024 |
| 4.1.495 | 1,307 | 4/29/2024 |
| 4.1.492 | 1,123 | 4/29/2024 |
| 4.1.487 | 1,132 | 4/29/2024 |
| 4.1.480 | 1,137 | 4/22/2024 |
| 4.1.477 | 1,126 | 4/22/2024 |
| 4.1.474 | 1,154 | 4/15/2024 |
| 4.1.471 | 1,134 | 4/15/2024 |
| 4.1.466 | 1,189 | 4/8/2024 |
| 4.1.463 | 1,521 | 3/18/2024 |
| 4.1.460 | 1,199 | 3/18/2024 |
| 4.1.453 | 1,513 | 2/26/2024 |
| 4.1.449 | 1,237 | 2/26/2024 |
| 4.1.444 | 2,586 | 2/19/2024 |
| 4.1.441 | 1,264 | 2/19/2024 |
| 4.1.429 | 1,323 | 2/14/2024 |
| 4.1.423 | 1,317 | 2/12/2024 |