https://github.com/logocomune/maclookup-go
A Go library for interacting with MACLookup's API v2
https://github.com/logocomune/maclookup-go
go golang mac macaddress maclookup maclookup-api rest-client
Last synced: about 1 year ago
JSON representation
A Go library for interacting with MACLookup's API v2
- Host: GitHub
- URL: https://github.com/logocomune/maclookup-go
- Owner: logocomune
- License: mit
- Created: 2020-06-19T13:08:29.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-30T14:12:19.000Z (almost 3 years ago)
- Last Synced: 2025-04-05T19:03:54.454Z (about 1 year ago)
- Topics: go, golang, mac, macaddress, maclookup, maclookup-api, rest-client
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 6
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# maclookup-go
[](https://circleci.com/gh/logocomune/maclookup-go/tree/main)
[](https://goreportcard.com/report/github.com/logocomune/maclookup-go)
[](https://codecov.io/gh/logocomune/maclookup-go)
[](https://www.codefactor.io/repository/github/logocomune/maclookup-go)
A Go library for interacting with [MACLookup's API v2](https://maclookup.app/api-v2/documentation). This library allows you to:
- Get full info (MAC prefix, company name, address and country) of a MAC address
- Get Company name by MAC
## Installation
You need a working Go environment.
```shell
go get github.com/logocomune/maclookup-go
````
##Getting Started
```go
package main
import (
"log"
"github.com/logocomune/maclookup-go"
)
func main() {
client := maclookup.New()
r, err := client.CompanyName("000000")
if err != nil {
log.Fatal(err)
}
log.Println("MAC found in database:", r.Found)
log.Println("MAC is private (no company name):", r.IsPrivate)
log.Println("Company name:", r.Company)
log.Println("Api response in: ", r.RespTime)
log.Println("Rate limits - remaining request for current time window:", r.RateLimit.Remaining)
log.Println("Rate limits - next reset", r.RateLimit.Reset)
}
```
### Use custom timout
```go
client := maclookup.New()
client.WithTimeout(10*time.Second)
```
### API Key
Get an API Key [here](https://maclookup.app/api-v2/plans)
```go
client := maclookup.New()
client.WithAPIKey("an_api_key")
```
## Example
- [Get full info of a MAC](/example/lookup)
- [Get company name](/example/company-name)
- [Rate limit](/example/rate-limit)