usda_esr_get_exports
Retrieve weekly and accumulated US export sales for a specified commodity and market year, for one destination country or all countries, with an optional week-ending filter.
Instructions
US weekly export sales of one commodity in one market year, to one country or to all.
One record per destination and week: weekly and accumulated exports, outstanding and
gross new sales, current and next market year net sales and commitments, in the unit
unit_id names (list_units_of_measure). From the current calendar year on, the
release list is read first, and a market year ESR has not released raises
NotFoundError naming the commodity's current one, since ESR answers it as a year
without exports; an empty list means no exports. A market year ESR holds no data for (1900)
answers the empty list with a note. One call sends at most 2 requests, 8 attempts with
retries. Where the list is read and names market_year as current, meta.vintage is
its release time as ESR prints it and meta.published_at that time without a zone;
otherwise both stay empty, since the rows state no release and the list's time may be
another market year's.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"commodity_code": "<commodity_code>",
"market_year": "<market_year>"
},
"name": "usda_esr_get_exports"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| offset | No | Rows of the answer already shown, counted from its last row: the note of a cut answer names the next offset, which reaches older rows. 0, the default, starts at the last row. | |
| market_year | Yes | ESR market year, named by its end year, e.g. ``2024`` (for wheat June 2023 to May 2024, for corn and soybeans September to August, for cotton August to July); four digits and no later than the current year plus two, both checked before any request, and no later than the commodity's current market year, which ``get_release_dates`` names: in October 2026 wheat's is 2027, and 2028 is refused after one request. | |
| country_code | No | ESR destination country code (not ISO), an integer, e.g. ``1220`` (Canada), ``2010`` (Mexico), ``5880`` (Japan); ``9990`` (UNKNOWN) is a destination like any other, and one the packaged list lacks is refused before any request, naming the closest codes. Omit it (``None``) for every country: one record per destination and week, over 1,000 rows for some commodities, where one country is up to 54. | |
| commodity_code | Yes | ESR commodity code, an integer, e.g. ``104`` (Wheat - White), ``101`` (Wheat - HRW), ``401`` (Corn), ``801`` (Soybeans), ``1404`` (All Upland Cotton); one the packaged list lacks is refused before any request, naming the closest codes. | |
| week_ending_date | No | Keep only the rows of the week ending on this date, ESR's ``weekEndingDate``, e.g. ``2024-08-01`` (cottonseed 2024: 11 rows, one per destination). Compared by equality after the one request, since ESR takes no week; a date that ends no week of an answer with rows is refused after it with ``InvalidRequestError``, naming the nearest week ending dates, and a date whole weeks after the newest week of the commodity's current market year, where the call reads the release list, up to the week that holds the market year's last day, with ``NotFoundError``, naming the newest week; any other date after the newest week, on another weekday or past that last week, is refused with ``InvalidRequestError`` too. An answer without rows stays empty. Omit it (``None``) for every week. |