Bulk Add IPs to Your Network via API

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 Pricing

Step 1: Prerequisites

  • Plan requirement: API access is available on Pro 500+ plans.
  • API key: Get your API key from the CleanBrowsing dashboard under Settings.
  • Base URL: https://my.cleanbrowsing.org/api

The API key is passed as a query parameter in every request. See our full API Documentation for complete reference.

Step 2: Single IP Operations


Add an IP to the Default Profile

curl "https://my.cleanbrowsing.org/api?apikey=YOUR_API_KEY&action=network/add&ip_address=203.0.113.14"

Add an IP to a Specific Profile

curl "https://my.cleanbrowsing.org/api?apikey=YOUR_API_KEY&action=network/add&ip_address=203.0.113.14&profile_name=Teachers"

Delete an IP

curl "https://my.cleanbrowsing.org/api?apikey=YOUR_API_KEY&action=network/delete&ip_address=203.0.113.14"

API Parameters

ParameterRequiredDescription
apikeyYesYour API key from the dashboard
actionYesnetwork/add, network/delete, or network/list
ip_addressYes*Valid IPv4 address (* not needed for network/list)
profile_nameNoTarget profile name (defaults to "default")

Step 3: CSV File Format

Prepare a CSV file with the IP addresses you want to add. Two formats are supported:


Option A: Single Profile (IPs only)

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

Option B: Mixed Profiles

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).

Step 4: Bulk Upload — Bash (macOS / Linux)


Option A: Single Profile

#!/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

Option B: Mixed Profiles

#!/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

Bulk Delete (Bash)

#!/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

Step 5: Bulk Upload — PowerShell (Windows)


Option A: Single Profile

# 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
}

Option B: Mixed Profiles

# 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 (PowerShell)

# 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
}

Step 6: Verify & List

After uploading, verify that all IPs were added correctly:


List All Networks

curl "https://my.cleanbrowsing.org/api?apikey=YOUR_API_KEY&action=network/list"

Returns all registered IPs across all profiles.


List Networks for a Specific Profile

curl "https://my.cleanbrowsing.org/api?apikey=YOUR_API_KEY&action=network/list&profile_name=Teachers"

PowerShell Verification

$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.