summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authors <[email protected]>2025-11-09 14:26:42 -0500
committers <[email protected]>2025-11-09 14:26:42 -0500
commit65acee9a9b500c17b9426f80997401758ec326b1 (patch)
tree358adc19e4099077d09f7d0001a3269a07a63da4 /cmd
parentf1070f0a2be928d188c418b59fcbc8e82d1a9367 (diff)
downloaddborg-65acee9a9b500c17b9426f80997401758ec326b1.tar.gz
dborg-65acee9a9b500c17b9426f80997401758ec326b1.zip
feat: add osint geo search command for address information lookupv0.6.0
Diffstat (limited to 'cmd')
-rw-r--r--cmd/osint.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/cmd/osint.go b/cmd/osint.go
index 6bb66c5..eb1ec50 100644
--- a/cmd/osint.go
+++ b/cmd/osint.go
@@ -70,6 +70,13 @@ var osintShortlinksCmd = &cobra.Command{
RunE: runOsintShortlinksSearch,
}
+var osintGeoCmd = &cobra.Command{
+ Use: "geo",
+ Short: "Search for address information",
+ Long: `Returns address information including residents, property details, and demographics (costs 1 credit)`,
+ RunE: runOsintGeoSearch,
+}
+
func init() {
rootCmd.AddCommand(osintCmd)
osintCmd.AddCommand(osintUsernameCmd)
@@ -79,6 +86,7 @@ func init() {
osintCmd.AddCommand(osintBucketsCmd)
osintCmd.AddCommand(osintBucketFilesCmd)
osintCmd.AddCommand(osintShortlinksCmd)
+ osintCmd.AddCommand(osintGeoCmd)
osintUsernameCmd.Flags().StringSliceP("sites", "s", []string{}, "Specific sites to check (comma-separated)")
osintUsernameCmd.Flags().BoolP("fuzzy", "f", false, "Enable fuzzy validation mode")
@@ -112,6 +120,15 @@ func init() {
osintShortlinksCmd.Flags().BoolP("regexp", "r", false, "Treat keywords as regular expression")
osintShortlinksCmd.Flags().IntP("limit", "l", 100, "Number of results to return")
osintShortlinksCmd.Flags().IntP("start", "t", 0, "Starting offset for pagination")
+
+ osintGeoCmd.Flags().StringP("street", "s", "", "Street address")
+ osintGeoCmd.Flags().StringP("city", "c", "", "City")
+ osintGeoCmd.Flags().StringP("state", "t", "", "State (2-letter code)")
+ osintGeoCmd.Flags().StringP("zip", "z", "", "ZIP code")
+ osintGeoCmd.MarkFlagRequired("street")
+ osintGeoCmd.MarkFlagRequired("city")
+ osintGeoCmd.MarkFlagRequired("state")
+ osintGeoCmd.MarkFlagRequired("zip")
}
func runOsintUsernameCheck(cmd *cobra.Command, args []string) error {
@@ -282,3 +299,26 @@ func runOsintShortlinksSearch(cmd *cobra.Command, args []string) error {
return utils.PrintJSON(response)
}
+
+func runOsintGeoSearch(cmd *cobra.Command, args []string) error {
+ apiKey, _ := cmd.Flags().GetString("api-key")
+ cfg := config.New().WithAPIKey(apiKey)
+
+ c, err := client.New(cfg)
+ if err != nil {
+ return err
+ }
+
+ params := &models.GeoSearchParams{}
+ params.Street, _ = cmd.Flags().GetString("street")
+ params.City, _ = cmd.Flags().GetString("city")
+ params.State, _ = cmd.Flags().GetString("state")
+ params.Zip, _ = cmd.Flags().GetString("zip")
+
+ response, err := c.SearchGeo(params)
+ if err != nil {
+ return err
+ }
+
+ return utils.PrintJSON(response)
+}