state_agricultural_trade
Get ERS state agricultural trade - state-level U.S. agricultural exports by commodity and by state on a calendar-year basis, and the top export and import commodities by state on a fiscal-year basis, each pivoted to a wide layout with the years in the rows.
Examples
from openbb import obb
obb.usda.state_agricultural_trade(provider='usda')
# Get California's agricultural exports by commodity.
obb.usda.state_agricultural_trade(table='exports_by_commodity', state='California', provider='usda')
# Get total agricultural exports spread across the states.
obb.usda.state_agricultural_trade(table='exports_by_state', commodity='Total agricultural exports', provider='usda')
# Get Texas's top export commodities by fiscal year.
obb.usda.state_agricultural_trade(table='top_exports', state='Texas', provider='usda')
# Get California's top import commodities by fiscal year.
obb.usda.state_agricultural_trade(table='top_imports', state='California', provider='usda')
Parameters
- standard
- usda
table: str | None
Default: exports_by_commodity
Description
Table to retrieve. 'exports_by_commodity' spreads a state's export commodities across the calendar years; 'exports_by_state' spreads the states across the calendar years for one commodity; 'top_exports' and 'top_imports' spread a state's top fiscal-year commodities across the fiscal years. Valid tables are:
exports_by_commodity, exports_by_state, top_exports, top_imports
state: str | None
Default: California
State whose commodities are spread into columns for the 'exports_by_commodity', 'top_exports', and 'top_imports' tables, as a full state name or two-letter code, or 'United States' for the national total. Ignored by the 'exports_by_state' table. The calendar-year tables cover the 50 states and the United States; the fiscal-year tables also cover the District of Columbia, Puerto Rico, and the Virgin Islands.
commodity: str | None
Default: Total agricultural exports
Description
Commodity whose states are spread into columns for the 'exports_by_state' table. Ignored by the other tables. Valid commodities are:
Total agricultural exports, Total animal products, Total plant products, Beef and veal, Broiler meat, Corn, Cotton, Dairy products, Feeds and other feed grains, Fruits, fresh, Fruits, processed, Grain products, Hides and skins, Other livestock products, Other oilseeds and products, Other plant products, Other poultry products, Pork, Rice, Soybean meal, Soybeans, Tobacco, Tree nuts, Vegetable oils, Vegetables, fresh, Vegetables, processed, Wheat
start_year: int | None
Start year for filtering the data, compared against the calendar or fiscal year. If None, returns from the first published year.
end_year: int | None
End year for filtering the data, compared against the calendar or fiscal year. If None, returns up to the most recent year.
Returns
results: StateAgriculturalTrade
Serializable results.
provider: str | None
Provider name.
warnings: Optional[list[Warning_]]
List of warnings.
chart: Optional[Chart]
Chart object.
extra: dict[str, Any]
Extra info.
Data
- standard
- usda
year: int
Calendar year for the all-data tables, or fiscal year for the top-commodity tables.
state: str | None
State whose commodities the columns spread, for the commodity and top-commodity tables. None for the exports-by-state table.
commodity: str | None
Commodity whose states the columns spread, for the exports-by-state table. None for the other tables.
unit: str | None
Unit shared by every value column: 'Million dollars' for the calendar-year tables, 'Dollars' for the fiscal-year tables.