Provide the Public Suffix List in JSON format, making it easy to integrate with projects in any language. Useful for domain validation, email parsing, security, and more.
A "public suffix" is one under which Internet users can (or historically could) directly register names. Examples: .com, .co.uk, .pvt.k12.ma.us.
See publicsuffix.org for more information.
Download the latest JSON file from this repository or via direct link.
import json
import requests
url = "https://raw.githubusercontent.com/fbraz3/publicsuffix-json/master/public_suffix_list.json"
data = requests.get(url).json()
# Check if a suffix exists
print(".com" in data)
const fetch = require('node-fetch');
fetch('https://raw.githubusercontent.com/fbraz3/publicsuffix-json/master/public_suffix_list.json')
.then(res => res.json())
.then(data => {
console.log(data.includes('.com'));
});
curl -s https://raw.githubusercontent.com/fbraz3/publicsuffix-json/master/public_suffix_list.json | jq '. | index(".com")'
The file is automatically updated every day with the latest version of the Public Suffix List.
Distributed under the Mozilla Public License 2.0.