Identify 50 crop varieties from images using AI. Get your free API key in seconds โ no approval needed.
Enter your name and email โ your unique key is generated instantly.
Copy the code for your language and replace YOUR_API_KEY.
// Full analysis (crop name, quality, characteristics, explanation) const formData = new FormData(); formData.append("file", imageFile); // File from <input type="file"> const response = await fetch("https://vdx-0-crop-classifier-api.hf.space/predict", { method: "POST", headers: { "x-api-key": "YOUR_API_KEY" }, body: formData }); const data = await response.json(); // Use final_answer โ has everything you need console.log(data.final_answer.crop_name); // "Wheat" console.log(data.final_answer.quality); // "Excellent" console.log(data.final_answer.characteristics); // "Golden stalks..." console.log(data.final_answer.explanation); // "Full description..."
import requests with open("crop.jpg", "rb") as f: response = requests.post( "https://vdx-0-crop-classifier-api.hf.space/predict", headers={"x-api-key": "YOUR_API_KEY"}, files={"file": f} ) data = response.json() answer = data["final_answer"] print(answer["crop_name"]) # Wheat print(answer["quality"]) # Excellent print(answer["characteristics"]) # Golden stalks... print(answer["explanation"]) # Full description...
curl -X POST "https://vdx-0-crop-classifier-api.hf.space/predict" \ -H "x-api-key: YOUR_API_KEY" \ -F "file=@/path/to/crop.jpg"
Base URL: https://vdx-0-crop-classifier-api.hf.space
| Endpoint | Description |
|---|---|
| POST /predict | Full analysis โ model + LLaMA AI expert (~10s) |
| POST /predict/fast | Model only โ instant response (<500ms) |
| POST /register | Generate a new API key |
| GET /crops | List all 50 supported crop varieties |
| GET /docs | Interactive Swagger API documentation |