Skip to content

fbraz3/publicsuffix-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

publicsuffix-json

Build Json Daily Update GitHub DeepWiki

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.

About Public Suffix List

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.

How to use

Download the latest JSON file from this repository or via direct link.

Usage examples

Python

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)

JavaScript (Node.js)

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'));
  });

Bash (jq)

curl -s https://raw.githubusercontent.com/fbraz3/publicsuffix-json/master/public_suffix_list.json | jq '. | index(".com")'

Update

The file is automatically updated every day with the latest version of the Public Suffix List.

Source

License

Distributed under the Mozilla Public License 2.0.

About

The Public Suffix List from https://publicsuffix.org/ in json format

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

  •  

Packages

No packages published