Add single or bulk IP addresses to your CleanBrowsing network list using the REST API. Includes CSV upload scripts for bash and PowerShell, plus deletion and listing.
Learn About Pricinghttps://my.cleanbrowsing.org/apiThe API key is passed as a query parameter in every request. See our full API Documentation for complete reference.
curl "https://my.cleanbrowsing.org/api?apikey=YOUR_API_KEY&action=network/add&ip_address=203.0.113.14"
curl "https://my.cleanbrowsing.org/api?apikey=YOUR_API_KEY&action=network/add&ip_address=203.0.113.14&profile_name=Teachers"
curl "https://my.cleanbrowsing.org/api?apikey=YOUR_API_KEY&action=network/delete&ip_address=203.0.113.14"
| Parameter | Required | Description |
|---|---|---|
apikey | Yes | Your API key from the dashboard |
action | Yes | network/add, network/delete, or network/list |
ip_address | Yes* | Valid IPv4 address (* not needed for network/list) |
profile_name | No | Target profile name (defaults to "default") |
Prepare a CSV file with the IP addresses you want to add. Two formats are supported:
All IPs go to the default profile (or a profile you specify in the script):
ip_address
198.51.100.10
198.51.100.11
198.51.100.12
198.51.100.13
Each IP specifies which profile it belongs to:
ip_address,profile_name
198.51.100.10,Teachers
198.51.100.11,Default
198.51.100.12,Students
198.51.100.13,Teachers
Save the file as ips.csv (or any name — you'll reference it in the script).
#!/bin/bash
# bulk-add-ips.sh — Add IPs from CSV to CleanBrowsing
API_KEY="YOUR_API_KEY"
CSV_FILE="ips.csv"
tail -n +2 "$CSV_FILE" | while IFS=, read -r ip_address; do
[ -z "$ip_address" ] && continue
echo "Adding: $ip_address"
curl -s "https://my.cleanbrowsing.org/api?apikey=${API_KEY}&action=network/add&ip_address=${ip_address}"
echo ""
sleep 1 # Rate limiting
done
#!/bin/bash
# bulk-add-ips-profiles.sh — Add IPs with profile assignment
API_KEY="YOUR_API_KEY"
CSV_FILE="ips.csv"
tail -n +2 "$CSV_FILE" | while IFS=, read -r ip_address profile_name; do
[ -z "$ip_address" ] && continue
echo "Adding: $ip_address -> $profile_name"
curl -s "https://my.cleanbrowsing.org/api?apikey=${API_KEY}&action=network/add&ip_address=${ip_address}&profile_name=${profile_name}"
echo ""
sleep 1
done
#!/bin/bash
# bulk-delete-ips.sh — Remove IPs from CleanBrowsing
API_KEY="YOUR_API_KEY"
CSV_FILE="ips.csv"
tail -n +2 "$CSV_FILE" | while IFS=, read -r ip_address _; do
[ -z "$ip_address" ] && continue
echo "Deleting: $ip_address"
curl -s "https://my.cleanbrowsing.org/api?apikey=${API_KEY}&action=network/delete&ip_address=${ip_address}"
echo ""
sleep 1
done
Make the script executable and run it:
chmod +x bulk-add-ips.sh
./bulk-add-ips.sh
# bulk-add-ips.ps1
$ApiKey = "YOUR_API_KEY"
$CsvFile = "ips.csv"
$ips = Import-Csv $CsvFile
foreach ($row in $ips) {
$ip = $row.ip_address
Write-Host "Adding: $ip"
Invoke-WebRequest -Uri "https://my.cleanbrowsing.org/api?apikey=$ApiKey&action=network/add&ip_address=$ip" -UseBasicParsing
Start-Sleep -Seconds 1
}
# bulk-add-ips-profiles.ps1
$ApiKey = "YOUR_API_KEY"
$CsvFile = "ips.csv"
$ips = Import-Csv $CsvFile
foreach ($row in $ips) {
$ip = $row.ip_address
$profile = $row.profile_name
Write-Host "Adding: $ip -> $profile"
Invoke-WebRequest -Uri "https://my.cleanbrowsing.org/api?apikey=$ApiKey&action=network/add&ip_address=$ip&profile_name=$profile" -UseBasicParsing
Start-Sleep -Seconds 1
}
# bulk-delete-ips.ps1
$ApiKey = "YOUR_API_KEY"
$CsvFile = "ips.csv"
$ips = Import-Csv $CsvFile
foreach ($row in $ips) {
$ip = $row.ip_address
Write-Host "Deleting: $ip"
Invoke-WebRequest -Uri "https://my.cleanbrowsing.org/api?apikey=$ApiKey&action=network/delete&ip_address=$ip" -UseBasicParsing
Start-Sleep -Seconds 1
}
After uploading, verify that all IPs were added correctly:
curl "https://my.cleanbrowsing.org/api?apikey=YOUR_API_KEY&action=network/list"
Returns all registered IPs across all profiles.
curl "https://my.cleanbrowsing.org/api?apikey=YOUR_API_KEY&action=network/list&profile_name=Teachers"
$ApiKey = "YOUR_API_KEY"
$response = Invoke-WebRequest -Uri "https://my.cleanbrowsing.org/api?apikey=$ApiKey&action=network/list" -UseBasicParsing
$response.Content | ConvertFrom-Json
Compare the returned list against your CSV to confirm all IPs were added to the correct profiles.