This FastAPI-based API provides company information lookup services. It offers two endpoints for retrieving company details based on a company name.
- Retrieve comprehensive company information including social media links, contact details, and business analysis.
- Get primary company information for quick lookups.
- Uses AI-powered tools for web scraping and analysis.
- Integrates with NAICS (North American Industry Classification System) for industry classification.
- Python 3.7+
- FastAPI
- Pydantic
- python-dotenv
- LangChain
- OpenAI's GPT models
- Google Custom Search API
-
Clone the repository:
git clone https://github.com/MoativeAI/LookupAPI.git
-
Install the required packages:
pip install -r requirements.txt
-
Set up environment variables: Create a
.env
file in the root directory and add the following:GOOGLE_API_KEY=<your-google-api-key> GOOGLE_CSE_ID=<your-google-custom-search-engine-id> OPENAI_API_KEY=<your-openai-api-key>
To begin, run docloader.py to generate the vector database for the RAG module.
To run the API:
uvicorn main:app --host 0.0.0.0 --port 8001
The API will be available at http://localhost:8001
.
-
Comprehensive Company Lookup:
GET /lookup/company/{company_name}
This endpoint provides detailed information about a company.
-
Primary Company Lookup:
GET /lookup/company/primary/{company_name}
This endpoint provides basic information about a company for quick lookups.
- Company_URL: str
- Company_LinkedIn_URL: str
- Company_Facebook_URL: str
- Company_Twitter_URL: str
- Company_Phone: str
- Company_Address: str
- Meta_Description: str
- Overview: str
- USP: str
- Target_Audience: str
- Conclusion: str
- NAICS_Code: str
- Title: str
- Description: str
- Common_Labels: str
- execution_time: float
- Company_URL: str
- Meta_Description: str
- Overview: str
- Industry_Type: str
- execution_time: float
- The API uses OpenAI's GPT models for analysis. Ensure you have sufficient API credits.
- Google Custom Search API is used for URL retrieval. Make sure you're within the usage limits.
- NAICS classification is done using a custom RAG (Retrieval-Augmented Generation) system.