API Documentation

Build on top of IndiTrace's transparent agricultural supply chain platform.

Overview

The IndiTrace API enables developers to integrate agricultural supply chain management, batch tracking, and blockchain verification into their applications.

Our REST API uses standard HTTP methods and returns JSON responses. All endpoints require authentication via API key.

Authentication

All API requests require a Bearer token. Include your API key in the Authorization header of each request.

Authorization: Bearer YOUR_API_KEY

Code Examples

Farmers API

// List all farmers
GET /api/v1/farmers
Authorization: Bearer YOUR_API_KEY

// Response
{
  "data": [
    {
      "id": "farmer_123",
      "name": "Ramesh Kumar",
      "location": "Punjab, India",
      "crops": ["wheat", "rice"]
    }
  ]
}

Batches API

// Create a new batch
POST /api/v1/batches
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

{
  "farmer_id": "farmer_123",
  "product": "Basmati Rice",
  "quantity": 500,
  "harvest_date": "2026-03-15"
}

// Response includes blockchain transaction hash
{
  "id": "batch_456",
  "status": "verified",
  "blockchain_tx": "0xabc123..."
}

Blockchain Verification

// Verify batch on blockchain
GET /api/v1/batches/batch_456/verify

// Response
{
  "verified": true,
  "blockchain": "Polygon",
  "transaction_hash": "0xabc123...",
  "timestamp": "2026-03-15T10:30:00Z"
}

Rate Limits

API requests are limited to 100 requests per minute per API key. If you need higher limits for your use case, please contact our support team.

Ready to Build?

Get your API key and start integrating with IndiTrace.