API Reference
v2.0
Integrate AgriCrave's powerful agricultural AI into your applications with our RESTful API.
Introduction
The AgriCrave API provides programmatic access to our agricultural AI platform. Use it to integrate crop monitoring, weather predictions, and market insights into your own applications.
Base URL
https://api.agricrave.site/v2Fast
Average response time under 100ms
Secure
TLS encryption and OAuth 2.0
RESTful
Standard HTTP methods and JSON responses
Authentication
All API requests require authentication using an API key. Include your key in the Authorization header.
Request Header
curl -X GET "https://api.agricrave.site/v2/farms" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Getting Your API Key
- 1Log in to your AgriCrave dashboard
- 2Navigate to Settings → API Keys
- 3Click "Generate New Key"
- 4Copy and securely store your key
Rate Limiting
API requests are rate limited to ensure fair usage and platform stability.
| Plan | Requests/Hour | Requests/Day |
|---|---|---|
| Free | 100 | 1,000 |
| Pro | 1,000 | 10,000 |
| Enterprise | Unlimited | Unlimited |
Farms
Manage farm data including boundaries, crops, and monitoring settings.
List All Farms
GET /v2/farms
# Response
{
"data": [
{
"id": "farm_abc123",
"name": "Olu's Cassava Farm",
"location": {
"lat": 7.3775,
"lng": 3.9470
},
"size_hectares": 5.2,
"crops": ["cassava", "maize"],
"created_at": "2024-01-15T10:30:00Z"
}
],
"meta": {
"total": 1,
"page": 1
}
}Create a Farm
POST /v2/farms
# Request Body
{
"name": "New Farm",
"location": {
"lat": 7.3775,
"lng": 3.9470
},
"size_hectares": 10,
"crops": ["rice", "vegetables"]
}
# Response
{
"data": {
"id": "farm_xyz789",
"name": "New Farm",
...
}
}Weather
Get hyperlocal weather forecasts and alerts for your farm locations.
Get Weather Forecast
GET /v2/weather/farm_abc123
# Response
{
"data": {
"farm_id": "farm_abc123",
"current": {
"temp_c": 28,
"humidity": 75,
"conditions": "partly_cloudy"
},
"forecast": [
{
"date": "2024-01-20",
"high_c": 32,
"low_c": 24,
"rain_probability": 0.3,
"conditions": "rain_likely"
}
],
"alerts": [
{
"type": "heavy_rain",
"severity": "moderate",
"message": "Heavy rain expected in 48 hours"
}
]
}
}JavaScript SDK
Install our JavaScript SDK to quickly integrate AgriCrave into your Node.js or browser applications.
Installation
npm install @agricrave/sdkUsage Example
import { AgriCrave } from '@agricrave/sdk';
const client = new AgriCrave({
apiKey: process.env.AGRICRAVE_API_KEY
});
// Get all farms
const farms = await client.farms.list();
// Get weather for a farm
const weather = await client.weather.get('farm_abc123');
// Get yield prediction
const prediction = await client.predictions.yield('farm_abc123');API Explorer
Test API endpoints directly in your browser.
Response will appear here...