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 | 7,758 | 5/31/2024 |
| 4.1.510 | 826 | 5/28/2024 |
| 4.1.507 | 808 | 5/28/2024 |
| 4.1.502 | 813 | 5/28/2024 |
| 4.1.495 | 968 | 4/29/2024 |
| 4.1.492 | 822 | 4/29/2024 |
| 4.1.487 | 830 | 4/29/2024 |
| 4.1.480 | 827 | 4/22/2024 |
| 4.1.477 | 822 | 4/22/2024 |
| 4.1.474 | 847 | 4/15/2024 |
| 4.1.471 | 829 | 4/15/2024 |
| 4.1.466 | 885 | 4/8/2024 |
| 4.1.463 | 1,200 | 3/18/2024 |
| 4.1.460 | 895 | 3/18/2024 |
| 4.1.453 | 1,171 | 2/26/2024 |
| 4.1.449 | 929 | 2/26/2024 |
| 4.1.444 | 2,281 | 2/19/2024 |
| 4.1.441 | 949 | 2/19/2024 |
| 4.1.429 | 1,018 | 2/14/2024 |
| 4.1.423 | 1,012 | 2/12/2024 |
| 4.1.420 | 1,103 | 1/30/2024 |
| 4.1.417 | 1,021 | 1/29/2024 |
| 4.1.411 | 1,088 | 1/16/2024 |
| 4.1.408 | 1,041 | 1/16/2024 |
| 4.1.401 | 1,015 | 1/15/2024 |
| 4.1.394 | 1,065 | 1/8/2024 |
| 4.1.386 | 1,170 | 12/25/2023 |
| 4.1.383 | 1,109 | 12/25/2023 |
| 4.1.378 | 1,130 | 12/18/2023 |
| 4.1.373 | 1,126 | 12/14/2023 |
| 4.1.367 | 1,146 | 12/12/2023 |
| 4.1.364 | 1,140 | 12/12/2023 |
| 4.1.354 | 1,129 | 12/11/2023 |
| 4.1.345 | 1,143 | 12/4/2023 |
| 4.1.342 | 1,104 | 12/4/2023 |
| 4.1.337 | 1,191 | 12/4/2023 |
| 4.1.334 | 1,142 | 11/28/2023 |
| 4.1.331 | 1,140 | 11/21/2023 |
| 4.1.328 | 1,108 | 11/21/2023 |
| 4.1.323 | 1,141 | 11/21/2023 |
| 4.1.316 | 1,175 | 11/14/2023 |
| 4.1.311 | 1,123 | 11/14/2023 |
| 4.1.305 | 1,148 | 11/14/2023 |
| 4.1.300 | 1,167 | 11/10/2023 |
| 4.1.290 | 1,133 | 11/6/2023 |
| 4.1.287 | 1,118 | 11/6/2023 |
| 4.1.282 | 1,222 | 10/31/2023 |
| 4.1.276 | 3,495 | 10/18/2023 |
| 4.1.273 | 1,183 | 10/17/2023 |
| 4.1.268 | 1,144 | 10/17/2023 |
| 4.1.261 | 1,350 | 9/19/2023 |
| 4.1.258 | 1,243 | 9/18/2023 |
| 4.1.253 | 1,452 | 9/5/2023 |
| 4.1.250 | 1,230 | 9/5/2023 |
| 4.1.241 | 2,873 | 8/24/2023 |
| 4.1.238 | 1,324 | 8/14/2023 |
| 4.1.235 | 1,396 | 8/9/2023 |
| 4.1.232 | 1,378 | 8/1/2023 |
| 4.1.229 | 1,384 | 8/1/2023 |
| 4.1.224 | 1,370 | 8/1/2023 |
| 4.1.217 | 1,393 | 7/31/2023 |
| 4.1.208 | 1,367 | 7/29/2023 |
| 4.1.203 | 1,346 | 7/28/2023 |
| 4.1.196 | 1,327 | 7/28/2023 |
| 4.1.190 | 1,399 | 7/24/2023 |
| 4.1.188 | 1,380 | 7/24/2023 |
| 4.1.184 | 1,420 | 7/24/2023 |
| 4.1.149 | 1,383 | 7/17/2023 |
| 4.1.146 | 1,387 | 7/11/2023 |
| 4.1.143 | 1,402 | 7/11/2023 |
| 4.1.138 | 1,356 | 7/3/2023 |
| 4.1.135 | 1,421 | 6/15/2023 |
| 4.1.132 | 1,402 | 6/6/2023 |
| 4.1.131 | 1,378 | 6/6/2023 |
| 4.1.128 | 1,400 | 6/6/2023 |
| 4.1.123 | 2,076 | 5/24/2023 |
| 4.1.120 | 1,411 | 5/24/2023 |
| 4.1.115 | 1,397 | 5/24/2023 |
| 4.1.104 | 1,340 | 5/4/2023 |
| 4.1.101 | 1,385 | 5/3/2023 |
| 4.1.96 | 1,513 | 4/9/2023 |
| 4.1.92 | 1,432 | 4/4/2023 |
| 4.1.87 | 1,418 | 3/25/2023 |
| 4.1.79 | 1,419 | 3/23/2023 |
| 4.1.76 | 1,566 | 3/3/2023 |
| 4.1.73 | 1,423 | 3/3/2023 |
| 4.1.57 | 1,436 | 3/3/2023 |
| 4.1.54 | 1,611 | 1/24/2023 |
| 4.1.53 | 1,641 | 1/15/2023 |
| 4.1.48 | 1,491 | 1/15/2023 |
| 4.1.45 | 1,498 | 1/14/2023 |
| 4.1.40 | 1,512 | 1/14/2023 |
| 3.2.35 | 1,483 | 1/14/2023 |
| 3.2.32 | 1,581 | 12/25/2022 |
| 3.2.27 | 1,448 | 12/25/2022 |
| 3.2.19 | 31,805 | 6/21/2021 |
| 3.1.5 | 11,981 | 10/23/2020 |
| 3.0.40 | 11,679 | 4/18/2020 |
| 3.0.38 | 2,477 | 4/7/2020 |
| 3.0.30 | 1,843 | 3/30/2020 |
| 3.0.23 | 1,872 | 3/29/2020 |
| 3.0.15 | 1,854 | 3/29/2020 |
| 3.0.12 | 1,795 | 3/29/2020 |
| 3.0.9 | 1,956 | 3/28/2020 |
| 2.0.93 | 8,491 | 3/28/2020 |
| 2.0.92 | 2,717 | 3/28/2020 |
| 2.0.89 | 2,716 | 3/28/2020 |
| 2.0.88 | 2,732 | 3/28/2020 |
| 2.0.80 | 2,766 | 3/28/2020 |
| 2.0.64 | 8,099 | 12/30/2019 |
| 2.0.61 | 22,278 | 12/3/2019 |
| 2.0.58 | 3,519 | 9/22/2019 |
| 2.0.48 | 4,705 | 2/15/2019 |
| 2.0.47 | 2,893 | 2/15/2019 |
| 1.0.0 | 2,841 | 2/15/2019 |