IdentiFile is a REST API for identifying file types based on their content using Google Magika AI or standard file header detection. Files are submitted as multipart/form-data.
- Standard Identification: Identifies files based on their content type headers
- AI-Powered Identification: Uses Google's Magika AI for more accurate file type detection
- Simple REST API: Easy to integrate with any application
- Docker Support: Run as a containerized service
Endpoint | Method | Description |
---|---|---|
/version |
GET | Get API version information |
/identify |
POST | Identify file using standard header detection |
/ai_identify |
POST | Identify file using Google Magika AI |
# Build the Docker image
make docker-build
# Run the Docker container
make docker-start
The API will be available at http://localhost:8079
- Python 3.9+
- Make
-
Clone the repository
git clone https://github.com/yourusername/identifile.git cd identifile
-
Create and activate a virtual environment
python -m venv env source ./env/bin/activate # On Windows: .\env\Scripts\activate
-
Install dependencies
make pip-upgrade make pip-install
-
Start the development server
make dev
The API will be available at http://localhost:8080
curl -X POST -F "file=@/path/to/your/file.jpg" http://localhost:8080/identify
curl -X POST -F "file=@/path/to/your/file.jpg" http://localhost:8080/ai_identify
{
"method": "ai_identify",
"mime": "image/jpeg",
"score": 0.99,
"description": "JPEG image",
"label": "jpeg",
"group": "image",
"size": 12345,
"filename": "example.jpg"
}
- Google Magika AI - AI-powered file type detection
- FastAPI - Fast web framework for building APIs
- Python - Programming language
- Docker - Containerization platform
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.