{"record":{"id":"4acc7165b3927c93","repo":"sundowndev/phoneinfoga","slug":"api-key-is-not-defined","errorCode":null,"errorMessage":"API key is not defined","messagePattern":"API key is not defined","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/remote/numverify_scanner.go","lineNumber":44,"sourceCode":"}\n\nfunc NewNumverifyScanner(s suppliers.NumverifySupplierInterface) Scanner {\n\treturn &numverifyScanner{client: s}\n}\n\nfunc (s *numverifyScanner) Name() string {\n\treturn Numverify\n}\n\nfunc (s *numverifyScanner) Description() string {\n\treturn \"Request info about a given phone number through the Numverify API.\"\n}\n\nfunc (s *numverifyScanner) DryRun(_ number.Number, opts ScannerOptions) error {\n\tif opts.GetStringEnv(\"NUMVERIFY_API_KEY\") != \"\" {\n\t\treturn nil\n\t}\n\treturn errors.New(\"API key is not defined\")\n}\n\nfunc (s *numverifyScanner) Run(n number.Number, opts ScannerOptions) (interface{}, error) {\n\tapiKey := opts.GetStringEnv(\"NUMVERIFY_API_KEY\")\n\n\tres, err := s.client.Request().SetApiKey(apiKey).ValidateNumber(n.International)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdata := NumverifyScannerResponse{\n\t\tValid:               res.Valid,\n\t\tNumber:              res.Number,\n\t\tLocalFormat:         res.LocalFormat,\n\t\tInternationalFormat: res.InternationalFormat,\n\t\tCountryPrefix:       res.CountryPrefix,\n\t\tCountryCode:         res.CountryCode,\n\t\tCountryName:         res.CountryName,","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/sundowndev/phoneinfoga/blob/55807b05b753dab7bc6fe67403ca385668dda179/lib/remote/numverify_scanner.go#L26-L62","documentation":"This sentinel error is thrown by numverifyScanner.DryRun during pre-flight validation when the NUMVERIFY_API_KEY environment variable is unset or empty. It is a generic guard, not an API failure: the scanner stops before making any request because the Numverify API requires a valid API key for authentication. The input at fault is the missing environment variable; setting NUMVERIFY_API_KEY (e.g. via ScannerOptions env) resolves it.","triggerScenarios":"Running a scan with the numverify scanner enabled while the NUMVERIFY_API_KEY environment variable is unset or empty string.","commonSituations":"Signed up for numverify but never exported the key, running in CI where secrets were not injected, restarting a shell without re-sourcing the env file, or misspelling the variable name.","solutions":["Export NUMVERIFY_API_KEY=<your key> before running the scan","Ensure your .env/secrets file is actually loaded in the environment where the tool runs (CI secret, docker --env-file, etc.)","Verify with `echo $NUMVERIFY_API_KEY` that it is non-empty","Disable the numverify scanner if you do not intend to use it"],"exampleFix":"// before\nscan --number +14155552671   # NUMVERIFY_API_KEY empty\n// after\nexport NUMVERIFY_API_KEY=abc123def456\nscan --number +14155552671","handlingStrategy":"validation","validationCode":"if os.Getenv(\"NUMVERIFY_API_KEY\") == \"\" {\n    return errors.New(\"numverify scanner requires NUMVERIFY_API_KEY\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Export NUMVERIFY_API_KEY in your shell profile or CI secrets","Verify key validity in the numverify dashboard before scans","Run DryRun-based smoke tests as part of setup","Standardize credential loading (one .env sourced everywhere)"],"tags":["numverify","env-var","configuration"],"backgroundTag":"missing-env-var","analyzedSha":"55807b05b753dab7bc6fe67403ca385668dda179","analyzedAt":"2026-09-03T13:37:27.908Z","contentChangedAt":"2026-09-03T13:37:27.908Z","schemaVersion":2},"datasetVersion":"2026-09-10T17:17:09.494Z"}