Macadress 1.0.0

dotnet add package Macadress --version 1.0.0
                    
NuGet\Install-Package Macadress -Version 1.0.0
                    
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="Macadress" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Macadress" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Macadress" />
                    
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 Macadress --version 1.0.0
                    
#r "nuget: Macadress, 1.0.0"
                    
#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 Macadress@1.0.0
                    
#: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=Macadress&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Macadress&version=1.0.0
                    
Install as a Cake Tool

macadress-csharp

Official .NET client for the macadress.com MAC address and OUI vendor lookup API.

  • Vendor name, OUI, IEEE block, country, address type, EUI-64 / IPv6 link-local, randomization confidence, device guess
  • Keyless vendor-name lookup, plus keyed single / batch / directory-search calls
  • Typed results with a Raw (JsonElement) escape hatch, typed ApiException / MacadressTransportException
  • CancellationToken on every call, netstandard2.0 (works on .NET Framework 4.6.1+, .NET Core 2+, .NET 5+)
using Macadress;

var mac = new MacadressClient("mk_live_xxx");

var name = await mac.VendorAsync("00:03:93:AB:12:34"); // "Apple, Inc."   (no API key required)
var res = await mac.LookupAsync("00:03:93:AB:12:34");  // res.Country == "US"

Install

dotnet add package Macadress

Getting a key

VendorAsync needs no key. Everything else does. A free key (1,000 lookups a day) is instant at macadress.com/signup; see pricing for more.

Usage

Create a client

var mac = new MacadressClient("mk_live_xxx");

// keyless: only VendorAsync will work
var anon = new MacadressClient();

// options
var mac = new MacadressClient("mk_live_xxx", new MacadressClientOptions
{
    BaseUrl = "https://api.macadress.com", // change only for a self-hosted deployment
    Timeout = TimeSpan.FromSeconds(10),
});

MacadressClient is safe for concurrent use. Dispose it unless you supplied your own HttpClient.

VendorAsync - name only, no key

Returns an empty string when the address is valid but has no vendor to report (unregistered, private, or locally administered / randomized).

await mac.VendorAsync("00:03:93:AB:12:34");   // "Apple, Inc."
await mac.VendorAsync("02:1a:2b:3c:4d:5e");   // ""

:, -, . and space grouping are all accepted, as is a bare 12-hex string.

LookupAsync - full analysis

var r = await mac.LookupAsync("3C:22:FB:12:34:56");

r.Organization;             // string?
r.VendorLookupReliable;     // bool  (false for a private block / LAA)
r.Oui;                      // "3C:22:FB"
r.MatchedPrefix;            // full matched block at its real width
r.BlockType;                // BlockType.MAL, etc.
r.Country;                  // "US"
r.AdministrationType;       // AdministrationType.UniversallyAdministered | LocallyAdministered
r.PotentiallyRandomized;    // bool
r.RandomizationConfidence;  // RandomizationConfidence.None | Possible | Likely
r.Eui64;                    // "3E:22:FB:FF:FE:12:34:56"
r.Ipv6LinkLocal;            // "fe80::3e22:fbff:fe12:3456"
r.Device.Category;          // DeviceCategory.Unknown (usually)
r.Explanation;               // plain-English summary
r.Meta.DatabaseVersion;     // "2026-08-30"

Any field the type does not cover is still reachable:

r.TryGet("vendor_location.city", out var city); // (bool, JsonElement)
r.Raw;                                          // JsonElement, the decoded payload

BatchAsync - up to 100 at once

Results come back in input order; check each item.

var items = await mac.BatchAsync(new[] { "00:03:93:00:00:00", "3C:22:FB:00:00:00", "bad" });
foreach (var it in items)
{
    Console.WriteLine(it.Failed ? $"{it.Input} -> ERROR {it.Error}" : $"{it.Input} -> {it.Organization}");
}

BatchAsync throws ArgumentException without making a request if the list is empty or longer than MacadressClient.MaxBatchSize (100).

SearchVendorsAsync - the directory

var res = await mac.SearchVendorsAsync("Cisco", country: "US", limit: 20);

res.Total; // total matches, ignoring the limit
foreach (var b in res.Blocks)
{
    Console.WriteLine($"{b.BlockType} {b.Organization} ({b.Country})");
}

HealthAsync

await mac.HealthAsync(); // bool; a transport failure is false, not an exception

Errors

try
{
    var r = await mac.LookupAsync(input);
}
catch (ApiException ex) when (ex.Kind == ApiErrorKind.RateLimited)
{
    await Task.Delay(ex.RetryAfter ?? TimeSpan.FromSeconds(1));
}
catch (ApiException ex) when (ex.Kind == ApiErrorKind.InvalidMac)
{
    // caller mistake, never billed
}
catch (MacadressTransportException)
{
    // never reached the API
}
Kind / type When
ApiErrorKind.InvalidMac HTTP 400, the input did not parse
ApiErrorKind.Auth HTTP 401, missing or invalid API key
ApiErrorKind.RateLimited HTTP 429, per-minute rate exceeded
ApiErrorKind.Quota HTTP 429, billing-cycle quota spent
ApiException any non-2xx: carries StatusCode, Message, RequestId, RetryAfter, Body
MacadressTransportException never reached the API: DNS, connection, TLS, timeout, canceled request

Development

dotnet build Macadress.slnx
dotnet test Macadress.slnx

License

MIT, see LICENSE. A product of ApisOS FZE.

Product 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 was computed. 
.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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 67 9/15/2026