Farms

Farms are a key part of the Hello Tractor ecosystem, representing the agricultural land where tractors operate. The Hello Tractor API provides endpoints to manage and retrieve information about farms. These endpoints allow you to get details about all farms or a specific farm using its unique identifier.

The farm model

A farm model is comprised of the following.

Properties

  • Name
    farm_id
    Type
    string
    Description

    Unique identifier for the farm.

  • Name
    farm_name
    Type
    string
    Description

    Name of the farm.

  • Name
    farm_location
    Type
    object
    Description

    Location details of the farm including country, state, and coordinates.

  • Name
    farm_size
    Type
    number
    Description

    Size of the farm in hectares.

  • Name
    owner_id
    Type
    string
    Description

    Unique identifier of the farmer who owns the farm.

  • Name
    crop_types
    Type
    array
    Description

    Types of crops grown on the farm.

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp of when the farm was registered.


GET/v1/farms

List all farms

This endpoint allows you to retrieve a paginated list of all farms. By default, a maximum of 25 farms are shown per page.

Optional attributes

  • Name
    limit
    Type
    integer
    Description

    Limit the number of farms returned.

  • Name
    offset
    Type
    integer
    Description

    Offset for pagination.

Request

GET
/v1/farms
curl -G https://api.hellotractor.com/v1/farms \
  -H "Authorization: Bearer {token}" \
  -d limit=10

Response

{
  "data": [
    {
      "farm_id": "farm_123456",
      "farm_name": "Green Valley Farm",
      "farm_location": {
        "country": "Kenya",
        "state": "Nakuru",
        "coordinates": {
          "latitude": -0.3031,
          "longitude": 36.0800
        }
      },
      "farm_size": 50.5,
      "owner_id": "farmer_789",
      "crop_types": ["maize", "wheat", "beans"],
      "created_at": "2024-01-15T10:30:00Z"
    },
    {
      "farm_id": "farm_789012",
      // ...
    }
  ],
  "pagination": {
    "total": 150,
    "limit": 25,
    "offset": 0
  }
}
GET/v1/farms/:farm_id

Retrieve a farm

This endpoint allows you to retrieve farm details using the farm id. Refer to the list at the top of this page to see which properties are included with farm objects.

Request

GET
/v1/farms/farm_123456
curl https://api.hellotractor.com/v1/farms/farm_123456 \
  -H "Authorization: Bearer {token}"

Response

{
  "farm_id": "farm_123456",
  "farm_name": "Green Valley Farm",
  "farm_location": {
    "country": "Kenya",
    "state": "Nakuru",
    "coordinates": {
      "latitude": -0.3031,
      "longitude": 36.0800
    }
  },
  "farm_size": 50.5,
  "owner_id": "farmer_789",
  "crop_types": ["maize", "wheat", "beans"],
  "created_at": "2024-01-15T10:30:00Z"
}

New collaborators request access first; approved teams sign in and register integrations.

Was this page helpful?