A Python script that fetches and saves detailed brand information using the Brandfetch API, including logos, colors, fonts, and company details.
📋 Requirements •
🚀 Usage •
📜 Script •
Here's a workflow diagram of how the Brand Search application works:
graph TD
A[Start] --> B[Load Environment Variables]
B --> C[Get Domain from Command Line]
C --> D[Fetch Brand Data]
D --> E{API Key Exists?}
E -->|No| F[Show Error]
E -->|Yes| G[Make API Request]
G --> H{Response Success?}
H -->|Yes| I[Parse JSON Data]
I --> J[Save to Output File]
H -->|No| K[Show Error Message]
J --> L[End]
K --> L
F --> L
- Python 3.6+
- requests
- python-dotenv
- Valid Brandfetch API key
- Create a
.env
file with your Brandfetch API key:
BRANDFETCH_API_KEY=your_api_key_here
- Run the script with a domain:
python brand_fetch.py example.com
The script performs the following operations:
- Loads environment variables from
.env
file - Takes a domain name as command line argument
- Fetches brand data from Brandfetch API
- Saves the response to a JSON file in the output directory
This script requires a valid Brandfetch API key to function. Please ensure you have the necessary API access before using the script.