https://github.com/misinformeddna/smartystreets.net
SmartyStreets client library for .NET
https://github.com/misinformeddna/smartystreets.net
Last synced: 10 months ago
JSON representation
SmartyStreets client library for .NET
- Host: GitHub
- URL: https://github.com/misinformeddna/smartystreets.net
- Owner: MisinformedDNA
- License: mit
- Created: 2014-09-04T20:01:06.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2018-02-22T20:24:37.000Z (over 8 years ago)
- Last Synced: 2025-07-29T02:47:10.005Z (11 months ago)
- Language: C#
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
StreetSmarts client library for .NET
=================
Use of this API requires free registration [here](https://smartystreets.com). Official documentation for SmartyStreets is [here](https://smartystreets.com/docs/cloud).
----
*Making a request is easy.*
First set up your client
_client = new SmartyStreetsClient(
ConfigurationManager.AppSettings["smartystreets:AuthId"],
ConfigurationManager.AppSettings["smartystreets:AuthToken"]);
If you want to verify an address
var request = new StreetAddressRequest
{
Street = "3785 s las vegs av.",
City = "los vegos,",
State = "nevada",
Zipcode = "90210",
};
var response = await _client.StreetAddressAsync(request);
var result = await response.GetResultsAsync();
You can also use their zipcode library
private static async Task CityStateToZipcodeExample()
{
var request = new ZipcodeRequest { City = "Los Angeles", State = "California" };
var response = await _client.ZipcodeAsync(request);
var result = await response.GetResultsAsync();
}
The official StreetSmarts API also allows for batch processing, which this API also supports.
var response = await _client.StreetAddressAsync(new[] { request });
If you want to set custom headers in the request
_client.HttpRequestHeaders.Add("x-standardize-only", "true")
If you want to have full control over deserialization and observing headers, the `HttpResponseMessage` is also included.
var result = await response.ResponseMessage.Content.ReadAsStringAsync();
Please report any issues or suggestions. PRs appreciated.