> ## Documentation Index
> Fetch the complete documentation index at: https://docs.climatifai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /agri/soil — Soil properties for a location

> GET /agri/soil returns soil pH and texture data for a LATAM coordinate. SoilGrids integration is in progress; current responses include null values.

The soil endpoint will return soil properties — pH and texture — for any LATAM coordinate, sourced from the SoilGrids global soil database. This data is used by the crop advisor to calculate the soil pH compatibility factor.

<Note>
  SoilGrids integration is currently in progress. The endpoint is available and returns the correct response shape, but `ph` and `texture` values are `null` until the integration is complete. The crop advisor uses a neutral fallback score for soil pH when live data is unavailable.
</Note>

## Endpoint

```text theme={null}
GET api.climatifai.com/agri/soil
```

## Parameters

<ParamField query="lat" type="float" required>
  Latitude of the location in decimal degrees, WGS 84.
</ParamField>

<ParamField query="lon" type="float" required>
  Longitude of the location in decimal degrees, WGS 84.
</ParamField>

## Response

<ResponseField name="lat" type="float" required>
  Latitude echoed from the request.
</ResponseField>

<ResponseField name="lon" type="float" required>
  Longitude echoed from the request.
</ResponseField>

<ResponseField name="soil" type="object" required>
  Soil property object for the location.

  <Expandable title="soil properties">
    <ResponseField name="ph" type="float">
      Soil pH value. Currently `null` — SoilGrids integration in progress.
    </ResponseField>

    <ResponseField name="texture" type="string">
      Soil texture classification (e.g., `"sandy loam"`, `"clay"`). Currently `null` — SoilGrids integration in progress.
    </ResponseField>
  </Expandable>
</ResponseField>

## Example

<RequestExample>
  ```bash cURL theme={null}
  curl "https://api.climatifai.com/agri/soil?lat=20.5&lon=-101.0"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "lat": 20.5,
    "lon": -101.0,
    "soil": {
      "ph": null,
      "texture": null
    }
  }
  ```
</ResponseExample>
