{
  "openapi": "3.1.0",
  "info": {
    "title": "NoJunk Domain Intel",
    "version": "1.0.0",
    "description": "Domain intelligence in one call: RDAP registration (registrar, created, expires, age, status, nameservers), DNS records (A, AAAA, MX, NS, TXT, CNAME, SPF, DMARC), a live HTTPS probe (reachable, status, server, redirect target, HSTS), plus risk flags and a 0-100 risk score for new, parked, unreachable or badly configured domains.",
    "x-guidance": "Use GET /domain?domain=example.com (or POST /domain with JSON {domain}) to get a domain's RDAP registration (registrar, created, expires, age_days, status, nameservers), DNS records (A, AAAA, MX, NS, TXT count, SPF, DMARC, CNAME), a live HTTPS probe (reachable, status, server, redirects_to, hsts), risk flags and a 0-100 risk_score. A URL is accepted and its hostname extracted; IP addresses and localhost are rejected with 400. Costs $0.003 USDC on Base per request via x402. Good for vetting senders, links, vendors and crypto projects: new (<30 days), unregistered, parked, unreachable or mail-misconfigured domains score high. Partial upstream failures return null fields; a 502 (no charge) means both RDAP and DNS were unavailable."
  },
  "servers": [
    {
      "url": "https://nojunk-domain-intel.mick8511.workers.dev"
    }
  ],
  "paths": {
    "/domain": {
      "get": {
        "operationId": "domainIntel",
        "summary": "Domain registration (RDAP), DNS records, HTTPS reachability, risk flags and a 0-100 risk score for any domain",
        "tags": [
          "Domains",
          "DNS",
          "Security",
          "Verification"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.003000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Domain name or URL to check, e.g. 'example.com' or 'https://example.com/page'. The hostname is extracted from a URL. IP addresses and local names (localhost, .local) are rejected."
          }
        ],
        "responses": {
          "200": {
            "description": "Domain intelligence report",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain": {
                      "type": "string"
                    },
                    "registered": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "false when RDAP reports no registration; null when RDAP was unavailable"
                    },
                    "registrar": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "created": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Registration date, ISO 8601"
                    },
                    "expires": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updated": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "age_days": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Days since registration"
                    },
                    "status": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "string"
                      },
                      "description": "RDAP/EPP status values"
                    },
                    "nameservers": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "string"
                      }
                    },
                    "dns": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "a": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          }
                        },
                        "aaaa": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          }
                        },
                        "mx": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "priority": {
                                "type": "integer"
                              },
                              "host": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "ns": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          }
                        },
                        "txt_count": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "spf": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "true if a v=spf1 TXT record exists"
                        },
                        "spf_record": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "dmarc": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "true if _dmarc.<domain> has a v=DMARC1 TXT record"
                        },
                        "dmarc_record": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "cname": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    },
                    "web": {
                      "type": "object",
                      "properties": {
                        "reachable": {
                          "type": "boolean"
                        },
                        "status": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "server": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "redirects_to": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Final host if https://<domain>/ redirected elsewhere"
                        },
                        "hsts": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "Strict-Transport-Security header present"
                        }
                      }
                    },
                    "flags": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "not_registered",
                          "registered_under_30_days",
                          "expires_under_30_days",
                          "expired",
                          "no_mx",
                          "no_spf",
                          "no_dmarc",
                          "no_address_records",
                          "not_reachable",
                          "parked_nameservers",
                          "rdap_unavailable",
                          "dns_unavailable"
                        ]
                      }
                    },
                    "risk_score": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100,
                      "description": "new domain +40, not registered +40, no MX +10, no SPF +10, no DMARC +10, not reachable +15, parked nameservers +25, expires within 30 days +10 (capped at 100)"
                    },
                    "checked_at": {
                      "type": "string"
                    },
                    "sources": {
                      "type": "object"
                    },
                    "disclaimer": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "domain",
                    "registered",
                    "dns",
                    "web",
                    "flags",
                    "risk_score",
                    "checked_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid domain (IP address, local name, malformed) (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "413": {
            "description": "Input too large (no charge)"
          },
          "502": {
            "description": "RDAP and DNS both unavailable (no charge)"
          }
        }
      },
      "post": {
        "operationId": "domainIntelPost",
        "summary": "Domain registration (RDAP), DNS records, HTTPS reachability, risk flags and a 0-100 risk score for any domain",
        "tags": [
          "Domains",
          "DNS",
          "Security",
          "Verification"
        ],
        "x-payment-info": {
          "price": {
            "mode": "fixed",
            "currency": "USD",
            "amount": "0.003000"
          },
          "protocols": [
            {
              "x402": {}
            }
          ]
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string",
                    "minLength": 3,
                    "maxLength": 2048,
                    "description": "Domain name or URL to check, e.g. 'example.com' or 'https://example.com/page'. The hostname is extracted from a URL. IP addresses and local names (localhost, .local) are rejected."
                  }
                },
                "required": [
                  "domain"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Domain intelligence report",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain": {
                      "type": "string"
                    },
                    "registered": {
                      "type": [
                        "boolean",
                        "null"
                      ],
                      "description": "false when RDAP reports no registration; null when RDAP was unavailable"
                    },
                    "registrar": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "created": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Registration date, ISO 8601"
                    },
                    "expires": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "updated": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "age_days": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Days since registration"
                    },
                    "status": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "string"
                      },
                      "description": "RDAP/EPP status values"
                    },
                    "nameservers": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "string"
                      }
                    },
                    "dns": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "a": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          }
                        },
                        "aaaa": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          }
                        },
                        "mx": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "object",
                            "properties": {
                              "priority": {
                                "type": "integer"
                              },
                              "host": {
                                "type": "string"
                              }
                            }
                          }
                        },
                        "ns": {
                          "type": [
                            "array",
                            "null"
                          ],
                          "items": {
                            "type": "string"
                          }
                        },
                        "txt_count": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "spf": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "true if a v=spf1 TXT record exists"
                        },
                        "spf_record": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "dmarc": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "true if _dmarc.<domain> has a v=DMARC1 TXT record"
                        },
                        "dmarc_record": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "cname": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    },
                    "web": {
                      "type": "object",
                      "properties": {
                        "reachable": {
                          "type": "boolean"
                        },
                        "status": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "server": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "redirects_to": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Final host if https://<domain>/ redirected elsewhere"
                        },
                        "hsts": {
                          "type": [
                            "boolean",
                            "null"
                          ],
                          "description": "Strict-Transport-Security header present"
                        }
                      }
                    },
                    "flags": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "not_registered",
                          "registered_under_30_days",
                          "expires_under_30_days",
                          "expired",
                          "no_mx",
                          "no_spf",
                          "no_dmarc",
                          "no_address_records",
                          "not_reachable",
                          "parked_nameservers",
                          "rdap_unavailable",
                          "dns_unavailable"
                        ]
                      }
                    },
                    "risk_score": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100,
                      "description": "new domain +40, not registered +40, no MX +10, no SPF +10, no DMARC +10, not reachable +15, parked nameservers +25, expires within 30 days +10 (capped at 100)"
                    },
                    "checked_at": {
                      "type": "string"
                    },
                    "sources": {
                      "type": "object"
                    },
                    "disclaimer": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "domain",
                    "registered",
                    "dns",
                    "web",
                    "flags",
                    "risk_score",
                    "checked_at"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid domain (IP address, local name, malformed) (no charge)"
          },
          "402": {
            "description": "Payment Required"
          },
          "413": {
            "description": "Input too large (no charge)"
          },
          "502": {
            "description": "RDAP and DNS both unavailable (no charge)"
          }
        }
      }
    }
  }
}