ZipCodeStack 0.1.3
dotnet add package ZipCodeStack --version 0.1.3
NuGet\Install-Package ZipCodeStack -Version 0.1.3
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="ZipCodeStack" Version="0.1.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZipCodeStack" Version="0.1.3" />
<PackageReference Include="ZipCodeStack" />
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 ZipCodeStack --version 0.1.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ZipCodeStack, 0.1.3"
#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 ZipCodeStack@0.1.3
#: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=ZipCodeStack&version=0.1.3
#tool nuget:?package=ZipCodeStack&version=0.1.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ZipCodeStack .NET SDK
A lightweight C# client for the zipcodestack.com API providing search, distance, and status endpoints.
Website: https://zipcodestack.com/
License: MIT
Installation
dotnet add package ZipCodeStack
Quickstart
using System;
using System.Net.Http;
using System.Threading.Tasks;
using ZipCodeStack;
public class Example
{
public static async Task Main()
{
var client = new ZipCodeStackClient("YOUR_API_KEY");
var status = await client.GetStatusAsync();
Console.WriteLine($"API up: {status.Up}, remaining: {status.QuotaRemaining}");
var search = await client.SearchAsync("10001", country: "US");
Console.WriteLine(search.FirstOrDefault?.City);
var distance = await client.GetDistanceAsync("10001", "94105", country: "US", unit: "mi");
Console.WriteLine($"Distance: {distance.Distance} {distance.Unit}");
}
}
Configuration
using var http = new HttpClient();
var options = new ZipCodeStackOptions
{
ApiKey = "YOUR_API_KEY",
BaseUrl = "https://api.zipcodestack.com/v1", // default
UseQueryApiKey = false, // default: use header
ApiKeyHeaderName = "apikey", // default
ApiKeyQueryParameterName = "key" // if UseQueryApiKey = true
};
var client = new ZipCodeStackClient(http, options);
- Authentication: Use header
apikey: <KEY>by default or setUseQueryApiKey=trueto pass?apikey=<KEY>. See the official site for details on authentication, rate limits, and endpoints: https://zipcodestack.com/
API
GetStatusAsync()→ API status and quota infoSearchAsync(code, country?)→ zip/postal code informationGetDistanceAsync(from, to, country?, unit="km")→ distance between codes
All methods throw ZipCodeStackException on non-2xx responses with StatusCode, optional parsed Error, and RawContent.
Exceptions
try
{
var info = await client.SearchAsync("invalid");
}
catch (ZipCodeStackException ex)
{
Console.WriteLine($"Failed: {ex.StatusCode} {ex.Message}");
}
Building locally
# from repo root
dotnet build
Publishing to NuGet
Make sure you have NUGET_API_KEY set in your environment, then run:
# pack
dotnet pack ./src/ZipCodeStack/ZipCodeStack.csproj -c Release -o ./nupkgs
# push
dotnet nuget push ./nupkgs/ZipCodeStack*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json
License
MIT © ZipCodeStack
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.