Inventory

Inventory listings are grain lots offered on MyGrainExchange. The API returns them fully anonymized — you never see the seller, farm name, or exact coordinates. Location is coarsened to province + nearest city.

The inventory model

  • Name
    id
    Type
    string
    Description
    Opaque listing id, e.g. inv_3Kd9aZ.
  • Name
    commodity
    Type
    object
    Description
    slug, name , e.g. "slug": "wheat", "name": "Wheat" .
  • Name
    variety
    Type
    string
    Description
    Variety, if specified.
  • Name
    grade
    Type
    string
    Description
    Grade code, e.g. 1CWRS.
  • Name
    is_organic
    Type
    boolean
    Description
    Organic certified.
  • Name
    crop_year
    Type
    integer
    Description
    Crop year.
  • Name
    quantity_mt
    Type
    number
    Description
    Quantity in metric tonnes.
  • Name
    asking_price
    Type
    object
    Description
    amount, currency, unit, firm — always per MT, CAD.
  • Name
    quality
    Type
    object
    Description
    Non-identifying quality claims (protein, moisture, …).
  • Name
    location
    Type
    object
    Description
    province, nearest_city — never exact coordinates.
  • Name
    listed_at
    Type
    string
    Description
    When the lot was listed.

GET/v1/inventory

List inventory

Returns a paginated list of anonymized listings. Requires the inventory.read scope.

Optional query parameters

  • Name
    commodity
    Type
    string
    Description
    Commodity slug(s), comma-separated, e.g. wheat,canola.
  • Name
    grade
    Type
    string
    Description
    Grade code.
  • Name
    min_quantity
    Type
    number
    Description
    Minimum tonnes.
  • Name
    max_quantity
    Type
    number
    Description
    Maximum tonnes.
  • Name
    province
    Type
    string
    Description
    Coarse location filter, e.g. SK.
  • Name
    near
    Type
    string
    Description
    lat,lng,radius_km radius search.
  • Name
    crop_year
    Type
    integer
    Description
    Crop year.
  • Name
    is_organic
    Type
    boolean
    Description
    Organic only.
  • Name
    min_protein
    Type
    number
    Description
    Minimum protein.
  • Name
    sort
    Type
    string
    Description
    price, quantity, or listed_at (prefix - to reverse).
  • Name
    limit
    Type
    integer
    Description
    1–50, default 20.
  • Name
    offset
    Type
    integer
    Description
    Pagination offset.

Request

GET
/v1/inventory
curl "https://api.mygrainexchange.com/v1/inventory?commodity=wheat&min_quantity=50" \
  -H "Authorization: Bearer {token}"

Response

{
  "items": [
    {
      "id": "inv_3Kd9aZ",
      "commodity": { "slug": "wheat", "name": "Wheat" },
      "grade": "1CWRS",
      "quantity_mt": 86.0,
      "asking_price": { "amount": 312.50, "currency": "CAD", "unit": "MT", "firm": true },
      "quality": { "protein": 13.8, "moisture": 12.1 },
      "location": { "province": "SK", "nearest_city": "Saskatoon" },
      "listed_at": "2026-06-10T15:04:00Z"
    }
  ],
  "limit": 20, "offset": 0, "total": 214,
  "next": "https://api.mygrainexchange.com/v1/inventory?limit=20&offset=20&commodity=wheat",
  "href": "https://api.mygrainexchange.com/v1/inventory?limit=20&offset=0&commodity=wheat"
}

GET/v1/inventory/:id

Get a listing

Retrieve a single anonymized listing by its public id. Returns 404 if the lot is no longer listed.

Request

GET
/v1/inventory/inv_3Kd9aZ
curl https://api.mygrainexchange.com/v1/inventory/inv_3Kd9aZ \
  -H "Authorization: Bearer {token}"

GET/v1/inventory/filters

List filters

Returns the commodities, grades, provinces, and crop years currently present in listed inventory — use it to build filter UIs.

Request

GET
/v1/inventory/filters
curl https://api.mygrainexchange.com/v1/inventory/filters \
  -H "Authorization: Bearer {token}"

Was this page helpful?