MAClens

MAC address lookup

API documentation

The MAClens API returns a JSON analysis of a MAC address: normalized formats, I/G and U/L bits, manufacturer from the IEEE MA-L, MA-M and MA-S registries, and documented special cases.

Endpoints

A single public endpoint is exposed:

  • GET /api/mac/:mac

    Accessible from any site or script (CORS enabled). Use this for external calls.

Authentication

Without a key, free access is limited to 100 requests per day. To use your plan quota, send your API key with every request.

Recommended header

X-API-Key: YOUR_API_KEY

The Authorization header is also accepted:

Authorization: Bearer YOUR_API_KEY

Keep your key server-side: never embed it in code sent to the browser.

Parameters

?lang=lang
fr or en (default: en)
:mac
The MAC address, with or without separators (:, -, .) or as continuous hex.

Response structure

  • address — canonical, hex, dashed, Cisco and EUI-64 formats.
  • bits — I/G (transmission), U/L (administration: universal or local).
  • vendor — name, prefix, IEEE registry kind, country and flag.
  • special — title, summary and usage for reserved addresses.

Errors

  • 400 missing_mac — no address provided.
  • 422 invalid_mac — unrecognised format.

Integration examples

Replace :mac with the address to analyse.

Each example uses the X-API-Key header and requests an English response.

cURL CLI

curl -s -H "X-API-Key: YOUR_API_KEY" "https://maclens.net/api/mac/28:6F:B9:12:34:56?lang=en"

PHP — cURL

<?php
$curl = curl_init('https://maclens.net/api/mac/28:6F:B9:12:34:56?lang=en');
curl_setopt_array($curl, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => ['X-API-Key: YOUR_API_KEY'],
]);

$response = curl_exec($curl);
curl_close($curl);
$result = json_decode($response, true);

PHP — Symfony HttpClient

<?php
use Symfony\Component\HttpClient\HttpClient;

$client = HttpClient::create();
$response = $client->request('GET', 'https://maclens.net/api/mac/28:6F:B9:12:34:56?lang=en', [
    'headers' => ['X-API-Key' => 'YOUR_API_KEY'],
]);

$result = $response->toArray();

JavaScript — fetch

const response = await fetch('https://maclens.net/api/mac/28:6F:B9:12:34:56?lang=en', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' },
});

if (!response.ok) throw new Error(`HTTP ${response.status}`);
const result = await response.json();

JavaScript — Axios

import axios from 'axios';

const { data } = await axios.get('https://maclens.net/api/mac/28:6F:B9:12:34:56?lang=en', {
  headers: { 'X-API-Key': 'YOUR_API_KEY' },
});

Python — Requests

import requests

response = requests.get(
    'https://maclens.net/api/mac/28:6F:B9:12:34:56?lang=en',
    headers={'X-API-Key': 'YOUR_API_KEY'},
    timeout=10,
)
response.raise_for_status()
result = response.json()

Also read