Quickstart

Make your first API call in under 5 minutes. All you need is an email address.

1

Get a free API key

Sign up at /signup/free — no credit card required. Your key arrives by email in seconds and looks like agr_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.

Or call the signup endpoint directly:

curl -X POST https://r2data2.com/signup/free \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]", "name": "Your Name"}'
import requests

requests.post(
    "https://r2data2.com/signup/free",
    json={"email": "[email protected]", "name": "Your Name"},
)
await fetch("https://r2data2.com/signup/free", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ email: "[email protected]", name: "Your Name" }),
});
2

Fetch drought data for a county

Every request passes your key in the X-API-Key header. Counties are identified by their 5-digit FIPS code (e.g. 17113 = McLean County, IL). Look up any county's FIPS on the Dashboard.

# Replace YOUR_API_KEY with the key from your email.
# 17113 = McLean County, IL (top corn-producing county)

curl https://r2data2.com/drought/county/17113 \
  -H "X-API-Key: YOUR_API_KEY"
import requests

API_KEY = "YOUR_API_KEY"
FIPS    = "17113"  # McLean County, IL

resp = requests.get(
    f"https://r2data2.com/drought/county/{FIPS}",
    headers={"X-API-Key": API_KEY},
)
resp.raise_for_status()
print(resp.json())
const API_KEY = "YOUR_API_KEY";
const FIPS    = "17113"; // McLean County, IL

const resp = await fetch(`https://r2data2.com/drought/county/${FIPS}`, {
  headers: { "X-API-Key": API_KEY },
});
const data = await resp.json();
console.log(data);

The response is a JSON object with a fips field and a records array of weekly drought observations, newest first, covering the last 52 weeks by default.

3

Pull all signals at once with /summary

The summary endpoint returns drought, precipitation, soil moisture, GDD, NDVI, crop yields, and NRI flood risk in a single JSON object. It costs 5 requests against your daily limit.

# All signals for a county in one call (costs 5 requests)

curl https://r2data2.com/county/17113/summary \
  -H "X-API-Key: YOUR_API_KEY"
resp = requests.get(
    "https://r2data2.com/county/17113/summary",
    headers={"X-API-Key": API_KEY},
)
print(resp.json())
const data = await fetch("https://r2data2.com/county/17113/summary", {
  headers: { "X-API-Key": API_KEY },
}).then(r => r.json());
console.log(data);
4

Crop Stress Index (Starter+)

The Crop Stress Index is a composite 0–100 score combining drought, precipitation anomaly, soil moisture, NDVI, and vapor pressure deficit — weighted for the county's dominant crop. Requires a Starter plan or above.

# Crop Stress Index — requires Starter plan or above

curl https://r2data2.com/county/17113/crop-stress-index \
  -H "X-API-Key: YOUR_API_KEY"
resp = requests.get(
    "https://r2data2.com/county/17113/crop-stress-index",
    headers={"X-API-Key": API_KEY},
)
print(resp.json())
const data = await fetch("https://r2data2.com/county/17113/crop-stress-index", {
  headers: { "X-API-Key": API_KEY },
}).then(r => r.json());
console.log(data);
?

Key concepts

FIPS codes

5-digit county identifiers from the US Census Bureau. Zero-pad to 5 digits (e.g. 01001 for Autauga County, AL). Find any county on the Dashboard.

Authentication

Pass your key as an HTTP header: X-API-Key: agr_xxx…. Never expose it in client-side JS or public repos.

Rate limits

Free: 100 req/day. Starter: 2,000. Growth: 15,000. Pro: 50,000. Limits reset at midnight Eastern. Check current usage at /account.

History windows

Free: 1 year. Starter: 5 years. Growth: 10 years. Pro: unlimited. Requests beyond your window return a 403.

Endpoint reference

EndpointDescriptionTierCost
GET /drought/county/{fips} Weekly drought history (USDM) Free 1 / record
GET /precipitation/county/{fips} Daily precipitation (PRISM) Free 1 / record
GET /soil-moisture/county/{fips} Soil moisture (NASA SMAP) Free 1 / record
GET /gdd/county/{fips} Growing degree days Free 1 / record
GET /ndvi/county/{fips} Vegetation index (MODIS NDVI) Free 1 / record
GET /crops/county/{fips} Crop yield history (USDA NASS) Free 1 / record
GET /nri/county/{fips} FEMA Natural Hazard Risk Index Free 1
GET /county/{fips}/summary All signals in one response Free 5
GET /county/{fips}/crop-stress-index Composite Crop Stress Index (0–100) Starter 1
POST /portfolio/summary Batch summary for up to 500 counties Growth 5 / county
GET /rma/county/{fips} RMA crop insurance loss history Free 1 / record

Full parameter details and response schemas are in the interactive API reference.

Get your free API key API reference Data dictionary Contact us