Python Β· Open Source Β· PyPI

Brazilian agricultural data in one line of code

CEPEA, CONAB, IBGE, NASA POWER, USDA, B3 and 34 more β€” 40 sources behind one unified API with automatic fallback, smart caching and versioned contracts.

$ pip install agrobr ⎘
soybeanR$ 131.07β–Ό 0.90% cornR$ 62.99β–Ό 0.10% live cattleR$ 348.80β–Ό 0.19% coffeeR$ 1,505.10β–² 2.10% wheatR$ 1,376.72β–² 0.54% cottonR$ 413.70β–Ό 0.33% CEPEA indicators Β· Jun 17, 2026 Β· fetched via agrobr
40sources
36datasets
6,400+passing tests
92%coverage
MITlicense

Nobody typed this number.

The panel beside this text is not a mockup: CEPEA publishes, agrobr fetches, this page updates β€” every trading day, with automatic fallback, DuckDB cache and a validated contract.

from agrobr import datasets df = await datasets.preco_diario("soja") # 10 trading days Β· CEPEA β†’ NotΓ­cias AgrΓ­colas β†’ cache
R$ 131.07 / 60kg bag
soybean Β· CEPEA/ESALQ indicator Β· Jun 17, 2026
2026-06-12129.85
2026-06-15129.24
2026-06-16132.26
2026-06-17131.07
CEPEA
βœ— 403 Forbidden
Not. AgrΓ­colas
βœ“ 200 OK
contract v1.0
βœ“ valid schema
DataFrame
β—ˆ delivered

Ask for the data.
The source is an internal detail.

Datasets abstract multiple sources with automatic fallback. When CEPEA returns a 403, agrobr fetches NotΓ­cias AgrΓ­colas. When the server goes down, it serves from cache.

preco_diario
Spot prices for 20 agricultural commodities
CEPEA β†’ NA β†’ cache
estimativa_safra
Current crop season estimates
CONAB β†’ IBGE LSPA
credito_rural
Rural credit by crop, program, insurance and modality
BCB/SICOR β†’ BigQuery
clima
Monthly climate by state or daily by station
INMET β†’ NASA POWER
futuros_agricolas
B3 futures: settlements, history and open interest
B3
desmatamento
Consolidated PRODES deforestation + DETER alerts
INPE TerraBrasilis
exportacao
Agricultural exports by NCM code
ComexStat β†’ ABIOVE
seguro_rural
Rural insurance policies and claims
MAPA PSR
explore all 36 datasets in the docs β†’

Built for production,
not for demos.

⟳

Cascading Fallback

Primary source fails β†’ tries the secondary β†’ serves from cache. Transparent.

⛁

Cache DuckDB

Local cache for CEPEA indicators (smart TTL, expires 6pm). Optional snapshots for reproducibility.

β—ˆ

Versioned Contracts

Guaranteed schema per dataset. Breaking changes only on majors. Semver.

β†―

Async-first

Native httpx with a sync wrapper. Works in Jupyter, FastAPI and Airflow.

βœ“

Pydantic v2 Validation

Typed models. Statistical sanity checks. Layout fingerprinting.

β—Ž

Deterministic Mode

Full reproducibility via contextvars. For papers and audits.

40 origins. One API.

Every source has its own parser with versioning, fingerprinting and encoding handling. All you see is the DataFrame.

the real brazil, in dots β€” official ibge mesh
CEPEA/ESALQ CONAB IBGE/SIDRA BCB/SICOR NASA POWER B3 ComexStat USDA SICAR MapBiomas INPE Queimadas TerraBrasilis ZARC ANTAQ UN Comtrade CFTC ANDA ABIOVE ANEC UNICA IMEA DERAL INMET NotΓ­cias AgrΓ­colas ANP Diesel MAPA PSR ANTT PedΓ‘gio Agrofit/MAPA FUNAI ICMBio INCRA Acervo FundiΓ‘rio IBAMA MapBiomas Alerta Lista Suja ANA/SNIRH SFB RNC/CultivarWeb EMBRAPA Solos Rio Verde

in amber: non-commercial or restricted license β€” details at docs/licenses

pip install agrobr

MIT License (code). 6,400+ passing tests. 40 sources. 36 datasets.