{"id":28172814,"url":"https://github.com/aboodseada1/ceo-finder","last_synced_at":"2025-07-15T03:41:13.209Z","repository":{"id":289829978,"uuid":"972539427","full_name":"Aboodseada1/CEO-Finder","owner":"Aboodseada1","description":"Standalone CLI tool to find company CEO names using SearXNG web search and LLM analysis (Gemini, OpenAI, Groq, Ollama).","archived":false,"fork":false,"pushed_at":"2025-04-25T08:46:49.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-15T20:11:39.007Z","etag":null,"topics":["ai","ceo-finder","lead","leadgeneration","leads","python","scraping","searx","searxng","web-scraping","websites"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aboodseada1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-25T08:41:49.000Z","updated_at":"2025-04-29T03:50:21.000Z","dependencies_parsed_at":"2025-04-25T09:44:15.259Z","dependency_job_id":"9c0d8336-efd4-489c-918a-d3b835f8c43a","html_url":"https://github.com/Aboodseada1/CEO-Finder","commit_stats":null,"previous_names":["aboodseada1/ceo-finder"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Aboodseada1/CEO-Finder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aboodseada1%2FCEO-Finder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aboodseada1%2FCEO-Finder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aboodseada1%2FCEO-Finder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aboodseada1%2FCEO-Finder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aboodseada1","download_url":"https://codeload.github.com/Aboodseada1/CEO-Finder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aboodseada1%2FCEO-Finder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265398377,"owners_count":23758471,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ceo-finder","lead","leadgeneration","leads","python","scraping","searx","searxng","web-scraping","websites"],"created_at":"2025-05-15T20:11:10.475Z","updated_at":"2025-07-15T03:41:13.190Z","avatar_url":"https://github.com/Aboodseada1.png","language":"Python","funding_links":["http://paypal.me/aboodseada1999"],"categories":[],"sub_categories":[],"readme":"# Standalone Company CEO Finder\r\n\r\nA Python script to find the CEO or other key executive of a company using its name or domain. It leverages a SearXNG instance for web searching and various Large Language Model (LLM) providers for analyzing the search results.\r\n\r\n## Features\r\n\r\n* Finds CEO/President/Founder/Owner names based on public web data.\r\n* Accepts company name or company domain/URL as input.\r\n* Integrates with a SearXNG instance for privacy-respecting web searches.\r\n* Supports multiple LLM providers:\r\n  * Google Gemini (`gemini`)\r\n  * OpenAI (`openai`)\r\n  * Groq (`groq`)\r\n  * Local Ollama (`ollama`)\r\n* Allows specifying the *exact* LLM model via command-line (`--llm-model`).\r\n* Uses provider-specific fallback model lists if no exact model is specified.\r\n* Standalone script design (dependencies are external libraries).\r\n* Configurable logging level for debugging.\r\n* Outputs results in JSON format.\r\n\r\n## Prerequisites\r\n\r\n1. **Python:** Python 3.7+ is recommended.\r\n2. **Pip:** Python package installer.\r\n3. **SearXNG Instance:** You need access to a running SearXNG instance. This could be self-hosted or a public instance (use public instances responsibly). Note the base URL of the instance (e.g., `http://127.0.0.1:8080`).\r\n4. **LLM API Keys (Conditional):**\r\n   * If using `gemini`, `openai`, or `groq`, you need valid API keys for those services.\r\n5. **Ollama (Conditional):**\r\n   * If using the `ollama` provider, you need Ollama installed, running, and the desired model(s) pulled (e.g., `ollama run llama3:8b`). See [Ollama GitHub](https://github.com/ollama/ollama).\r\n\r\n## Installation\r\n\r\n1. **Clone the repository or download the script:**\r\n2. ```bash\r\n   git clone https://github.com/Aboodseada1/CEO-Finder\r\n   cd https://github.com/Aboodseada1/CEO-Finder\r\n   ```\r\n3. Or simply download the `standalone_ceo_finder.py` file.\r\n4. **Install required Python packages:**\r\n5. * **Core dependency:**\r\n   * ```bash\r\n     pip install requests\r\n     ```\r\n   * **Install based on the LLM provider(s) you plan to use:**\r\n   * ```bash\r\n     # For Gemini\r\n     pip install google-generativeai\r\n\r\n     # For OpenAI or Groq (Groq uses OpenAI's client library structure)\r\n     pip install openai\r\n     ```\r\n   * **Or install all potential LLM libraries:**\r\n   * ```bash\r\n     pip install requests google-generativeai openai\r\n     ```\r\n   * *(Optional but recommended)* Create and use a Python virtual environment:\r\n   * ```bash\r\n     python -m venv venv\r\n     source venv/bin/activate # On Windows use `venv\\Scripts\\activate`\r\n     pip install -r requirements.txt # If a requirements.txt file is provided\r\n     # Or install manually as shown above\r\n     ```\r\n\r\n## Usage\r\n\r\nThe script is run from the command line.\r\n\r\n```bash\r\npython standalone_ceo_finder.py \u003ccompany_input\u003e --searx-url \u003csearx_instance_url\u003e --llm-provider \u003cprovider_name\u003e [options]\r\n```\r\n\r\n**Arguments:**\r\n\r\n* `company_input`: (Required) The company name (e.g., `\"Apple Inc.\"` ) or domain/URL (e.g., `google.com`). Wrap names with spaces in quotes.\r\n* `--searx-url`: (Required) The base URL of your running SearXNG instance (e.g., `http://127.0.0.1:8080`, `https://searx.example.org`).\r\n* `--llm-provider`: (Required) The LLM provider to use. Choices: `gemini`, `openai`, `groq`, `ollama`.\r\n* `--llm-model`: (Optional) Specify the exact LLM model name to use (e.g., `gpt-4o-mini`, `gemini-1.5-flash`, `llama3-70b-8192`, `phi3:latest`). If omitted, the script uses the provider's internal fallback list.\r\n* `--llm-api-key`: (Optional) The API key for the chosen LLM provider. **Required** if `--llm-provider` is `gemini`, `openai`, or `groq`. Not used for `ollama`.\r\n* `--log-level`: (Optional) Set the logging level. Choices: `DEBUG`, `INFO`, `WARNING`, `ERROR`. Default is `INFO`.\r\n\r\n## Examples\r\n\r\n*(Replace placeholders like `http://localhost:8080`, `YOUR_API_KEY`, and company names)*\r\n\r\n### Using OpenAI with specific model:\r\n\r\n```bash\r\npython standalone_ceo_finder.py \"Nvidia\" \\\r\n    --searx-url \"http://localhost:8080\" \\\r\n    --llm-provider openai \\\r\n    --llm-model \"gpt-4o-mini\" \\\r\n    --llm-api-key \"YOUR_OPENAI_API_KEY\"\r\n```\r\n\r\n### Using OpenAI with provider fallback:\r\n\r\n```bash\r\npython standalone_ceo_finder.py \"Microsoft\" \\\r\n    --searx-url \"http://localhost:8080\" \\\r\n    --llm-provider openai \\\r\n    --llm-api-key \"YOUR_OPENAI_API_KEY\"\r\n```\r\n\r\n### Using Gemini with specific model:\r\n\r\n```bash\r\npython standalone_ceo_finder.py \"Alphabet Inc.\" \\\r\n    --searx-url \"https://searx.example.org\" \\\r\n    --llm-provider gemini \\\r\n    --llm-model \"gemini-1.5-flash\" \\\r\n    --llm-api-key \"YOUR_GEMINI_API_KEY\"\r\n```\r\n\r\n### Using Groq with specific model:\r\n\r\n```bash\r\npython standalone_ceo_finder.py \"Meta Platforms\" \\\r\n    --searx-url \"http://localhost:8080\" \\\r\n    --llm-provider groq \\\r\n    --llm-model \"llama3-8b-8192\" \\\r\n    --llm-api-key \"YOUR_GROQ_API_KEY\"\r\n```\r\n\r\n### Using Ollama with specific local model (ensure 'phi3' is pulled):\r\n\r\n```bash\r\npython standalone_ceo_finder.py \"Hugging Face\" \\\r\n    --searx-url \"http://localhost:8080\" \\\r\n    --llm-provider ollama \\\r\n    --llm-model \"phi3\"\r\n```\r\n\r\n### Using Ollama with default model (llama3:8b):\r\n\r\n```bash\r\npython standalone_ceo_finder.py \"GitHub\" \\\r\n    --searx-url \"http://localhost:8080\" \\\r\n    --llm-provider ollama\r\n```\r\n\r\n### Using a domain as input and debug logging:\r\n\r\n```bash\r\npython standalone_ceo_finder.py \"openai.com\" \\\r\n    --searx-url \"http://localhost:8080\" \\\r\n    --llm-provider openai \\\r\n    --llm-api-key \"YOUR_OPENAI_API_KEY\" \\\r\n    --log-level DEBUG\r\n```\r\n\r\n## How It Works\r\n\r\n1. **Input Processing:** The script takes the company name or domain. If a domain/URL is detected, it attempts to sanitize it and extract a potential company name.\r\n2. **Query Generation:** It generates several search queries tailored to finding CEO/executive information (e.g., `\"Who is the CEO of \u003cCompany\u003e\"`).\r\n3. **SearXNG Search:** For each query, it sends a request to the specified SearXNG instance to fetch web search results.\r\n4. **LLM Prompting:** It compiles the titles, URLs, and snippets from the search results into a detailed prompt for the LLM, asking it to analyze the information and identify the most likely CEO/executive, prioritizing roles (CEO \u003e President \u003e Founder \u003e Owner) and consistency.\r\n5. **LLM Interaction:** It sends the prompt to the specified LLM provider, using either the specific model requested via `--llm-model` or iterating through the provider's fallback list until a successful response is received.\r\n6. **Response Parsing:** It attempts to parse the LLM's response, specifically looking for a JSON object containing the `ceo_name` key (which can be the name or `null`).\r\n7. **Output:** It prints the final result as a JSON string containing the found `ceo_name` (or `null` if not found) and the `source_model` that provided the answer.\r\n\r\n## Configuration (Internal)\r\n\r\nWhile the primary configuration is done via command-line arguments, the script contains internal fallback lists for models if the `--llm-model` argument is *not* used:\r\n\r\n* `GEMINI_MODEL_FALLBACK`\r\n* `OPENAI_MODEL_FALLBACK`\r\n* `GROQ_MODEL_FALLBACK`\r\n* `OLLAMA_DEFAULT_MODEL`\r\n\r\nYou can modify these lists directly within the `standalone_ceo_finder.py` script if you want to change the default models or their fallback order for different providers when not specifying a model explicitly.\r\n\r\n## Dependencies\r\n\r\n* `requests`\r\n* `google-generativeai` (Optional, needed for `gemini` provider)\r\n* `openai` (Optional, needed for `openai` and `groq` providers)\r\n\r\n## Contributing\r\n\r\nContributions are welcome! Please feel free to open an issue or submit a pull request on [GitHub](https://github.com/Aboodseada1?tab=repositories).\r\n\r\n## Support Me\r\n\r\nIf you find this tool useful, consider supporting its development via [PayPal](http://paypal.me/aboodseada1999). Thank you!\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License.\r\n\r\n```\r\nMIT License\r\n\r\nCopyright (c) 2025 Abood\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in all\r\ncopies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\r\nSOFTWARE.\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faboodseada1%2Fceo-finder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faboodseada1%2Fceo-finder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faboodseada1%2Fceo-finder/lists"}