Skip to content

Instantly share code, notes, and snippets.

@samymassoud
samymassoud / macvendors.co Python API
Created February 10, 2016 09:26
Get vendor name from mac address using http://macvendors.co API
import pprint
import requests
MAC_URL = 'http://macvendors.co/api/%s'
r = requests.get(MAC_URL % 'BC:92:6B:A0:00:01')
pprint.pprint(r.json())
@samymassoud
samymassoud / Macvendors.html
Last active January 11, 2021 19:29
Mac vendor lookup using https://macvendors.co JSONP API
<html>
<head>
<title>Macvendors.co JSONP API Example</title>
</head>
<body>
<div style="width:700px;margin:0 auto;">
<h2><a href="https://macvendors.co">Macvendors.co</a> JSONP API Example</h2>
#!/python33/python
#Python 3 Example of how to use https://macvendors.co to lookup vendor from mac address
print ("Content-Type: text/html\n")
import urllib.request as urllib2
import json
import codecs
#API base url,you can also use https if you need
url = "http://macvendors.co/api/"