Skip to content

Developers

Open by design

Public code, documented APIs, open reference data and an MCP server: everything you need to connect your tool to Ekylibre, Lexicon and Aiffel.

REST · OpenAPI 3

The Ekylibre API

Ekylibre exposes a JSON REST API (version 2), described in OpenAPI. Each farm is a separate data space (a tenant), selected by the subdomain or the X-Tenant header. You authenticate with a user-bound token obtained from POST /tokens.

Resources (excerpt)

cultivable_zones
fields
products
animals, equipment, plants…
variants
catalogue variants
interventions
interventions and their records
activity_productions
productions
input_totals
input totals
farm_profiles · farm_accountancy
farm profile and accounts per season
lexicon/registered_phytosanitary_*
registered plant protection products

API documentation

bash
# 1. Get a token
curl -X POST https://YOUR_INSTANCE/api/v2/tokens \
  -H "Content-Type: application/json" \
  -d '{"email": "you@example.com", "password": "…"}'

# 2. List the farm's fields
curl https://YOUR_INSTANCE/api/v2/cultivable_zones \
  -H "Authorization: simple-token you@example.com YOUR_TOKEN"

Replace YOUR_INSTANCE with the address of your Ekylibre. The token can also be sent as query parameters (access_email and access_token).

JSON · CSV · PostgreSQL

Lexicon in JSON, CSV or SQL

Every Lexicon page also exists in JSON and CSV: add .json or .csv to its address. Most of the data is open, with no key. Datasets reserved for OSFarm members need an API key, sent in the Authorization: Bearer or X-API-Key header. The data can be read from other sites (CORS enabled).

PostgreSQL packages: each dataset is a versioned package you can load into your own database. Versions, licences and source dates are listed in the catalogue.

bash
curl https://lexicon.osfarm.org/phytosanitary/products.json

# Datasets reserved for OSFarm members: add your key
curl https://lexicon.osfarm.org/… \
  -H "Authorization: Bearer YOUR_KEY"
Response (excerpt)
{
  "title": "Produits",
  "table": {
    "columns": { "name": "Nom", "firm": "Firme", "type": "Type", … },
    "rows": [ { "name": { "@type": "Text", "value": "…" }, … }, … ]
  },
  "credit": { "provider": { "value": "ANSES" }, "license": { … }, "date": { … } },
  "page": 1, "items-per-page": 150, "total-pages": …,
  "formats": { … }
}

Model Context Protocol

Plug an AI assistant into 624M records

Lexicon exposes an MCP server (JSON-RPC over HTTP). A compatible AI assistant can search and cross-reference the datasets, with their sources: identify a plot, look up a plant protection product, find a municipality or a business.

Add this configuration to your MCP client. The server name (lexicon here) is up to you; where the file lives depends on the client.

JSON
{
  "mcpServers": {
    "lexicon": {
      "type": "http",
      "url": "https://lexicon.osfarm.org/mcp"
    }
  }
}

Fourmy

Fourmy connectors and plugins

A connector brings data from a farm tool into Fourmy, or sends it out. The core stays small: integrations live alongside it, and will become standalone plugins. The plugin model is in preparation.

  • Today: a module in the repository

    Stable connectors live in the Fourmy repository (packages/connector-traccar, packages/geo-ign…). Access to the third-party service is encrypted, specific to each farm and tested before it is saved.

  • Next: a separate service

    A Fourmy plugin is a standalone service that uses the public API, with a token limited to the permissions granted and to one farm.

  • Events

    Fourmy notifies the plugin by webhook of the events it subscribed to.

  • Extension points

    The plugin can add a map layer, a panel or an intervention type, displayed in a sandboxed iframe.

  • A manifest

    Identity, version, permissions, events and extension points are declared in fourmy-plugin.json; the farmer accepts the permissions on installation.

fourmy-plugin.json
{
  "id": "weenat",
  "version": "0.1.0",
  "permissions": ["plots:read", "readings:write"],
  "events": ["plot.updated"],
  "extensions": ["map.layer", "farm.panel"]
}

Draft manifest: the format is in preparation and may still change. Fourmy repository

Fourmy connectors

Stable connectors are published in the Fourmy repository; the others are in progress. The full list, including Lyvre’s, is on the Interoperability page.

ConnectorPartnerStatusCode
Tractor GPS trackingTraccarStablepackages/connector-traccar
Terrain, aerial imagery and buildingsIGNStablepackages/geo-ign
Ekylibre farm migration—Stablepackages/migrator-ekylibre
Weather stations and probesWeenatIn progress—
Sencrop weather stationsSencropIn progress—
Connected trapsCapTrapIn progress—
IrrigationOpen SprinklerIn progress—
Livestock identificationEDEIn progress—
Livestock softwareBaobaIn progress—
Wine sales and logisticsBaqioIn progress—

Build your connector

  1. 1

    Start from the Traccar connector (packages/connector-traccar): a client for the third-party service and the mapping of its data to Fourmy’s model.

  2. 2

    Describe access to your service: credentials, connection test, sync frequency.

  3. 3

    Write the mapping to Fourmy’s contracts (@fourmy/contracts): interventions, readings, tracks, using Lexicon reference data.

  4. 4

    Add tests, documentation and translations (at least French and English).

  5. 5

    Open a contribution on the Fourmy repository, then announce it on Discord.

Fourmy architecture

Licences

The AGPL keeps Ekylibre’s code free, including when it is offered as an online service: any modified version made available to users must publish its code.

Contribute

Ekylibre’s first commit dates from September 2008: 23,192 commits and 39 contributors to date. Report a bug, suggest an improvement or new data: all contributions are welcome.