Skip to main content
The /v1/search endpoint returns farms within a geographic radius of a given coordinate. Results are sorted by distance from your origin point and include a computed distance_mi field on every record.
GET https://api.bhumifarms.co/v1/search

Parameters

Required

lat
number
required
Latitude of the origin point (decimal degrees). Example: 33.08.
lng
number
required
Longitude of the origin point (decimal degrees). Example: -96.54.

Optional

radius
number
default:"25"
Search radius in miles. Minimum 1, maximum 100. Values outside this range are clamped.
products
string
Comma-separated list of product names to filter by. Only farms that carry at least one of the listed products are returned. Example: grass-fed beef,pastured eggs.
categories
string
Comma-separated list of product categories. Example: meat,dairy.
certifications
string
Comma-separated list of certifications. Only farms holding at least one of the listed certifications are returned. Example: USDA Organic,Animal Welfare Approved.
q
string
Free-text search term matched against farm name, city, and state. Maximum 120 characters.
page
number
default:"1"
Page number for paginated results. Minimum 1.
per_page
number
default:"20"
Number of results per page. Minimum 1, maximum 100.
The total field in meta is always null for search requests. Use has_more to determine whether additional pages exist.

Example request

curl "https://api.bhumifarms.co/v1/search?lat=33.08&lng=-96.54&radius=25&products=grass-fed%20beef,pastured%20eggs" \
  -H "X-API-Key: bh_live_your_key_here"

Example response

{
  "data": [
    {
      "id": "farm_abc123",
      "name": "Prairie Farmstead",
      "city": "Sherman",
      "state": "TX",
      "lat": 33.635,
      "lng": -96.609,
      "place_type": "farm",
      "products": ["grass-fed beef", "pastured eggs", "bacon"],
      "categories": ["meat", "eggs"],
      "distance_mi": 12.4
    }
  ],
  "meta": {
    "count": 20,
    "total": null,
    "page": 1,
    "per_page": 20,
    "has_more": true
  },
  "links": {
    "self": "/api/v1/search?page=1&per_page=20",
    "next": "/api/v1/search?page=2&per_page=20"
  }
}
On the paid tier, each farm object also includes: address, zip, phone, website, email, description, certifications, practices, delivery_options, quality_score, quality_tier, google_rating, image_url, hours_json, and more.

Response fields

id
string
Unique farm identifier.
name
string
Farm display name.
city
string
City where the farm is located.
state
string
Two-letter US state abbreviation.
lat
number
Farm latitude.
lng
number
Farm longitude.
place_type
string
Classification of the farm operation. Common values: farm, ranch, market, csa.
products
string[]
Array of product names offered by the farm.
categories
string[]
Array of product category names.
distance_mi
number
Distance in miles from the provided lat/lng origin, rounded to one decimal place.