A robust API that converts images into structured, actionable data. By pairing the visual search power of Google Lens with the Wikipedia encyclopedia, this tool identifies objects and provides instant cultural or technical context.
- Visual Identification: Extracts the most relevant visual matches.
- Semantic Enrichment: Automatic summaries via the Wikipedia-API.
- Performance: High-performance asynchronous backend powered by FastAPI.
- Strict Validation: Uses Pydantic to ensure the integrity of inputs and outputs.
- Backend: FastAPI (Python 3.10+)
- Automation: Selenium (Chrome Headless)
- Parsing: BeautifulSoup4 & LXML
- Enrichment: Wikipedia-API
git clone https://github.com/your-username/image-to-info-api.git
cd image-to-info-api
python -m venv venv
source venv/bin/activate # venv\Scripts\activate on Windows
pip install -r requirements.txt
Ensure you have chromedriver installed and that it matches your current version of Chrome.
uvicorn main:app --host 0.0.0.0 --port 8000 --reloadAnalyzes a remote image and returns the results.
Request Body:
{
"img_url": "https://url-to-your-image.jpg",
"max_result": 3
}
Sample Response:
{
"success": true,
"data": {
"knowledgeGraph": {
"title": "Xbox Series S",
"description": "The Xbox Series S is a video game console developed by Microsoft...",
"url": "https://en.wikipedia.org/wiki/Xbox_Series_X_and_Series_S"
},
"visualMatches": [
{
"title": "Microsoft Xbox Series S",
"source": "Store Name",
"link": "https://example.com/product",
"thumbnail": "data:image/jpeg;base64..."
}
]
}
}