VOOZH about

URL: https://www.nuget.org/packages/ViaCep/

⇱ NuGet Gallery | ViaCep 5.0.1


ο»Ώ

πŸ‘ Image
ViaCep 5.0.1

dotnet add package ViaCep --version 5.0.1
 
 
NuGet\Install-Package ViaCep -Version 5.0.1
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ViaCep" Version="5.0.1" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ViaCep" Version="5.0.1" />
 
Directory.Packages.props
<PackageReference Include="ViaCep" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ViaCep --version 5.0.1
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ViaCep, 5.0.1"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ViaCep@5.0.1
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ViaCep&version=5.0.1
 
Install as a Cake Addin
#tool nuget:?package=ViaCep&version=5.0.1
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

ViaCEP SDK .NET

A .NET client wrapper for both .NET Core & .NET Framework projects of Via CEP API

πŸ‘ GitHub license
πŸ‘ time tracker

πŸ‘ Via CEP

CI/CD

Build status Last commit Tests Coverage Code Smells LOC
πŸ‘ Build and Test
πŸ‘ GitHub last commit
πŸ‘ Build and Test
πŸ‘ Coverage
πŸ‘ Code Smells
πŸ‘ Lines of Code

Code Quality

πŸ‘ Codacy Badge
πŸ‘ Codacy Badge

πŸ‘ codecov
πŸ‘ CodeFactor

πŸ‘ Maintainability
πŸ‘ Test Coverage

πŸ‘ Quality Gate Status
πŸ‘ Maintainability Rating

πŸ‘ Technical Debt
πŸ‘ Duplicated Lines (%)

πŸ‘ Reliability Rating
πŸ‘ Security Rating

πŸ‘ Bugs
πŸ‘ Vulnerabilities

πŸ‘ DeepSource


Installation

Github Releases

πŸ‘ GitHub last release
πŸ‘ GitHub All Releases

Download the latest zip file from the Release page.

Nuget package manager

Package Version Downloads
ViaCEP πŸ‘ ViaCEP NuGet Version
πŸ‘ ViaCEP NuGet Downloads

Usage

The package has two classes:

This package is fully compatible with Dependency Injection. Use the interface IViaCepClient and the constructor with an HttpClient parameter and an 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 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

  • 2024-09-02: Add explicit support to .NET 6.0 and .NET 8.0 #154 by @guibranco
  • 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: Support .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 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 is compatible.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 is compatible. 
.NET Framework net461 net461 was computed.  net462 net462 was computed.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 was computed.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
5.0.1 1,057 4/12/2026
5.0.0 641 4/12/2026
4.3.24 641 4/12/2026
4.1.511 14,244 5/31/2024
4.1.510 2,461 5/28/2024
4.1.507 2,434 5/28/2024
4.1.502 2,444 5/28/2024
4.1.495 2,655 4/29/2024
4.1.492 2,447 4/29/2024
4.1.487 2,449 4/29/2024
4.1.480 2,460 4/22/2024
4.1.477 2,442 4/22/2024
4.1.474 2,476 4/15/2024
4.1.471 2,456 4/15/2024
4.1.466 2,523 4/8/2024
4.1.463 2,910 3/18/2024
4.1.460 2,517 3/18/2024
4.1.453 2,916 2/26/2024
4.1.449 2,555 2/26/2024
4.1.444 3,901 2/19/2024
Loading failed