API

The CleanBrowsing API uses basic CRUD operations. It’s designed to be simple and can be accessed any HTTPS library (e.g., cURL). Access control is managed via an authentication key, denoted as the “API Key”. This key should be present in all requests and should be managed using encryption protocols (e.g., HTTPS).

OperationDescription
category/blockAdds a new category to the block list.
category/allowRemoves a category from the block list (allows it).
categories/listList all categories blocked.
profile/addAdds a new profile.
profile/deleteDeletes an existing profile.
profiles/listListt all available profiles.
whitelist/addAdds a new domain to the whitelist.
whitelist/deleteDeletes a domain from the whitelist.
whitelist/listList all domain in the whitelist.
blocklist/addAdds a new domain to the blocklist.
blocklist/deleteDeletes a domain from the blocklist.
blocklist/listList all domains in the blocklist.
default-block/enableEnable defaults-block. Only whitelisted domains are allowed.
default-block/disableDisable the default-block option.
network/addAdds a new IP address to your network list.
network/deleteDeletes an IP address form the network list.
network/listList all IP addresses in the network list
logs/listList all the available logs for your account.
logs/getstatsGet details stats for a specific day.
logs/getdumpGet all the logs (dump) of all activity for a specific day.
logs/deleteDelete a specific log (Stats won’t be deleted)

CATEGORIES

A list of the available categories:

NameOptions
Category Names:category_adult
category_adultmixed
category_advertising_tracking
category_torrents
category_p2p_file_sharing
category_proxy_vpn
category_gaming
category_gambling
category_dating
category_social_network
category_search_engine
category_online_radio
category_weapons
category_malicious_blacklisted
category_video_streaming
category_drugs
category_alcohol
category_lingerie
category_hate_speech
category_academic_fraud
category_instant_messaging
category_self_harm

CATEGORY/block

Adds a new category to the block list.

ParameterArguement
Actioncategory/block
Required Valuecategory_name=[a-zA-Z0-9]{4,}
Optional Valueprofile_name=(valid_profile_name) or “default” when not provided
Results{“status” = “success”};
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=category/block&category_name=<CATEGORYNAME>

CATEGORY/allow

Removes a category from the block list (allows it).

ParameterArguement
Actioncategory/allow
Required Valuecategory_name=[a-zA-Z0-9]{4,}
Optional Valueprofile_name=(valid_profile_name) or “default” when not provided
Results{“status” = “success”};
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=category/allow&category_name=<CATEGORYNAME>

CATEGORIES/list

List all categories blocked.

ParameterArguement
Actioncategories/list
Required ValueN/A
Optional Valueprofile_name=(valid_profile_name) or “default” when not provided
Results{“status” = “success”};
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=category/list

PROFILE/add

Adds a new profile.

ParameterArguement
Actionprofile/add
Required Valueprofile_name=[a-zA-Z0-9]{4,}
Optional ValueN/A
Results{“status” = “success”};
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=profile/add&profile_name=<PROFILENAME>

PROFILE/delete

Deletes an existing profile.

ParameterArguement
Actionprofile/delete
Required Valueprofile_name=[a-zA-Z0-9]{4,}
Optional ValueN/A
Results{“status” = “success”};
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=profile/delete&profile_name=<PROFILENAME>

PROFILES/list

List all existing profiles.

ParameterArguement
Actionprofiles/list
Required Valueprofile_name=[a-zA-Z0-9]{4,}
Optional ValueN/A
Results{“status” = “success”};
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=profile/list

WHITELIST/add

Adds a new domain to the whitelist (list of domains that are always allowed, overwriting the default categories).

ParameterArguement
Actionwhitelist/add
Required Valuedomain_name=(valid_domain_name)
Optional Valueprofile_name=(valid_profile_name) or “default” when not provided
Results{“status” = “success”};
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=whitelist/add&domain_name=<domain_name>

WHITELIST/delete

Deletes a domain from the whitelist.

ParameterArguement
Actionwhitelist/delete
Required Valuedomain_name=(valid_domain_name)
Optional Valueprofile_name=(valid_profile_name) or “default” when not provided
Results{“status” = “success”};
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=whitelist/delete&domain_name=<DOMAINNAME>

WHITELIST/list

List all domains in the whitelist (all profiles it will be listed if no profile_name is included).

ParameterArguement
Actionwhitelist/list
Required ValueN/A
Optional Valueprofile_name=(valid_profile_name) or “default” when not provided
Results{“status”:”success”,”whitelist”:{“default”:[“mytestdomain.com”,”globo.com”],”profileexample”:[“music.com”,”test.com”]}}
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=whitelist/list

BLOCKLIST/add

Adds a new domain to the blocklist (list of domains that are always blocked, overwriting the default categories).

ParameterArguement
Actionblocklist/add
Required Valuedomain_name=(valid_domain_name)
Optional Valueprofile_name=(valid_profile_name) or “default” when not provided
Results{“status” = “success”};
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=blocklist/add&domain_name=<DOMAINNAME>

BLOCKLIST/delete

Deletes a domain from the blocklist.

ParameterArguement
Actionblocklist/delete
Required Valuedomain_name=(valid_domain_name)
Optional Valueprofile_name=(valid_profile_name) or “default” when not provided
Results{“status” = “success”};
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=blocklist/delete&domain_name=<DOMAINNAME>

BLOCKLIST/list

List all domains in the blocklist (all profiles it will be listed if no profile_name is included).

ParameterArguement
Actionblocklist/list
Required ValueN/A
Optional Valueprofile_name=(valid_profile_name) or “default” when not provided
Results{“status”:”success”,”blocklist”:{“default”:[“mytestdomain.com”,”globo.com”],”profileexample”:[“music.com”,”test.com”]}}
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=blocklist/list

DEFAULT-BLOCK/enable

Enables default-block for the profile. All domains will be blocked unless explicity allowed. WARNING: Use with caution.

ParameterArguement
Actiondefault-block/enable
Required Valueprofile_name=(valid_profile_name)
Optional ValueN/A
Results{“status” = “success”};
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=default-block/enable&profile_name=<default>

DEFAULT-BLOCK/disable

Disables default-block for the profile.

ParameterArguement
Actiondefault-block/disable
Required Valueprofile_name=(valid_profile_name)
Optional ValueN/A
Results{“status” = “success”};
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=default-block/disable&profile_name=<default>

NETWORK/add

Adds a new IP address to your network list.

ParameterArguement
Actionnetwork/add
Required Valueip_address=(valid_ipv4)
Optional Valueprofile_name=(valid_profile_name) or “default” when not provided
Results{“status” = “success”};
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=network/add&ip_address=<IPv4>

NETWORK/delete

Deletes an IP address from the network list.

ParameterArguement
Actionnetwork/delete
Required Valueip_address=(valid_ipv4)
Optional Valueprofile_name=(valid_profile_name) or “default” when not provided
Results{“status” = “success”};
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=network/delete&ip_address=<IPv4>

NETWORK/list

List all IP Addresses in your network list (all profiles it will be listed if no profile_name is included).

ParameterArguement
Actionnetwork/list
Required ValueN/A
Optional Valueprofile_name=(valid_profile_name) or “default” when not provided
Results{“status”:”success”,”networks”:{“default”:[“1.2.3.4″,”1.2.3.3″],”profileexample”:[“2.1.1.1″,”2.2.2.2”]}}
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=network/list

LOGS/list

List all the available days with full logs for your account.

ParameterArguement
Actionlogs/list
Required ValueN/A
Optional ValueN/A
Results{“status”:”success”,”logs”:[“2019-09-03″,”2019-09-02″,”2019-09-01”]}
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=logs/list

LOGS/getstats

Get detailed activity stats for a specific day. It returns a JSON output with all the activity on that day divided per hour. It is broken down by top IPs, top requests type, blocks, domains blocked, etc. This is a comprehensive view that can be useful when building your own stats.

ParameterArguement
Actionlogs/getstats
Required Valuedate=(valid_date in the format yyyy-mm-dd)
Optional ValueN/A
Results{“ips”:{“2019-08-29 00:00”:{“47.144.214.39″:1230},”2019-08-29 01:00”:{“47.144.214.39”:1067},…
“reqtypes”:{“2019-08-29 00:00”:{“A”:1103,”PTR”:2,”AAAA”:125},”2019-08-29 01:00″:{“A”:798,”AAAA”:266,”PTR”:3},…
“action”:{“2019-08-29 00:00”:{“Allowed”:1185,”Blocked”:45},”2019-08-29 01:00″:{“Allowed”:1034,”Blocked”:33},..
“blocks”:{“2019-08-29 00:00”:{“category_advertising_tracking”:43,”custom_filter”:2},”2019-08-29 01:00″:{“category_advertising_tracking”:27,”category_online_radio”:4,”custom_filter”:2}…
“domains”:{“2019-08-29 00:00”:{“Allowed”:{“www.gstatic.com.”:38,”ssl.gstatic.com.”:33,”play.google.com.”:26,”push.prod.netflix.com.”:26,”ips1.unifi-ai.com.”:25,”0.client-channel.google.com.”:24..
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=logs/getstats&date=2019-09-02

LOGS/getdump

Get all the logs for a specific day (in text format). The response can be very long (hundreds of MB), so use it with caution. It should not be called more than once per hour. Ideally, it should be called once per day at a maximum.

ParameterArguement
Actionlogs/getdump
Required Valuedate=(valid_date in the format yyyy-mm-dd)
Optional ValueN/A
Results2019-08-29 00:00:29 111 pass-through: allowed: 47.144.1.1: 1: play.google.com. (185.228.168.1)
2019-08-29 00:00:30 111 pass-through: allowed: 47.144.1.1: 1: people-pa.clients6.google.com. (185.228.168.1)
2019-08-29 00:00:33 111 pass-through: allowed: 47.144.1.1: 1: www.gstatic.com. (185.228.168.1)
2019-08-29 00:00:33 111 pass-through: allowed: 47.144.1.1: 1: www.gstatic.com. (185.228.169.1)
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=logs/getdump&date=2019-09-02

LOGS/delete

Delete a specific log (stats won’t be deleted) for the provided date.

ParameterArguement
Actionlogs/delete
Required Valuedate=(valid_date in the format yyyy-mm-dd)
Optional ValueN/A
Results{“status” = “success”};
Error{“status”:”failed”, “reason”:”reason why”}

Example:

https://my.cleanbrowsing.org/api?apikey=[key]&action=logs/delete&date=2019-09-02
Updated on February 6, 2024

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support