# List Subdomains

Returns subdomains for a given hostname

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "SecurityTrails API",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.securitytrails.com/v1"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/domain/{hostname}/subdomains": {
      "get": {
        "summary": "List Subdomains",
        "description": "Returns subdomains for a given hostname",
        "operationId": "list-subdomains-old",
        "parameters": [
          {
            "name": "hostname",
            "in": "path",
            "schema": {
              "type": "string",
              "default": "oracle.com"
            },
            "required": true
          },
          {
            "name": "apikey",
            "in": "query",
            "description": "Your SecurityTrails API key. See [authentication documentation](https://docs.securitytrails.com/docs/authentication)",
            "required": true,
            "schema": {
              "type": "string",
              "default": "your_api_key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"subdomains\": [\n    \"api\",\n    \"em\",\n    \"mail\",\n    \"www\"\n  ]\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "subdomains": {
                      "type": "array",
                      "items": {
                        "type": "string",
                        "example": "api"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"message\": \"The requested domain has invalid characters\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": {
                      "type": "string",
                      "example": "The requested domain has invalid characters"
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```