Skip to content

Python tools for bulk domain management via Spaceship.com API. Unlock domains, get auth codes, and manage DNS records for hundreds of domains at once.

Notifications You must be signed in to change notification settings

simplebytes-com/Spaceship-Bulk-Management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Spaceship Domain Management Tools

Python scripts for managing domains via the Spaceship.com API. Automate domain transfers, DNS management, and more.

๐Ÿš€ Features

1. Unlock Domains & Get Auth Codes (unlock_domain_transfers.py)

  • ๐Ÿ”“ Unlocks domain transfer locks
  • ๐Ÿ”‘ Retrieves authorization/EPP codes automatically
  • ๐Ÿ’พ Saves all results to CSV
  • โœ… Supports batch processing of hundreds of domains

2. Delete A Records (delete_spaceship_a_records.py)

  • ๐Ÿ—‘๏ธ Removes all A records from domains
  • ๐Ÿ“‹ Processes domains from CSV
  • ๐Ÿ”ธ Dry-run mode to preview changes
  • โšก Built-in rate limiting

๐Ÿ“‹ Prerequisites

  1. Python 3.x

  2. Spaceship API Credentials

    • Go to: https://www.spaceship.com/application/api-manager/
    • Click "New API key"
    • Enable required permissions:
      • domains:read - Read domain information
      • domains:transfer - Unlock domains and get auth codes
      • dnsrecords:read - Read DNS records
      • dnsrecords:write - Modify/delete DNS records
    • Save your API Key and API Secret
  3. Python Dependencies

    pip install requests

๐Ÿ”ง Setup

1. Clone or Download

git clone https://github.com/yourusername/spaceship-domain-tools.git
cd spaceship-domain-tools

2. Install Dependencies

pip install -r requirements.txt

3. Configure API Credentials

Create a .env file in the project directory:

cp .env.example .env

Edit .env and add your credentials:

SPACESHIP_API_KEY=your_api_key_here
SPACESHIP_API_SECRET=your_api_secret_here

โš ๏ธ Important: Never commit .env to git! It's already in .gitignore.

๐Ÿ“– Usage

Unlock Domains & Get Auth Codes

From CSV File

# Dry-run first (recommended)
python3 unlock_domain_transfers.py --csv domains.csv --dry-run

# Run for real
python3 unlock_domain_transfers.py --csv domains.csv --yes

Single Domain

# With confirmation prompt
python3 unlock_domain_transfers.py --domain example.com

# Skip confirmation
python3 unlock_domain_transfers.py --domain example.com --yes

CSV Input Format

The script accepts two formats:

Format 1: Plain text (one domain per line)

example.com
test.com
mysite.com

Format 2: CSV with headers

domain,platform
example.com,Spaceship
test.com,Spaceship

Output

Results are saved to unlock_results.csv:

domain unlock_success unlock_message is_locked auth_code auth_code_expires timestamp
example.com True Unlocked False ABC123xyz@#$ 2100-01-01T00:00:00Z 2025-10-23T10:30:45

The auth_code column contains the codes you need for transferring domains!

Delete A Records

From CSV File

# Dry-run first (recommended)
python3 delete_spaceship_a_records.py --csv domains.csv --dry-run

# Run for real
python3 delete_spaceship_a_records.py --csv domains.csv

The script will:

  1. Load domains from CSV (filters for platform=Spaceship by default)
  2. Fetch DNS records for each domain
  3. Identify A records
  4. Delete them (with confirmation)

โš™๏ธ Command Line Options

unlock_domain_transfers.py

Required (one of):
  --csv FILE          Path to CSV file or plain text file with domains
  --domain DOMAIN     Single domain name

Optional:
  --dry-run          Preview changes without making them
  --yes, -y          Skip confirmation prompts
  --platform NAME    Filter CSV by platform (default: None)
  --output FILE      Output CSV path (default: unlock_results.csv)
  --lock             Lock domains instead of unlocking
  --api-key KEY      API key (or use .env)
  --api-secret SEC   API secret (or use .env)

delete_spaceship_a_records.py

Optional:
  --csv FILE          Path to CSV file (default: domain_resolution_results.csv)
  --dry-run          Preview what would be deleted
  --api-key KEY      API key (or use .env)
  --api-secret SEC   API secret (or use .env)

๐Ÿ”’ Security Best Practices

  1. Never commit .env files - Already in .gitignore
  2. Keep auth codes secure - The output CSV contains sensitive data
  3. Use dry-run first - Always preview changes before running
  4. Limit API permissions - Only enable what you need
  5. Rotate keys regularly - Generate new API keys periodically

๐Ÿ“Š Examples

Example 1: Transfer 100 domains to another registrar

# Step 1: Create a list of domains
cat > my_domains.txt <<EOF
example.com
test.com
mysite.com
EOF

# Step 2: Unlock and get auth codes (dry-run first)
python3 unlock_domain_transfers.py --csv my_domains.txt --dry-run

# Step 3: Run for real
python3 unlock_domain_transfers.py --csv my_domains.txt --yes

# Step 4: Open the results to get auth codes
open unlock_results.csv

Example 2: Remove parking page A records

# Preview which domains have A records
python3 delete_spaceship_a_records.py --csv domains.csv --dry-run

# Delete them
python3 delete_spaceship_a_records.py --csv domains.csv

Example 3: Single domain transfer

# Quick unlock for one domain
python3 unlock_domain_transfers.py --domain example.com --yes

# View the auth code
cat unlock_results.csv | grep example.com

๐Ÿšจ Troubleshooting

"Permission denied - check domains:transfer scope"

  • Your API key doesn't have the required permission
  • Regenerate the key with correct scopes at the API manager

"Domain not found"

  • Domain is not in your Spaceship account
  • Check spelling or verify ownership

"Rate limit exceeded"

  • Wait a few minutes before retrying
  • Scripts include rate limiting (1.5s per domain)

"EOF when reading a line"

  • You're running in the background without --yes flag
  • Add --yes flag or run in foreground

๐Ÿ“ Rate Limits

Spaceship API rate limits:

  • Transfer operations: 5 requests per domain within 300 seconds
  • DNS operations: Standard rate limits apply

Scripts are configured conservatively:

  • Unlock script: 1.5 seconds per domain (2 API calls each)
  • Delete script: 0.5 seconds between requests

๐Ÿค Contributing

Found a bug or want to contribute? Feel free to:

  • Open an issue
  • Submit a pull request
  • Share feedback

๐Ÿ“„ License

MIT License - feel free to use and modify as needed.

โš ๏ธ Disclaimer

These scripts interact with live domain data. Always:

  • โœ… Use dry-run mode first
  • โœ… Keep backups of important DNS configurations
  • โœ… Test with a single domain before batch processing
  • โœ… Understand what each script does before running

๐Ÿ”— Resources

๐Ÿ“ฎ Support

For API-related issues, contact Spaceship support at: support@spaceship.com


Made with โค๏ธ for domain portfolio management

About

Python tools for bulk domain management via Spaceship.com API. Unlock domains, get auth codes, and manage DNS records for hundreds of domains at once.

Resources

Stars

Watchers

Forks

Languages