CropHist

How to Use the CropHist API for Agricultural Analysis

Published March 2026 · CropHist Team

The CropHist API gives you programmatic access to 17 years of crop history for 29 million US agricultural fields. Whether you are building a precision agriculture platform, conducting academic research, or analyzing land use trends, the API lets you query field-level crop data from 2008 to 2024 with simple REST calls. This guide walks you through everything you need to get started.

Getting Started

You can start making API calls immediately without signing up. The CropHist API offers a free demo mode that allows 25 requests per day with no authentication required — just call the endpoints directly.

For higher volume usage, sign up at crophist.com to get an API key. Three tiers are available:

Your API key is passed via the Authorization header:

Authorization: Bearer YOUR_API_KEY

Your First API Call

The simplest way to use CropHist is to look up a field by its geographic coordinates. Given a latitude and longitude anywhere in the contiguous US, the API returns the field that contains that point along with its full crop history.

curl "https://api.crophist.com/v1/field?lat=41.88&lng=-93.52" \
  -H "Authorization: Bearer YOUR_API_KEY"

The response includes the field ID, its area, and the crop planted each year from 2008 through 2024:

{
  "field_id": "0a1b2c3d4e5f",
  "area_ha": 64.3,
  "state": "IA",
  "history": {
    "2024": "Corn",
    "2023": "Soybeans",
    "2022": "Corn",
    "2021": "Soybeans",
    "2020": "Corn",
    ...
  },
  "rotation": "simple"
}

You can also look up a field directly by its CropHist field ID:

curl "https://api.crophist.com/v1/field/0a1b2c3d4e5f" \
  -H "Authorization: Bearer YOUR_API_KEY"

Batch Lookups

If you need crop history for many fields at once, the batch endpoint accepts up to 100 field IDs in a single request. This is available on the Pro tier and above.

curl -X POST "https://api.crophist.com/v1/fields" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"field_ids": ["0a1b2c3d4e5f", "1b2c3d4e5f6a", "2c3d4e5f6a7b"]}'

The response returns an array of field objects, each with the same structure as a single lookup. Fields that are not found return a null entry, so you can easily identify missing IDs.

Python Example

Here is a complete Python example that finds a field by coordinates and prints its crop history:

import requests

API_KEY = "your_api_key_here"
BASE = "https://api.crophist.com/v1"

# Look up a field in central Iowa
resp = requests.get(
    f"{BASE}/field",
    params={"lat": 42.03, "lng": -93.47},
    headers={"Authorization": f"Bearer {API_KEY}"}
)
field = resp.json()

print(f"Field: {field['field_id']} ({field['area_ha']:.1f} ha)")
print(f"Rotation type: {field['rotation']}")
for year, crop in sorted(field["history"].items(), reverse=True):
    print(f"  {year}: {crop}")

JavaScript Example

The same lookup in JavaScript using fetch:

const API_KEY = "your_api_key_here";
const BASE = "https://api.crophist.com/v1";

const resp = await fetch(
  `${BASE}/field?lat=42.03&lng=-93.47`,
  { headers: { "Authorization": `Bearer ${API_KEY}` } }
);
const field = await resp.json();

console.log(`Field: ${field.field_id} (${field.area_ha} ha)`);
Object.entries(field.history)
  .sort(([a], [b]) => b - a)
  .forEach(([year, crop]) => console.log(`  ${year}: ${crop}`));

Regional Statistics

The /v1/stats endpoint returns aggregated crop statistics for a geographic bounding box. This is useful for understanding crop distribution at the county, state, or regional level without querying individual fields.

curl "https://api.crophist.com/v1/stats?bbox=-94,41,-92,43&year=2024"

The response includes the total field count within the bounding box and a breakdown of acreage by crop type, sorted by prevalence. This endpoint is available in demo mode with the same 25 requests/day limit.

Using CropHist with Claude (MCP)

CropHist also provides an MCP server that integrates directly with Claude and other AI assistants. Install it with:

npx -y crophist-mcp

Once configured, you can ask Claude questions like "What crops were grown on the field at 42.03, -93.47?" or "Compare crop rotation patterns in Iowa vs. North Dakota" and Claude will query the CropHist API automatically. The MCP server provides 9 tools including field lookup, spatial search, crop statistics, batch queries, and polygon analysis.

Rate Limits and Usage Tracking

Every authenticated API response includes rate-limit headers so you can monitor your usage:

You can also check your usage programmatically with the /v1/usage endpoint:

curl "https://api.crophist.com/v1/usage" \
  -H "Authorization: Bearer YOUR_API_KEY"

If you exceed your daily limit, requests return a 429 Too Many Requests response. Limits reset at midnight UTC.

What Can You Build?

The CropHist API powers a range of agricultural applications:

For full endpoint documentation, example responses, and integration guides, visit the API documentation page.

Explore on Map Get API Access