Consolidate your domain portfolio from Porkbun and Cloudflare into a single, deduplicated report - with auto-renew status, expiration dates, and annual renewal costs. Easy to bring into Google Sheets for further cost analysis.

One script. One .env file. One CSV for Google Sheets. This was literally made to help me achieve Why I am getting rid of (some) domains.

You can grab it at Github.

Super simple - you will need the API keys for Cloudflare and Porkbun.

Domain Portfolio Script Console Feedback

What It Does

  1. Fetches all domains from Porkbun via the Porkbun API — the purchase source takes priority.
  2. Fetches all active DNS zones from Cloudflare via the Cloudflare API.
  3. Deduplicates: removes Cloudflare zones that use DNS but are owned through Porkbun. Porkbun always wins.
  4. Enriches each domain with:
    • expires_at — expiration date (standardized to YYYY-MM-DD HH:MM:SS)
    • auto_renew — whether auto-renewal is enabled (boolean)
    • renewal_cost — annual renewal cost in USD from TLD pricing APIs
  5. Outputs:
    • output/domains.json — full deduplicated enriched JSON
    • output/domains.csv — ready for import into Google Sheets